KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Relevant chunk of Irony grammar: var VARIABLE = new RegexBasedTerminal("variable", @"(?-i)\$?\w+"); variable.Rule = VARIABLE; tag_blk.Rule = html_tag_kw + attr_args_opt + block; term_simple.Rule = NUMBER | STRING | variable | boolean | "null" | term_list; term.Rule = term_simple | term_filter; block.Rule = statement_list | statement | ";"; statement.Rule = tag_blk | directive_blk | term; The problem is that both a "tag" and a "variable" can appear in the same place. I want my parser to prefer the tag over the variable, but it always prefers the variable. How can I change that? I've tried changing tag_blk.Rule to PreferShiftHere() + html_tag_kw + attr_args_opt + block; and ImplyPrecedenceHere(-100) + html_tag_kw + attr_args_opt + block; but it doesn't help any. The parser doesn't even complain of an ambiguity.
Tags (comma-separated)
Save Edits
Cancel