Skip to content
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

Merged
merged 18 commits into from Apr 15, 2022
Merged

feat: Expose clap_lex #3635

merged 18 commits into from Apr 15, 2022

Commits on Apr 15, 2022

  1. Copy the full SHA
    6512078 View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    0000d50 View commit details
    Browse the repository at this point in the history
  3. 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`.
    epage committed Apr 15, 2022
    Copy the full SHA
    3ebf61e View commit details
    Browse the repository at this point in the history
  4. 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.
    epage committed Apr 15, 2022
    Copy the full SHA
    f66d8ab View commit details
    Browse the repository at this point in the history
  5. 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.
    epage committed Apr 15, 2022
    Copy the full SHA
    c58928b View commit details
    Browse the repository at this point in the history
  6. 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
    epage committed Apr 15, 2022
    Copy the full SHA
    6e05b80 View commit details
    Browse the repository at this point in the history
  7. Copy the full SHA
    fd16ee9 View commit details
    Browse the repository at this point in the history
  8. Copy the full SHA
    6148d68 View commit details
    Browse the repository at this point in the history
  9. Copy the full SHA
    1247a95 View commit details
    Browse the repository at this point in the history
  10. Copy the full SHA
    6291289 View commit details
    Browse the repository at this point in the history
  11. feat(lex): Pull out clap_lex

    epage committed Apr 15, 2022
    Copy the full SHA
    96dc6da View commit details
    Browse the repository at this point in the history
  12. docs(lex): Provide examples

    epage committed Apr 15, 2022
    Copy the full SHA
    c3445e0 View commit details
    Browse the repository at this point in the history
  13. 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.
    epage committed Apr 15, 2022
    Copy the full SHA
    913ec6d View commit details
    Browse the repository at this point in the history
  14. Copy the full SHA
    e46cf65 View commit details
    Browse the repository at this point in the history
  15. 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.
    epage committed Apr 15, 2022
    Copy the full SHA
    687d361 View commit details
    Browse the repository at this point in the history
  16. Copy the full SHA
    530db32 View commit details
    Browse the repository at this point in the history
  17. docs(lex): Fix links

    epage committed Apr 15, 2022
    Copy the full SHA
    2f0d916 View commit details
    Browse the repository at this point in the history
  18. style: Make clippy happy

    epage committed Apr 15, 2022
    Copy the full SHA
    15d8b3b View commit details
    Browse the repository at this point in the history