aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/expand/rust-macro-expand.cc
diff options
context:
space:
mode:
authorArthur Cohen <arthur.cohen@embecosm.com>2022-03-24 15:03:20 +0100
committerArthur Cohen <arthur.cohen@embecosm.com>2022-03-24 15:03:20 +0100
commit5651331236d39ce685e1de3396463fd88c3a83d2 (patch)
tree3729e3e925c99ac127e593918544c43fc4a2d855 /gcc/rust/expand/rust-macro-expand.cc
parent8283724bc24efc0c11960947f2d4e99bc20b3765 (diff)
downloadgcc-5651331236d39ce685e1de3396463fd88c3a83d2.zip
gcc-5651331236d39ce685e1de3396463fd88c3a83d2.tar.gz
gcc-5651331236d39ce685e1de3396463fd88c3a83d2.tar.bz2
macros: Allow parsing :tt fragments
:tt fragments stand for token trees, and are composed of either a token, or a delimited token tree, which is a token tree surrounded by delimiters (parentheses, curly brackets or square brackets). This should allow us to handle a lot more macros, including extremely powerful macro patterns such as TT munchers
Diffstat (limited to 'gcc/rust/expand/rust-macro-expand.cc')
-rw-r--r--gcc/rust/expand/rust-macro-expand.cc4
1 files changed, 1 insertions, 3 deletions
diff --git a/gcc/rust/expand/rust-macro-expand.cc b/gcc/rust/expand/rust-macro-expand.cc
index e0dfc50..6227344 100644
--- a/gcc/rust/expand/rust-macro-expand.cc
+++ b/gcc/rust/expand/rust-macro-expand.cc
@@ -497,10 +497,8 @@ MacroExpander::match_fragment (Parser<MacroInvocLexer> &parser,
gcc_unreachable ();
break;
- // what is TT?
case AST::MacroFragSpec::TT:
- // parser.parse_token_tree() ?
- gcc_unreachable ();
+ parser.parse_token_tree ();
break;
// i guess we just ignore invalid and just error out