aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/parse/rust-parse-impl.h
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2022-02-20 14:34:37 +0000
committerGitHub <noreply@github.com>2022-02-20 14:34:37 +0000
commit796465596faa9fa69ffede1c16d944e6a6e24458 (patch)
tree16b2a74efab22fedab1448a7b6872c452072c19a /gcc/rust/parse/rust-parse-impl.h
parent4e096b1f14671270fb0c7b449d92b3e558bb769d (diff)
parentd0d4dcfdb438af7c5f15afeba2ca77ecbe2be013 (diff)
downloadgcc-796465596faa9fa69ffede1c16d944e6a6e24458.zip
gcc-796465596faa9fa69ffede1c16d944e6a6e24458.tar.gz
gcc-796465596faa9fa69ffede1c16d944e6a6e24458.tar.bz2
Merge #950
950: Match macro repetitions r=CohenArthur a=CohenArthur This PR adds support for matching macro invocations and counting the amount of times they've been matched Co-authored-by: Arthur Cohen <arthur.cohen@embecosm.com>
Diffstat (limited to 'gcc/rust/parse/rust-parse-impl.h')
-rw-r--r--gcc/rust/parse/rust-parse-impl.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h
index 2260a95..af8f625 100644
--- a/gcc/rust/parse/rust-parse-impl.h
+++ b/gcc/rust/parse/rust-parse-impl.h
@@ -1991,20 +1991,19 @@ Parser<ManagedTokenSource>::parse_macro_match_repetition ()
// parse repetition operator
t = lexer.peek_token ();
- AST::MacroMatchRepetition::MacroRepOp op
- = AST::MacroMatchRepetition::ASTERISK;
+ AST::MacroMatchRepetition::MacroRepOp op = AST::MacroMatchRepetition::NONE;
switch (t->get_id ())
{
case ASTERISK:
- op = AST::MacroMatchRepetition::ASTERISK;
+ op = AST::MacroMatchRepetition::ANY;
lexer.skip_token ();
break;
case PLUS:
- op = AST::MacroMatchRepetition::PLUS;
+ op = AST::MacroMatchRepetition::ONE_OR_MORE;
lexer.skip_token ();
break;
case QUESTION_MARK:
- op = AST::MacroMatchRepetition::QUESTION_MARK;
+ op = AST::MacroMatchRepetition::ZERO_OR_ONE;
lexer.skip_token ();
break;
default: