-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scope subcommand followed by other tokens #23
Commits on Jul 17, 2023
-
Scope lowercase terms when followed by other terms
Terms as in "defined terms". Mostly for subcommands followed by arguments or other subcommands. Which are defined terms themselves, but still not handled. e.g.: "reconnect device kick connection from device side to ..." In terms of regression delta, census: - adb: ok, it motivated this change - chown: not ideal, examples with chown itself are scoped. but acceptable. - npm: idem. - dpkg: not cool, I should limit term sequences to 3-4 terms Some unhandled cases in adb, chown and npm, - reveal the single_2_space variable does't work - show a need to treat definitions that do \n after the terms
Configuration menu - View commit details
-
Copy full SHA for 3e4ef4a - Browse repository at this point
Copy the full SHA 3e4ef4aView commit details -
I was debugging a problem that didn't exist 😱
Configuration menu - View commit details
-
Copy full SHA for 80382b0 - Browse repository at this point
Copy the full SHA 80382b0View commit details -
Add tests showing what's wrong with other-term-seq
It's like it doesn't properly use all the {{long_space}} cases (newline and single_2_space)
Configuration menu - View commit details
-
Copy full SHA for beae871 - Browse repository at this point
Copy the full SHA beae871View commit details -
Scope argument after subcommand
But it's kinda weird because in forward --remove LOCAL it scopes the LOCAL but skips the --remove. I guess this skip happens in the option-def+space context? Anyways, worth running the syntest debugger on. But not today!
Configuration menu - View commit details
-
Copy full SHA for dd43878 - Browse repository at this point
Copy the full SHA dd43878View commit details -
Configuration menu - View commit details
-
Copy full SHA for db357da - Browse repository at this point
Copy the full SHA db357daView commit details -
Configuration menu - View commit details
-
Copy full SHA for 83941df - Browse repository at this point
Copy the full SHA 83941dfView commit details -
Rename other-def -> keyword, other-variable -> variable
For ease of use. Other X is less wrong but a little more unwieldy to write and reason about.
Configuration menu - View commit details
-
Copy full SHA for 4094410 - Browse repository at this point
Copy the full SHA 4094410View commit details -
Rename "..other.def.." scope to "keyword"
To reflect the new change in KEYWORD_SCOPES' name
Configuration menu - View commit details
-
Copy full SHA for 1dbc324 - Browse repository at this point
Copy the full SHA 1dbc324View commit details -
Configuration menu - View commit details
-
Copy full SHA for adc4446 - Browse repository at this point
Copy the full SHA adc4446View commit details -
But I'm considering leaving the later unscoped, or any other 2nd term after a keyword term. Cause it causes regressions in other, more common commands, where it scopes terms in examples. (As in every other delta in this commit)
Configuration menu - View commit details
-
Copy full SHA for 09e84e7 - Browse repository at this point
Copy the full SHA 09e84e7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 32cdd01 - Browse repository at this point
Copy the full SHA 32cdd01View commit details -
And it introduces a hell of a regression in the Usage section of a few other commands. This is breaking for me, we'll probably do the 1st keyword only.
Configuration menu - View commit details
-
Copy full SHA for 437fc88 - Browse repository at this point
Copy the full SHA 437fc88View commit details -
But this introduces quite a bit of regression. See syntax_test_cp
Configuration menu - View commit details
-
Copy full SHA for ceefab3 - Browse repository at this point
Copy the full SHA ceefab3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2157efe - Browse repository at this point
Copy the full SHA 2157efeView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9887fbd - Browse repository at this point
Copy the full SHA 9887fbdView commit details -
Rename scripts/env.sh to ../utils
The shelcheck directive is explained here: https://www.shellcheck.net/wiki/SC2148
Configuration menu - View commit details
-
Copy full SHA for 57748ff - Browse repository at this point
Copy the full SHA 57748ffView commit details -
Don't scope the 2nd term after a subcommand
To avoid inconsistent scoping in the usage/examples section of a bunch of help messages. But keep these scope assignations as comments, for future reference.
Configuration menu - View commit details
-
Copy full SHA for a064b0f - Browse repository at this point
Copy the full SHA a064b0fView commit details -
Configuration menu - View commit details
-
Copy full SHA for f59e14e - Browse repository at this point
Copy the full SHA f59e14eView commit details -
Handle ""pair HOST[:PORT] ..." from adb
Only the "pair" bit. This is all so overfitted, to suit adb's help message only, that it's making me feel icky. But, on the other hand, it's also a good census of all kinds of patterns that we don't currently have a proper way to handle. And if it doesn't add too many unnecessary scopes for other help messages, I don't care much, I guess?
Configuration menu - View commit details
-
Copy full SHA for fda6af9 - Browse repository at this point
Copy the full SHA fda6af9View commit details -
Configuration menu - View commit details
-
Copy full SHA for e42fe00 - Browse repository at this point
Copy the full SHA e42fe00View commit details -
Configuration menu - View commit details
-
Copy full SHA for 11071bb - Browse repository at this point
Copy the full SHA 11071bbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 938f74b - Browse repository at this point
Copy the full SHA 938f74bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6a70341 - Browse repository at this point
Copy the full SHA 6a70341View commit details -
Configuration menu - View commit details
-
Copy full SHA for f8bf10d - Browse repository at this point
Copy the full SHA f8bf10dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 310a626 - Browse repository at this point
Copy the full SHA 310a626View commit details -
We're handling subcommand sub-tokens in an explicit manner, without abstraction / generalization. At least for the time being.
Configuration menu - View commit details
-
Copy full SHA for bd64ca0 - Browse repository at this point
Copy the full SHA bd64ca0View commit details -
Handle "bat <SUBCOMMAND>" from bat
Now we're scoping command keywords in usage lines so as to make them coherent. Otherwise, some help messages show usage lines with and without the command colorized.
Configuration menu - View commit details
-
Copy full SHA for 3de9f62 - Browse repository at this point
Copy the full SHA 3de9f62View commit details -
Separate {{long_space}} and {{single_2_space}}
I hoped to catch the tricky chown case with this, but I think I know why it's failing: we do not `set: then-pop" in keyword-seq-def matches !! As a side effect, we scoped "operand=VALUE" operands in dd, which is nice. As another side effect, we scoped "or:" usage lines in vim, which is bad but easy to fix (next commit).
Configuration menu - View commit details
-
Copy full SHA for 885f8c8 - Browse repository at this point
Copy the full SHA 885f8c8View commit details -
Don't scope "or:" as keyword other
Cause it's an alternative connector in Usage lines
Configuration menu - View commit details
-
Copy full SHA for 833cbb9 - Browse repository at this point
Copy the full SHA 833cbb9View commit details -
Properly
set: then-pop
after each keyword-seq-def matchI hoped to catch the chown corner case with this but no such luck. Instead, we caught a stray adb bug that I had forgotten all about (but my syntax tests didn't :D ).
Configuration menu - View commit details
-
Copy full SHA for 751858f - Browse repository at this point
Copy the full SHA 751858fView commit details
Commits on Jul 18, 2023
-
To harmonize with the following line, where "bat" is scoped. This is very hacky but highlighting bat's help message properly is a big priority for this syntax, as bat is our only playground. Also renames the test file, cause it was incorrectly versioned 23.0.0
Configuration menu - View commit details
-
Copy full SHA for aa81feb - Browse repository at this point
Copy the full SHA aa81febView commit details -
Handle "mount [options] ..." from mount
This change also has lots of side-effects. ghc, ghci and tealdeer are ok It leaves the jq in the "usage: jq ..." line not scoped, but it's acceptable to me. Not like bat's case.
Configuration menu - View commit details
-
Copy full SHA for a700040 - Browse repository at this point
Copy the full SHA a700040View commit details -
Change a todo comment priority
Cause keyword=VALUE looks pretty ugly if only the former is colorized.
Configuration menu - View commit details
-
Copy full SHA for 22ceeb2 - Browse repository at this point
Copy the full SHA 22ceeb2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7e46345 - Browse repository at this point
Copy the full SHA 7e46345View commit details -
Configuration menu - View commit details
-
Copy full SHA for 01e0bbf - Browse repository at this point
Copy the full SHA 01e0bbfView commit details
Commits on Jul 29, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 5950372 - Browse repository at this point
Copy the full SHA 5950372View commit details
Commits on Jul 30, 2023
-
Configuration menu - View commit details
-
Copy full SHA for c862758 - Browse repository at this point
Copy the full SHA c862758View commit details -
Configuration menu - View commit details
-
Copy full SHA for 682bc7d - Browse repository at this point
Copy the full SHA 682bc7dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 76dd911 - Browse repository at this point
Copy the full SHA 76dd911View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7e18cd8 - Browse repository at this point
Copy the full SHA 7e18cd8View commit details -
Fix regex for lookahead_single_2_space
Because it was matching the 2-space with the first lookahead, without consuming the characters it matched. Then it matched the second (negative) lookahead with the same 2-space. But because it's negative, the whole match failed. We just have to circumscribe the 2nd lookahead (negative) within the first one. This catches the 2 stray corner cases that I wanted to fix before merging this branch: one line each in chown and npm. But it also adds a hell of a regression in that it now matches plain text from a lot of help messages. But this can be fixed easily enough, cf. next commit.
Configuration menu - View commit details
-
Copy full SHA for f597e53 - Browse repository at this point
Copy the full SHA f597e53View commit details -
Don't scope plain words with lookahead_single_2_space
The pattern we incorrectly matched was lines including some kind of justified text, with ". " We can safely match this pattern out.
Configuration menu - View commit details
-
Copy full SHA for 07b0b4e - Browse repository at this point
Copy the full SHA 07b0b4eView commit details -
Configuration menu - View commit details
-
Copy full SHA for fc97338 - Browse repository at this point
Copy the full SHA fc97338View commit details
Commits on Jul 31, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 2800545 - Browse repository at this point
Copy the full SHA 2800545View commit details