Fix handling of token rules directly inside of alias, prec, or field.

Fixes #483
This commit is contained in:
Max Brunsfeld 2019-11-14 13:34:21 -08:00
parent b4a2f4ed60
commit 660efd8c0f
4 changed files with 72 additions and 1 deletions

View file

@ -366,7 +366,7 @@ impl FromIterator<Symbol> for TokenSet {
fn add_metadata<T: FnOnce(&mut MetadataParams)>(input: Rule, f: T) -> Rule {
match input {
Rule::Metadata { rule, mut params } => {
Rule::Metadata { rule, mut params } if !params.is_token => {
f(&mut params);
Rule::Metadata { rule, params }
}