diff options
author | Owen Avery <powerboat9.gamer@gmail.com> | 2023-05-30 16:24:08 -0400 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2023-06-01 15:21:53 +0000 |
commit | d0e9f47b084611a6a8c3a407770160874e1c431a (patch) | |
tree | bc8b71a11216aa07a224eabe36b6e7f37bb0ad29 /gcc/rust/parse/rust-parse.h | |
parent | 18c00a4c0c12e721755adf4a4869b6fa7ef1784d (diff) | |
download | gcc-d0e9f47b084611a6a8c3a407770160874e1c431a.zip gcc-d0e9f47b084611a6a8c3a407770160874e1c431a.tar.gz gcc-d0e9f47b084611a6a8c3a407770160874e1c431a.tar.bz2 |
Properly match delimiters
gcc/rust/ChangeLog:
* expand/rust-macro-expand.cc
(MacroExpander::try_match_rule): Don't match delimiters for root matcher.
(MacroExpander::match_matcher): Add option to match delimiters.
* expand/rust-macro-expand.h
(MacroExpander::match_matcher): Likewise.
* parse/rust-parse-impl.h
(Parser::skip_token): Add zero argument method.
* parse/rust-parse.h:
(Parser::skip_token): Likewise.
gcc/testsuite/ChangeLog:
* rust/compile/macro-delim.rs: New test.
Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
Diffstat (limited to 'gcc/rust/parse/rust-parse.h')
-rw-r--r-- | gcc/rust/parse/rust-parse.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/rust/parse/rust-parse.h b/gcc/rust/parse/rust-parse.h index 1e7e526..315d3fc 100644 --- a/gcc/rust/parse/rust-parse.h +++ b/gcc/rust/parse/rust-parse.h @@ -95,6 +95,11 @@ template <typename ManagedTokenSource> class Parser { public: /** + * Consume a token + */ + void skip_token (); + + /** * Consume a token, reporting an error if it isn't the next token * * @param t ID of the token to consume |