fix(cli): show rule names for rules with metadata
This commit is contained in:
parent
107bd800b0
commit
1152bf4c9d
1 changed files with 6 additions and 1 deletions
|
|
@ -213,7 +213,12 @@ pub(super) fn extract_tokens(
|
|||
{
|
||||
reserved_words.push(Symbol::terminal(index));
|
||||
} else {
|
||||
let token_name = match &reserved_rule {
|
||||
let rule = if let Rule::Metadata { rule, .. } = &reserved_rule {
|
||||
rule.as_ref()
|
||||
} else {
|
||||
&reserved_rule
|
||||
};
|
||||
let token_name = match rule {
|
||||
Rule::String(s) => s.clone(),
|
||||
Rule::Pattern(p, _) => p.clone(),
|
||||
_ => "unknown".to_string(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue