Bugfix: make the parser handle the case where zero repetitions occur, by handling parse results on the basis of what names the matcher expects to bind, not on what names are actually bound.
This commit is contained in:
parent
1c472564e3
commit
f785cccf0f
5 changed files with 35 additions and 15 deletions
|
|
@ -378,8 +378,9 @@ type matcher = spanned<matcher_>;
|
|||
enum matcher_ {
|
||||
/* match one token */
|
||||
mtc_tok(token::token),
|
||||
/* match repetitions of a sequence: body, separator, zero ok? : */
|
||||
mtc_rep(~[matcher], option<token::token>, bool),
|
||||
/* match repetitions of a sequence: body, separator, zero ok?,
|
||||
lo, hi position-in-match-array used: */
|
||||
mtc_rep(~[matcher], option<token::token>, bool, uint, uint),
|
||||
/* parse a Rust NT: name to bind, name of NT, position in match array : */
|
||||
mtc_bb(ident, ident, uint)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue