diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2022-03-23 09:00:05 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-23 09:00:05 +0000 |
commit | b9720caa100efa6758a5f0d54d3764072d83be41 (patch) | |
tree | 5b1cf22e2ed1065889d29ef358bf55968beebf3c /gcc/rust/expand/rust-macro-expand.cc | |
parent | 1d34c120c4754b921ac0520585cfef0e7a0bbb29 (diff) | |
parent | 35ca685200830626e5abd623f65a850649beace2 (diff) | |
download | gcc-b9720caa100efa6758a5f0d54d3764072d83be41.zip gcc-b9720caa100efa6758a5f0d54d3764072d83be41.tar.gz gcc-b9720caa100efa6758a5f0d54d3764072d83be41.tar.bz2 |
Merge #1044
1044: Restrict follow-up tokens on `expr` and `stmt` r=CohenArthur a=CohenArthur
This adds a base for respecting the [Macro Follow-Set Ambiguity specification](https://doc.rust-lang.org/reference/macro-ambiguity.html).
If the design is validated, adding more restrictions on other fragment specifiers should not be difficult
Addresses #947
Co-authored-by: Arthur Cohen <arthur.cohen@embecosm.com>
Diffstat (limited to 'gcc/rust/expand/rust-macro-expand.cc')
-rw-r--r-- | gcc/rust/expand/rust-macro-expand.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/rust/expand/rust-macro-expand.cc b/gcc/rust/expand/rust-macro-expand.cc index 30f0f30..fbcc8f3 100644 --- a/gcc/rust/expand/rust-macro-expand.cc +++ b/gcc/rust/expand/rust-macro-expand.cc @@ -439,7 +439,7 @@ bool MacroExpander::match_fragment (Parser<MacroInvocLexer> &parser, AST::MacroMatchFragment &fragment) { - switch (fragment.get_frag_spec ()) + switch (fragment.get_frag_spec ().get_kind ()) { case AST::MacroFragSpec::EXPR: parser.parse_expr (); |