aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/expand/rust-macro-expand.h
diff options
context:
space:
mode:
authorArthur Cohen <arthur.cohen@embecosm.com>2022-08-29 12:51:33 +0200
committerArthur Cohen <arthur.cohen@embecosm.com>2023-01-31 14:16:49 +0100
commit1fed030c16519c0ebedb4cf0c6cebaa9ffa32e66 (patch)
treeeb4c5bd6a99ad154f0d395260a59292acfafb157 /gcc/rust/expand/rust-macro-expand.h
parentf7014b28b81f43f62086d75222a9cfe7ca562b27 (diff)
downloadgcc-1fed030c16519c0ebedb4cf0c6cebaa9ffa32e66.zip
gcc-1fed030c16519c0ebedb4cf0c6cebaa9ffa32e66.tar.gz
gcc-1fed030c16519c0ebedb4cf0c6cebaa9ffa32e66.tar.bz2
gccrs: macros: Handle matchers properly in repetitions
gcc/rust/ChangeLog: * expand/rust-macro-expand.cc (MacroExpander::match_matcher): Handle fragments differently based on whether or not we are currently trying to match a matcher in a repetition context. (MacroExpander::match_n_matches): Use new `in_repetition` argument properly when calling `match_matcher`. * expand/rust-macro-expand.h (MacroExpander::match_matcher): Allow passing extra `in_repetition` bool argument gcc/testsuite/ChangeLog: * rust/compile/macro43.rs: New test.
Diffstat (limited to 'gcc/rust/expand/rust-macro-expand.h')
-rw-r--r--gcc/rust/expand/rust-macro-expand.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/rust/expand/rust-macro-expand.h b/gcc/rust/expand/rust-macro-expand.h
index 97a0269..bef1402 100644
--- a/gcc/rust/expand/rust-macro-expand.h
+++ b/gcc/rust/expand/rust-macro-expand.h
@@ -273,7 +273,7 @@ struct MacroExpander
AST::MacroMatchRepetition &rep);
bool match_matcher (Parser<MacroInvocLexer> &parser,
- AST::MacroMatcher &matcher);
+ AST::MacroMatcher &matcher, bool in_repetition = false);
/**
* Match any amount of matches