diff options
author | Arthur Cohen <arthur.cohen@embecosm.com> | 2022-02-18 11:18:03 +0100 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2022-02-18 11:18:03 +0100 |
commit | 472c0a3057454247e121c574f2e8cf71fdbfd0c9 (patch) | |
tree | b78a826a666d2a38e7d930660c66e5ed26eddb27 /gcc | |
parent | 9fb06d66cef70584e7aa2fa3a6ad22ef7def6b84 (diff) | |
download | gcc-472c0a3057454247e121c574f2e8cf71fdbfd0c9.zip gcc-472c0a3057454247e121c574f2e8cf71fdbfd0c9.tar.gz gcc-472c0a3057454247e121c574f2e8cf71fdbfd0c9.tar.bz2 |
macro-repetition: Rename enum variants to better reflect repetition kind
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/rust/ast/rust-ast-full-test.cc | 6 | ||||
-rw-r--r-- | gcc/rust/ast/rust-macro.h | 6 | ||||
-rw-r--r-- | gcc/rust/parse/rust-parse-impl.h | 9 |
3 files changed, 10 insertions, 11 deletions
diff --git a/gcc/rust/ast/rust-ast-full-test.cc b/gcc/rust/ast/rust-ast-full-test.cc index 3a1e295..5244501 100644 --- a/gcc/rust/ast/rust-ast-full-test.cc +++ b/gcc/rust/ast/rust-ast-full-test.cc @@ -2446,13 +2446,13 @@ MacroMatchRepetition::as_string () const str += "\n Op: "; switch (op) { - case ASTERISK: + case ANY: str += "*"; break; - case PLUS: + case ONE_OR_MORE: str += "+"; break; - case QUESTION_MARK: + case ZERO_OR_ONE: str += "?"; break; case NONE: diff --git a/gcc/rust/ast/rust-macro.h b/gcc/rust/ast/rust-macro.h index b5370d8..fed4589 100644 --- a/gcc/rust/ast/rust-macro.h +++ b/gcc/rust/ast/rust-macro.h @@ -134,9 +134,9 @@ public: enum MacroRepOp { NONE, - ASTERISK, - PLUS, - QUESTION_MARK + ANY, + ONE_OR_MORE, + ZERO_OR_ONE, }; private: diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h index 784e6d1..e667ebe 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: |