diff --git a/spec/lrama/grammar/code_spec.rb b/spec/lrama/grammar/code_spec.rb index 4aae611d..90a86bc4 100644 --- a/spec/lrama/grammar/code_spec.rb +++ b/spec/lrama/grammar/code_spec.rb @@ -131,7 +131,7 @@ rule3: expr '+' expr[expr-right] { $1 + $[expr-right]; } ; -rule4: expr '+' expr[expr-right] { @1 + @[expr-right]; } +rule4: expr '+' expr[expr-right] { @1 + @[expr-right]; @0; } ; rule5: expr '+' expr { $1 + $3; } @@ -169,7 +169,7 @@ it "translats '@n' to '(yylsp)' with index" do code = grammar.rules.find {|r| r.lhs.id.s_value == "rule4" } - expect(code.translated_code).to eq(" (yylsp[-2]) + (yylsp[0]); ") + expect(code.translated_code).to eq(" (yylsp[-2]) + (yylsp[0]); (yylsp[-3]); ") end it "respects explicit tag in a rule" do