diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2022-03-25 10:23:43 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-25 10:23:43 +0000 |
commit | a7e723469220b6765463d27b3e19ffd27f1baadd (patch) | |
tree | 2466ee1fda8728f68cada39716855edc35b66534 /gcc/rust/parse/rust-parse.h | |
parent | 89ad4f21f25a2501bb9bb96338be4a6edb89bbcd (diff) | |
parent | 7ea35487a215ccd9a34c46a5a17194c61dbfb9d9 (diff) | |
download | gcc-a7e723469220b6765463d27b3e19ffd27f1baadd.zip gcc-a7e723469220b6765463d27b3e19ffd27f1baadd.tar.gz gcc-a7e723469220b6765463d27b3e19ffd27f1baadd.tar.bz2 |
Merge #1055
1055: Allow keeping list of last matches to check against r=CohenArthur a=CohenArthur
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.
Addresses #947
Closes #947
Co-authored-by: Arthur Cohen <arthur.cohen@embecosm.com>
Diffstat (limited to 'gcc/rust/parse/rust-parse.h')
-rw-r--r-- | gcc/rust/parse/rust-parse.h | 4 |
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 ¤t_match); +is_match_compatible (const AST::MacroMatch &last_match, + const AST::MacroMatch ¤t_match); } // namespace Rust // as now template, include implementations of all methods |