diff --git a/lib/lrama/parser.rb b/lib/lrama/parser.rb index e163f748..b7171454 100644 --- a/lib/lrama/parser.rb +++ b/lib/lrama/parser.rb @@ -654,7 +654,7 @@ def token_to_str(t) module Lrama class Parser < Racc::Parser -module_eval(<<'...end parser.y/module_eval...', 'parser.y', 541) +module_eval(<<'...end parser.y/module_eval...', 'parser.y', 542) include Lrama::Report::Duration @@ -1261,7 +1261,7 @@ def raise_parse_error(error_message, location) # reduce 3 omitted -module_eval(<<'.,.,', 'parser.y', 14) +module_eval(<<'.,.,', 'parser.y', 15) def _reduce_4(val, _values, result) begin_c_declaration("%}") @grammar.prologue_first_lineno = @lexer.line @@ -1270,7 +1270,7 @@ def _reduce_4(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 19) +module_eval(<<'.,.,', 'parser.y', 20) def _reduce_5(val, _values, result) end_c_declaration @@ -1278,7 +1278,7 @@ def _reduce_5(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 23) +module_eval(<<'.,.,', 'parser.y', 24) def _reduce_6(val, _values, result) @grammar.prologue = val[2].s_value @@ -1288,7 +1288,7 @@ def _reduce_6(val, _values, result) # reduce 7 omitted -module_eval(<<'.,.,', 'parser.y', 27) +module_eval(<<'.,.,', 'parser.y', 28) def _reduce_8(val, _values, result) result = "" result @@ -1303,7 +1303,7 @@ def _reduce_8(val, _values, result) # reduce 12 omitted -module_eval(<<'.,.,', 'parser.y', 33) +module_eval(<<'.,.,', 'parser.y', 34) def _reduce_13(val, _values, result) @grammar.expect = val[1] result @@ -1314,7 +1314,7 @@ def _reduce_13(val, _values, result) # reduce 15 omitted -module_eval(<<'.,.,', 'parser.y', 38) +module_eval(<<'.,.,', 'parser.y', 39) def _reduce_16(val, _values, result) val[1].each {|token| @grammar.lex_param = Grammar::Code::NoReferenceCode.new(type: :lex_param, token_code: token).token_code.s_value @@ -1324,7 +1324,7 @@ def _reduce_16(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 44) +module_eval(<<'.,.,', 'parser.y', 45) def _reduce_17(val, _values, result) val[1].each {|token| @grammar.parse_param = Grammar::Code::NoReferenceCode.new(type: :parse_param, token_code: token).token_code.s_value @@ -1334,7 +1334,7 @@ def _reduce_17(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 50) +module_eval(<<'.,.,', 'parser.y', 51) def _reduce_18(val, _values, result) begin_c_declaration("}") @@ -1342,7 +1342,7 @@ def _reduce_18(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 54) +module_eval(<<'.,.,', 'parser.y', 55) def _reduce_19(val, _values, result) end_c_declaration @@ -1350,7 +1350,7 @@ def _reduce_19(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 58) +module_eval(<<'.,.,', 'parser.y', 59) def _reduce_20(val, _values, result) @grammar.add_percent_code(id: val[1], code: val[4]) @@ -1358,7 +1358,7 @@ def _reduce_20(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 62) +module_eval(<<'.,.,', 'parser.y', 63) def _reduce_21(val, _values, result) begin_c_declaration("}") @@ -1366,7 +1366,7 @@ def _reduce_21(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 66) +module_eval(<<'.,.,', 'parser.y', 67) def _reduce_22(val, _values, result) end_c_declaration @@ -1374,7 +1374,7 @@ def _reduce_22(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 70) +module_eval(<<'.,.,', 'parser.y', 71) def _reduce_23(val, _values, result) @grammar.initial_action = Grammar::Code::InitialActionCode.new(type: :initial_action, token_code: val[3]) @@ -1382,7 +1382,7 @@ def _reduce_23(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 72) +module_eval(<<'.,.,', 'parser.y', 73) def _reduce_24(val, _values, result) @grammar.no_stdlib = true result @@ -1391,7 +1391,7 @@ def _reduce_24(val, _values, result) # reduce 25 omitted -module_eval(<<'.,.,', 'parser.y', 77) +module_eval(<<'.,.,', 'parser.y', 78) def _reduce_26(val, _values, result) begin_c_declaration("}") @@ -1399,7 +1399,7 @@ def _reduce_26(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 81) +module_eval(<<'.,.,', 'parser.y', 82) def _reduce_27(val, _values, result) end_c_declaration @@ -1407,7 +1407,7 @@ def _reduce_27(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 85) +module_eval(<<'.,.,', 'parser.y', 86) def _reduce_28(val, _values, result) @grammar.set_union( Grammar::Code::NoReferenceCode.new(type: :union, token_code: val[3]), @@ -1420,7 +1420,7 @@ def _reduce_28(val, _values, result) # reduce 29 omitted -module_eval(<<'.,.,', 'parser.y', 93) +module_eval(<<'.,.,', 'parser.y', 94) def _reduce_30(val, _values, result) begin_c_declaration("}") @@ -1428,7 +1428,7 @@ def _reduce_30(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 97) +module_eval(<<'.,.,', 'parser.y', 98) def _reduce_31(val, _values, result) end_c_declaration @@ -1436,7 +1436,7 @@ def _reduce_31(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 101) +module_eval(<<'.,.,', 'parser.y', 102) def _reduce_32(val, _values, result) @grammar.add_destructor( ident_or_tags: val[6], @@ -1448,7 +1448,7 @@ def _reduce_32(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 109) +module_eval(<<'.,.,', 'parser.y', 110) def _reduce_33(val, _values, result) begin_c_declaration("}") @@ -1456,7 +1456,7 @@ def _reduce_33(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 113) +module_eval(<<'.,.,', 'parser.y', 114) def _reduce_34(val, _values, result) end_c_declaration @@ -1464,7 +1464,7 @@ def _reduce_34(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 117) +module_eval(<<'.,.,', 'parser.y', 118) def _reduce_35(val, _values, result) @grammar.add_printer( ident_or_tags: val[6], @@ -1476,7 +1476,7 @@ def _reduce_35(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 125) +module_eval(<<'.,.,', 'parser.y', 126) def _reduce_36(val, _values, result) begin_c_declaration("}") @@ -1484,7 +1484,7 @@ def _reduce_36(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 129) +module_eval(<<'.,.,', 'parser.y', 130) def _reduce_37(val, _values, result) end_c_declaration @@ -1492,7 +1492,7 @@ def _reduce_37(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 133) +module_eval(<<'.,.,', 'parser.y', 134) def _reduce_38(val, _values, result) @grammar.add_error_token( ident_or_tags: val[6], @@ -1504,7 +1504,7 @@ def _reduce_38(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 141) +module_eval(<<'.,.,', 'parser.y', 142) def _reduce_39(val, _values, result) @grammar.after_shift = val[1] @@ -1512,7 +1512,7 @@ def _reduce_39(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 145) +module_eval(<<'.,.,', 'parser.y', 146) def _reduce_40(val, _values, result) @grammar.before_reduce = val[1] @@ -1520,7 +1520,7 @@ def _reduce_40(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 149) +module_eval(<<'.,.,', 'parser.y', 150) def _reduce_41(val, _values, result) @grammar.after_reduce = val[1] @@ -1528,7 +1528,7 @@ def _reduce_41(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 153) +module_eval(<<'.,.,', 'parser.y', 154) def _reduce_42(val, _values, result) @grammar.after_shift_error_token = val[1] @@ -1536,7 +1536,7 @@ def _reduce_42(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 157) +module_eval(<<'.,.,', 'parser.y', 158) def _reduce_43(val, _values, result) @grammar.after_pop_stack = val[1] @@ -1546,7 +1546,7 @@ def _reduce_43(val, _values, result) # reduce 44 omitted -module_eval(<<'.,.,', 'parser.y', 163) +module_eval(<<'.,.,', 'parser.y', 164) def _reduce_45(val, _values, result) val[1].each {|hash| hash[:tokens].each {|id| @@ -1558,7 +1558,7 @@ def _reduce_45(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 171) +module_eval(<<'.,.,', 'parser.y', 172) def _reduce_46(val, _values, result) val[1].each {|hash| hash[:tokens].each {|id| @@ -1572,7 +1572,7 @@ def _reduce_46(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 181) +module_eval(<<'.,.,', 'parser.y', 182) def _reduce_47(val, _values, result) val[1].each {|hash| hash[:tokens].each {|id| @@ -1586,7 +1586,7 @@ def _reduce_47(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 191) +module_eval(<<'.,.,', 'parser.y', 192) def _reduce_48(val, _values, result) val[1].each {|hash| hash[:tokens].each {|id| @@ -1600,7 +1600,7 @@ def _reduce_48(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 201) +module_eval(<<'.,.,', 'parser.y', 202) def _reduce_49(val, _values, result) val[1].each {|hash| hash[:tokens].each {|id| @@ -1614,7 +1614,7 @@ def _reduce_49(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 212) +module_eval(<<'.,.,', 'parser.y', 213) def _reduce_50(val, _values, result) val[0].each {|token_declaration| @grammar.add_term(id: token_declaration[0], alias_name: token_declaration[2], token_id: token_declaration[1], tag: nil, replace: true) @@ -1624,7 +1624,7 @@ def _reduce_50(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 218) +module_eval(<<'.,.,', 'parser.y', 219) def _reduce_51(val, _values, result) val[1].each {|token_declaration| @grammar.add_term(id: token_declaration[0], alias_name: token_declaration[2], token_id: token_declaration[1], tag: val[0], replace: true) @@ -1634,7 +1634,7 @@ def _reduce_51(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 224) +module_eval(<<'.,.,', 'parser.y', 225) def _reduce_52(val, _values, result) val[2].each {|token_declaration| @grammar.add_term(id: token_declaration[0], alias_name: token_declaration[2], token_id: token_declaration[1], tag: val[1], replace: true) @@ -1644,28 +1644,28 @@ def _reduce_52(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 229) +module_eval(<<'.,.,', 'parser.y', 230) def _reduce_53(val, _values, result) result = [val[0]] result end .,., -module_eval(<<'.,.,', 'parser.y', 230) +module_eval(<<'.,.,', 'parser.y', 231) def _reduce_54(val, _values, result) result = val[0].append(val[1]) result end .,., -module_eval(<<'.,.,', 'parser.y', 232) +module_eval(<<'.,.,', 'parser.y', 233) def _reduce_55(val, _values, result) result = val result end .,., -module_eval(<<'.,.,', 'parser.y', 236) +module_eval(<<'.,.,', 'parser.y', 237) def _reduce_56(val, _values, result) rule = Grammar::ParameterizingRule::Rule.new(val[1].s_value, val[3], val[7], tag: val[5]) @grammar.add_parameterizing_rule(rule) @@ -1674,7 +1674,7 @@ def _reduce_56(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 242) +module_eval(<<'.,.,', 'parser.y', 243) def _reduce_57(val, _values, result) rule = Grammar::ParameterizingRule::Rule.new(val[2].s_value, [], val[4], is_inline: true) @grammar.add_parameterizing_rule(rule) @@ -1683,7 +1683,7 @@ def _reduce_57(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 247) +module_eval(<<'.,.,', 'parser.y', 248) def _reduce_58(val, _values, result) rule = Grammar::ParameterizingRule::Rule.new(val[2].s_value, val[4], val[7], is_inline: true) @grammar.add_parameterizing_rule(rule) @@ -1692,21 +1692,21 @@ def _reduce_58(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 251) +module_eval(<<'.,.,', 'parser.y', 252) def _reduce_59(val, _values, result) result = [val[0]] result end .,., -module_eval(<<'.,.,', 'parser.y', 252) +module_eval(<<'.,.,', 'parser.y', 253) def _reduce_60(val, _values, result) result = val[0].append(val[2]) result end .,., -module_eval(<<'.,.,', 'parser.y', 256) +module_eval(<<'.,.,', 'parser.y', 257) def _reduce_61(val, _values, result) builder = val[0] result = [builder] @@ -1715,7 +1715,7 @@ def _reduce_61(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 261) +module_eval(<<'.,.,', 'parser.y', 262) def _reduce_62(val, _values, result) builder = val[2] result = val[0].append(builder) @@ -1724,7 +1724,7 @@ def _reduce_62(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 267) +module_eval(<<'.,.,', 'parser.y', 268) def _reduce_63(val, _values, result) reset_precs result = Grammar::ParameterizingRule::Rhs.new @@ -1733,7 +1733,7 @@ def _reduce_63(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 272) +module_eval(<<'.,.,', 'parser.y', 273) def _reduce_64(val, _values, result) reset_precs result = Grammar::ParameterizingRule::Rhs.new @@ -1742,7 +1742,7 @@ def _reduce_64(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 277) +module_eval(<<'.,.,', 'parser.y', 278) def _reduce_65(val, _values, result) token = val[1] token.alias_name = val[2] @@ -1754,7 +1754,7 @@ def _reduce_65(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 285) +module_eval(<<'.,.,', 'parser.y', 286) def _reduce_66(val, _values, result) builder = val[0] builder.symbols << Lrama::Lexer::Token::InstantiateRule.new(s_value: val[2], location: @lexer.location, args: [val[1]]) @@ -1764,7 +1764,7 @@ def _reduce_66(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 291) +module_eval(<<'.,.,', 'parser.y', 292) def _reduce_67(val, _values, result) builder = val[0] builder.symbols << Lrama::Lexer::Token::InstantiateRule.new(s_value: val[1].s_value, location: @lexer.location, args: val[3], lhs_tag: val[5]) @@ -1774,7 +1774,7 @@ def _reduce_67(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 297) +module_eval(<<'.,.,', 'parser.y', 298) def _reduce_68(val, _values, result) if @prec_seen on_action_error("multiple User_code after %prec", val[0]) if @code_after_prec @@ -1786,7 +1786,7 @@ def _reduce_68(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 305) +module_eval(<<'.,.,', 'parser.y', 306) def _reduce_69(val, _values, result) end_c_declaration @@ -1794,7 +1794,7 @@ def _reduce_69(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 309) +module_eval(<<'.,.,', 'parser.y', 310) def _reduce_70(val, _values, result) user_code = val[3] user_code.alias_name = val[6] @@ -1806,7 +1806,7 @@ def _reduce_70(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 317) +module_eval(<<'.,.,', 'parser.y', 318) def _reduce_71(val, _values, result) sym = @grammar.find_symbol_by_id!(val[2]) @prec_seen = true @@ -1826,7 +1826,7 @@ def _reduce_71(val, _values, result) # reduce 75 omitted -module_eval(<<'.,.,', 'parser.y', 332) +module_eval(<<'.,.,', 'parser.y', 333) def _reduce_76(val, _values, result) result = [{tag: nil, tokens: val[0]}] @@ -1834,7 +1834,7 @@ def _reduce_76(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 336) +module_eval(<<'.,.,', 'parser.y', 337) def _reduce_77(val, _values, result) result = [{tag: val[0], tokens: val[1]}] @@ -1842,7 +1842,7 @@ def _reduce_77(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 340) +module_eval(<<'.,.,', 'parser.y', 341) def _reduce_78(val, _values, result) result = val[0].append({tag: val[1], tokens: val[2]}) @@ -1850,14 +1850,14 @@ def _reduce_78(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 343) +module_eval(<<'.,.,', 'parser.y', 344) def _reduce_79(val, _values, result) result = [val[0]] result end .,., -module_eval(<<'.,.,', 'parser.y', 344) +module_eval(<<'.,.,', 'parser.y', 345) def _reduce_80(val, _values, result) result = val[0].append(val[1]) result @@ -1868,7 +1868,7 @@ def _reduce_80(val, _values, result) # reduce 82 omitted -module_eval(<<'.,.,', 'parser.y', 351) +module_eval(<<'.,.,', 'parser.y', 352) def _reduce_83(val, _values, result) begin_c_declaration("}") @@ -1876,7 +1876,7 @@ def _reduce_83(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 355) +module_eval(<<'.,.,', 'parser.y', 356) def _reduce_84(val, _values, result) end_c_declaration @@ -1884,7 +1884,7 @@ def _reduce_84(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 359) +module_eval(<<'.,.,', 'parser.y', 360) def _reduce_85(val, _values, result) result = val[0].append(val[3]) @@ -1892,7 +1892,7 @@ def _reduce_85(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 363) +module_eval(<<'.,.,', 'parser.y', 364) def _reduce_86(val, _values, result) begin_c_declaration("}") @@ -1900,7 +1900,7 @@ def _reduce_86(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 367) +module_eval(<<'.,.,', 'parser.y', 368) def _reduce_87(val, _values, result) end_c_declaration @@ -1908,7 +1908,7 @@ def _reduce_87(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 371) +module_eval(<<'.,.,', 'parser.y', 372) def _reduce_88(val, _values, result) result = [val[2]] @@ -1916,7 +1916,7 @@ def _reduce_88(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 376) +module_eval(<<'.,.,', 'parser.y', 377) def _reduce_89(val, _values, result) result = [{tag: nil, tokens: val[0]}] @@ -1924,7 +1924,7 @@ def _reduce_89(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 380) +module_eval(<<'.,.,', 'parser.y', 381) def _reduce_90(val, _values, result) result = [{tag: val[0], tokens: val[1]}] @@ -1932,7 +1932,7 @@ def _reduce_90(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 384) +module_eval(<<'.,.,', 'parser.y', 385) def _reduce_91(val, _values, result) result = val[0].append({tag: val[1], tokens: val[2]}) @@ -1940,14 +1940,14 @@ def _reduce_91(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 387) +module_eval(<<'.,.,', 'parser.y', 388) def _reduce_92(val, _values, result) result = [val[0]] result end .,., -module_eval(<<'.,.,', 'parser.y', 388) +module_eval(<<'.,.,', 'parser.y', 389) def _reduce_93(val, _values, result) result = val[0].append(val[1]) result @@ -1956,14 +1956,14 @@ def _reduce_93(val, _values, result) # reduce 94 omitted -module_eval(<<'.,.,', 'parser.y', 392) +module_eval(<<'.,.,', 'parser.y', 393) def _reduce_95(val, _values, result) on_action_error("ident after %prec", val[0]) if @prec_seen result end .,., -module_eval(<<'.,.,', 'parser.y', 393) +module_eval(<<'.,.,', 'parser.y', 394) def _reduce_96(val, _values, result) on_action_error("char after %prec", val[0]) if @prec_seen result @@ -1978,7 +1978,7 @@ def _reduce_96(val, _values, result) # reduce 100 omitted -module_eval(<<'.,.,', 'parser.y', 403) +module_eval(<<'.,.,', 'parser.y', 404) def _reduce_101(val, _values, result) lhs = val[0] lhs.alias_name = val[1] @@ -1992,7 +1992,7 @@ def _reduce_101(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 414) +module_eval(<<'.,.,', 'parser.y', 415) def _reduce_102(val, _values, result) builder = val[0] if !builder.line @@ -2004,7 +2004,7 @@ def _reduce_102(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 422) +module_eval(<<'.,.,', 'parser.y', 423) def _reduce_103(val, _values, result) builder = val[2] if !builder.line @@ -2018,7 +2018,7 @@ def _reduce_103(val, _values, result) # reduce 104 omitted -module_eval(<<'.,.,', 'parser.y', 432) +module_eval(<<'.,.,', 'parser.y', 433) def _reduce_105(val, _values, result) reset_precs result = @grammar.create_rule_builder(@rule_counter, @midrule_action_counter) @@ -2027,7 +2027,7 @@ def _reduce_105(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 437) +module_eval(<<'.,.,', 'parser.y', 438) def _reduce_106(val, _values, result) reset_precs result = @grammar.create_rule_builder(@rule_counter, @midrule_action_counter) @@ -2036,7 +2036,7 @@ def _reduce_106(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 442) +module_eval(<<'.,.,', 'parser.y', 443) def _reduce_107(val, _values, result) token = val[1] token.alias_name = val[2] @@ -2048,7 +2048,7 @@ def _reduce_107(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 450) +module_eval(<<'.,.,', 'parser.y', 451) def _reduce_108(val, _values, result) token = Lrama::Lexer::Token::InstantiateRule.new(s_value: val[2], location: @lexer.location, args: [val[1]], lhs_tag: val[3]) builder = val[0] @@ -2060,7 +2060,7 @@ def _reduce_108(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 458) +module_eval(<<'.,.,', 'parser.y', 459) def _reduce_109(val, _values, result) token = Lrama::Lexer::Token::InstantiateRule.new(s_value: val[1].s_value, location: @lexer.location, args: val[3], lhs_tag: val[5]) builder = val[0] @@ -2072,7 +2072,7 @@ def _reduce_109(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 466) +module_eval(<<'.,.,', 'parser.y', 467) def _reduce_110(val, _values, result) if @prec_seen on_action_error("multiple User_code after %prec", val[0]) if @code_after_prec @@ -2084,7 +2084,7 @@ def _reduce_110(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 474) +module_eval(<<'.,.,', 'parser.y', 475) def _reduce_111(val, _values, result) end_c_declaration @@ -2092,7 +2092,7 @@ def _reduce_111(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 478) +module_eval(<<'.,.,', 'parser.y', 479) def _reduce_112(val, _values, result) user_code = val[3] user_code.alias_name = val[6] @@ -2105,7 +2105,7 @@ def _reduce_112(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 487) +module_eval(<<'.,.,', 'parser.y', 488) def _reduce_113(val, _values, result) sym = @grammar.find_symbol_by_id!(val[2]) @prec_seen = true @@ -2117,49 +2117,49 @@ def _reduce_113(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 494) +module_eval(<<'.,.,', 'parser.y', 495) def _reduce_114(val, _values, result) result = "option" result end .,., -module_eval(<<'.,.,', 'parser.y', 495) +module_eval(<<'.,.,', 'parser.y', 496) def _reduce_115(val, _values, result) result = "nonempty_list" result end .,., -module_eval(<<'.,.,', 'parser.y', 496) +module_eval(<<'.,.,', 'parser.y', 497) def _reduce_116(val, _values, result) result = "list" result end .,., -module_eval(<<'.,.,', 'parser.y', 498) +module_eval(<<'.,.,', 'parser.y', 499) def _reduce_117(val, _values, result) result = [val[0]] result end .,., -module_eval(<<'.,.,', 'parser.y', 499) +module_eval(<<'.,.,', 'parser.y', 500) def _reduce_118(val, _values, result) result = val[0].append(val[2]) result end .,., -module_eval(<<'.,.,', 'parser.y', 500) +module_eval(<<'.,.,', 'parser.y', 501) def _reduce_119(val, _values, result) result = [Lrama::Lexer::Token::InstantiateRule.new(s_value: val[1].s_value, location: @lexer.location, args: val[0])] result end .,., -module_eval(<<'.,.,', 'parser.y', 501) +module_eval(<<'.,.,', 'parser.y', 502) def _reduce_120(val, _values, result) result = [Lrama::Lexer::Token::InstantiateRule.new(s_value: val[0].s_value, location: @lexer.location, args: val[2])] result @@ -2168,7 +2168,7 @@ def _reduce_120(val, _values, result) # reduce 121 omitted -module_eval(<<'.,.,', 'parser.y', 504) +module_eval(<<'.,.,', 'parser.y', 505) def _reduce_122(val, _values, result) result = val[1].s_value result @@ -2179,7 +2179,7 @@ def _reduce_122(val, _values, result) # reduce 124 omitted -module_eval(<<'.,.,', 'parser.y', 511) +module_eval(<<'.,.,', 'parser.y', 512) def _reduce_125(val, _values, result) begin_c_declaration('\Z') @grammar.epilogue_first_lineno = @lexer.line + 1 @@ -2188,7 +2188,7 @@ def _reduce_125(val, _values, result) end .,., -module_eval(<<'.,.,', 'parser.y', 516) +module_eval(<<'.,.,', 'parser.y', 517) def _reduce_126(val, _values, result) end_c_declaration @grammar.epilogue = val[2].s_value @@ -2207,14 +2207,14 @@ def _reduce_126(val, _values, result) # reduce 131 omitted -module_eval(<<'.,.,', 'parser.y', 527) +module_eval(<<'.,.,', 'parser.y', 528) def _reduce_132(val, _values, result) result = [val[0]] result end .,., -module_eval(<<'.,.,', 'parser.y', 528) +module_eval(<<'.,.,', 'parser.y', 529) def _reduce_133(val, _values, result) result = val[0].append(val[1]) result @@ -2225,7 +2225,7 @@ def _reduce_133(val, _values, result) # reduce 135 omitted -module_eval(<<'.,.,', 'parser.y', 533) +module_eval(<<'.,.,', 'parser.y', 534) def _reduce_136(val, _values, result) result = Lrama::Lexer::Token::Ident.new(s_value: val[0]) result diff --git a/parser.y b/parser.y index 893a7add..fc9d8f24 100644 --- a/parser.y +++ b/parser.y @@ -1,5 +1,6 @@ class Lrama::Parser expect 0 + error_on_expect_mismatch token C_DECLARATION CHARACTER IDENT_COLON IDENTIFIER INTEGER STRING TAG