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

Interpolated cleanups #122752

Merged
merged 12 commits into from
Mar 21, 2024
Merged

Interpolated cleanups #122752

merged 12 commits into from
Mar 21, 2024

Commits on Mar 20, 2024

  1. Factor out tt pushes.

    nnethercote committed Mar 20, 2024
    Configuration menu
    Copy the full SHA
    099e716 View commit details
    Browse the repository at this point in the history
  2. Rename Token::is_path.

    This makes it consistent with `is_whole_expr` and `is_whole_block`.
    nnethercote committed Mar 20, 2024
    Configuration menu
    Copy the full SHA
    b9ead99 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d919dbe View commit details
    Browse the repository at this point in the history
  4. Rewrite parse_meta_item.

    It can't use `maybe_whole`, but it can match `maybe_whole` more closely.
    
    Also add a test for a case that wasn't previously covered.
    nnethercote committed Mar 20, 2024
    Configuration menu
    Copy the full SHA
    8ac16c6 View commit details
    Browse the repository at this point in the history
  5. Use maybe_whole! to streamline parse_item_common.

    This requires changing `maybe_whole!` so it allows the value to be
    modified.
    nnethercote committed Mar 20, 2024
    Configuration menu
    Copy the full SHA
    d4ad322 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    0de050b View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    0957222 View commit details
    Browse the repository at this point in the history
  8. Fix some formatting.

    nnethercote committed Mar 20, 2024
    Configuration menu
    Copy the full SHA
    c14d9ae View commit details
    Browse the repository at this point in the history
  9. Fix out-of-date comment.

    nnethercote committed Mar 20, 2024
    Configuration menu
    Copy the full SHA
    dbed10a View commit details
    Browse the repository at this point in the history
  10. Remove non-useful code path.

    It has no effect on anything in the test suite.
    nnethercote committed Mar 20, 2024
    Configuration menu
    Copy the full SHA
    b7f3b71 View commit details
    Browse the repository at this point in the history
  11. Streamline NamedMatch.

    This commit combines `MatchedTokenTree` and `MatchedNonterminal`, which
    are often considered together, into a single `MatchedSingle`. It shares
    a representation with the newly-parameterized `ParseNtResult`.
    
    This will also make things much simpler if/when variants from
    `Interpolated` start being moved to `ParseNtResult`.
    nnethercote committed Mar 20, 2024
    Configuration menu
    Copy the full SHA
    a94bb2a View commit details
    Browse the repository at this point in the history
  12. Shrink the comment on TokenTree.

    It uses very old language that is more confusing today than helpful,
    including references to `SubstNt` that no longer exists. The comment
    above `TokenStream` is better, and suffices for a basic understanding of
    these types.
    nnethercote committed Mar 20, 2024
    Configuration menu
    Copy the full SHA
    82a609f View commit details
    Browse the repository at this point in the history