parser.y in lrama-0.6.5 vs parser.y in lrama-0.6.6
- old
+ new
@@ -28,10 +28,11 @@
bison_declarations: /* empty */ { result = "" }
| bison_declarations bison_declaration
bison_declaration: grammar_declaration
| rule_declaration
+ | inline_declaration
| "%expect" INTEGER { @grammar.expect = val[1] }
| "%define" variable value
| "%param" params
| "%lex-param" params
{
@@ -232,9 +233,15 @@
token_declaration: id int_opt alias { result = val }
rule_declaration: "%rule" IDENTIFIER "(" rule_args ")" ":" rule_rhs_list
{
rule = Grammar::ParameterizingRule::Rule.new(val[1].s_value, val[3], val[6])
+ @grammar.add_parameterizing_rule(rule)
+ }
+
+ inline_declaration: "%rule" "%inline" id_colon ":" rule_rhs_list
+ {
+ rule = Grammar::ParameterizingRule::Rule.new(val[2].s_value, [], val[4], is_inline: true)
@grammar.add_parameterizing_rule(rule)
}
rule_args: IDENTIFIER { result = [val[0]] }
| rule_args "," IDENTIFIER { result = val[0].append(val[2]) }