summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser/nonterminal.rs
AgeCommit message (Collapse)AuthorLines
2020-12-27Don't allow `const` to begin a nonterminalCamelid-0/+2
Thanks to Vadim Petrochenkov who [told me what the fix was][z]! [z]: https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/finding.20which.20macro.20rule.20to.20use/near/220240422
2020-10-30Fix even more clippy warningsJoshua Nelson-14/+8
2020-10-22Don't create an empty `LazyTokenStream`Aaron Hill-10/+10
2020-10-21Unconditionally capture tokens for attributes.Aaron Hill-1/+1
This allows us to avoid synthesizing tokens in `prepend_attr`, since we have the original tokens available. We still need to synthesize tokens when expanding `cfg_attr`, but this is an unavoidable consequence of the syntax of `cfg_attr` - the user does not supply the `#` and `[]` tokens that a `cfg_attr` expands to.
2020-09-10Attach tokens to `ast::Stmt`Aaron Hill-4/+14
We currently only attach tokens when parsing a `:stmt` matcher for a `macro_rules!` macro. Proc-macro attributes on statements are still unstable, and need additional work.
2020-09-10Attach `TokenStream` to `ast::Visibility`Aaron Hill-1/+9
A `Visibility` does not have outer attributes, so we only capture tokens when parsing a `macro_rules!` matcher
2020-09-10Attach `TokenStream` to `ast::Path`Aaron Hill-1/+9
2020-09-10Attach tokens to `NtMeta` (`ast::AttrItem`)Aaron Hill-1/+8
An `AttrItem` does not have outer attributes, so we only capture tokens when parsing a `macro_rules!` matcher
2020-09-10Collect tokens when handling `:literal` matcherAaron Hill-1/+9
An `NtLiteral` just wraps an `Expr`, so we don't need to add a new `tokens` field to an AST struct.
2020-09-10Attach `TokenStream` to `ast::Ty`Aaron Hill-1/+8
A `Ty` does not have outer attributes, so we only capture tokens when parsing a `macro_rules!` matcher
2020-09-10Attach `TokenStream` to `ast::Block`Aaron Hill-1/+8
A `Block` does not have outer attributes, so we only capture tokens when parsing a `macro_rules!` matcher
2020-08-30mv compiler to compiler/mark-0/+170