Skip to content

handle macro_rules substitutions across the codebase - #230

Open
sunshowers wants to merge 1 commit into
jj-stack/display-better-message-for-a-missing-wrapper-value-otvvnpmlfrom
jj-stack/handle-macro-rules-substitutions-across-the-codebase-ksmmqsto
Open

handle macro_rules substitutions across the codebase#230
sunshowers wants to merge 1 commit into
jj-stack/display-better-message-for-a-missing-wrapper-value-otvvnpmlfrom
jj-stack/handle-macro-rules-substitutions-across-the-codebase-ksmmqsto

Conversation

@sunshowers

Copy link
Copy Markdown
Contributor

As mentioned in the previous commit, rustc wraps tokens with None delimiters in case of declarative macro substitutions. Previously, only deserialize_any descended into them. Extend that to also cover all other types.

With this change, every deserialize_* method that reads a token now starts with a block which looks for this transparent thing. The only exception is deserialize_bytes which we use for other purposes.

Also, skip over empty macro substitutions within TokenDe so that other parts of the code don't need to special-case them.

As mentioned in the previous commit, rustc wraps tokens with `None` delimiters in case of declarative macro substitutions. Previously, only `deserialize_any` descended into them. Extend that to also cover all other types.

With this change, every `deserialize_*` method that reads a token now starts with a block which looks for this transparent thing. The only exception is `deserialize_bytes` which we use for other purposes.

Also, skip over empty macro substitutions within `TokenDe` so that other parts of the code don't need to special-case them.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant