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
feat: Expose clap_lex #3635
feat: Expose clap_lex #3635
Commits on Apr 15, 2022
-
-
-
refactor(lex): Narrow focus for lexer
Before, we had a generic `next` that provided the next item and peeked at all remaining items. This was to work around the borrow checker for modifying the position while accessing args. We've now split `Input` into `RawArgs` and `ArgsCursor` so we don't have overlapping borrows. This made it so we can split `next` into `next`, `peek`, and `remaining`.
-
refactor(lex): Experiment with an alt 'previous'
Since we'll need `skip`, it made me wonder how to name `skip` and `previous` to fit together, so I decided to play with `seek`. Its probably over kill but wondering if its better.
-
refactor(lex): Track replacements as str
The lexer will soon return `RawOsStr` and it'll cost to turn that into an `OsStr`. However, it caches a `str`, so let's just use that.
-
refactor(lex): Expand lexer design
In considering the design for this, we want: - Ability to modify the argment list while maintaining the `Cursor` for replacements - Allow picking up subcommand parsing in the middle of short flags - Ability to peek at the next item to determine if we want to treat it as a flag or as a value - Ability to detect started short and long arguments for completions Longer term, we also want to consider: - Allowing users to customize the lexer to support different syntaxes
-
-
-
-
-
-
-
test(lex): Verify behavior directly
While figuring out the API, `clap_lex` was tested by clap's tests. Now we are focusing on its API directly.
-
-
docs(lex): Make a determination on to_long_stdio
This tempts me to drop our design philosophy but I want to give it more time.
-
-
-