aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/ast/rust-macro.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/ast/rust-macro.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/ast/rust-macro.h')
-rw-r--r--gcc/rust/ast/rust-macro.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/rust/ast/rust-macro.h b/gcc/rust/ast/rust-macro.h
index b5370d8..995b255 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:
@@ -206,6 +206,9 @@ public:
return MacroMatchType::Repetition;
}
+ MacroRepOp get_op () const { return op; }
+ std::vector<std::unique_ptr<MacroMatch> > &get_matches () { return matches; }
+
protected:
/* Use covariance to implement clone function as returning this object rather
* than base */