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

Some token stream cleanups #98278

Merged
merged 5 commits into from
Jun 21, 2022

Commits on Jun 19, 2022

  1. Remove Cursor::append.

    It's a weird function: it lets you modify the token stream in the middle
    of iteration. There is only one call site, and it is only used for the
    rare `ProceduralMasquerade` legacy case.
    nnethercote committed Jun 19, 2022
    Configuration menu
    Copy the full SHA
    ccd956a View commit details
    Browse the repository at this point in the history
  2. Remove Cursor::index.

    It's unused.
    nnethercote committed Jun 19, 2022
    Configuration menu
    Copy the full SHA
    178b746 View commit details
    Browse the repository at this point in the history
  3. Remove TokenStream::from_streams.

    By inlining it into the only non-test call site. The one test call site
    is changed to use `TokenStreamBuilder`.
    nnethercote committed Jun 19, 2022
    Configuration menu
    Copy the full SHA
    f6b5788 View commit details
    Browse the repository at this point in the history

Commits on Jun 20, 2022

  1. Merge TokenStreamBuilder::push into TokenStreamBuilder::build.

    Both functions do some modifying of streams using `make_mut`:
    - `push` sometimes glues the first token of the next stream to the last
      token of the first stream.
    - `build` appends tokens to the first stream.
    
    By doing all of this in the one place, things are simpler. The first
    stream can be modified in both ways (if necessary) in the one place, and
    any next stream with the first token removed doesn't need to be stored.
    nnethercote committed Jun 20, 2022
    Configuration menu
    Copy the full SHA
    2a5487a View commit details
    Browse the repository at this point in the history
  2. Add blank lines between methods in proc_macro_server.rs.

    Because that's the standard way of doing it.
    nnethercote committed Jun 20, 2022
    Configuration menu
    Copy the full SHA
    69f45b7 View commit details
    Browse the repository at this point in the history