aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/parse/rust-parse.h
diff options
context:
space:
mode:
authorArthur Cohen <arthur.cohen@embecosm.com>2022-03-23 16:43:01 +0100
committerArthur Cohen <arthur.cohen@embecosm.com>2022-03-25 10:28:42 +0100
commit7ea35487a215ccd9a34c46a5a17194c61dbfb9d9 (patch)
tree2466ee1fda8728f68cada39716855edc35b66534 /gcc/rust/parse/rust-parse.h
parent89ad4f21f25a2501bb9bb96338be4a6edb89bbcd (diff)
downloadgcc-7ea35487a215ccd9a34c46a5a17194c61dbfb9d9.zip
gcc-7ea35487a215ccd9a34c46a5a17194c61dbfb9d9.tar.gz
gcc-7ea35487a215ccd9a34c46a5a17194c61dbfb9d9.tar.bz2
macros: Allow checking past zeroable matches for follow-set restrictions
When trying to figure out if a match can follow another, we must figure out whether or not that match is in the follow-set of the other. If that match is zeroable (i.e a repetition using the * or ? kleene operators), then we must be able to check the match after them: should our current match not be present, the match after must be part of the follow-set. This commits allows us to performs such checks properly and to "look past" zeroable matches. This is not done with any lookahead, simply by keeping a list of pointers to possible previous matches and checking all of them for ambiguities.
Diffstat (limited to 'gcc/rust/parse/rust-parse.h')
-rw-r--r--gcc/rust/parse/rust-parse.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/rust/parse/rust-parse.h b/gcc/rust/parse/rust-parse.h
index 88bd311..5653293 100644
--- a/gcc/rust/parse/rust-parse.h
+++ b/gcc/rust/parse/rust-parse.h
@@ -714,8 +714,8 @@ extract_module_path (const AST::AttrVec &inner_attrs,
* @return true if the follow-up is valid, false otherwise
*/
bool
-is_match_compatible (AST::MacroMatch &last_match,
- AST::MacroMatch &current_match);
+is_match_compatible (const AST::MacroMatch &last_match,
+ const AST::MacroMatch &current_match);
} // namespace Rust
// as now template, include implementations of all methods