diff --git a/parse.y b/parse.y index 86c95f9c820276..ab301d6034acf4 100644 --- a/parse.y +++ b/parse.y @@ -1431,6 +1431,7 @@ static NODE *method_add_block(struct parser_params*p, NODE *m, NODE *b, const YY static bool args_info_empty_p(struct rb_args_info *args); static rb_node_args_t *new_args(struct parser_params*,rb_node_args_aux_t*,rb_node_opt_arg_t*,ID,rb_node_args_aux_t*,rb_node_args_t*,const YYLTYPE*); static rb_node_args_t *new_args_tail(struct parser_params*,rb_node_kw_arg_t*,ID,ID,const YYLTYPE*); +#define new_empty_args_tail(p, loc) new_args_tail(p, 0, 0, 0, loc) static NODE *new_array_pattern(struct parser_params *p, NODE *constant, NODE *pre_arg, NODE *aryptn, const YYLTYPE *loc); static NODE *new_array_pattern_tail(struct parser_params *p, NODE *pre_args, int has_rest, NODE *rest_arg, NODE *post_args, const YYLTYPE *loc); static NODE *new_find_pattern(struct parser_params *p, NODE *constant, NODE *fndptn, const YYLTYPE *loc); @@ -2772,13 +2773,13 @@ rb_parser_ary_free(rb_parser_t *p, rb_parser_ary_t *ary) %type if_tail opt_else case_body case_args cases opt_rescue exc_list exc_var opt_ensure %type args arg_splat call_args opt_call_args %type paren_args opt_paren_args -%type args_tail block_args_tail +%type args_tail block_args_tail f_args-opt_tail block_args-opt_tail %type command_args aref_args %type opt_block_arg block_arg %type var_ref var_lhs %type command_rhs arg_rhs %type command_asgn mrhs mrhs_arg superclass block_call block_command -%type f_arglist f_opt_paren_args f_paren_args f_args +%type f_arglist f_opt_paren_args f_paren_args f_args f_empty_arg %type f_arg f_arg_item %type f_marg f_rest_marg %type f_margs @@ -3094,7 +3095,7 @@ rb_parser_ary_free(rb_parser_t *p, rb_parser_ary_t *ary) } | /* none */ { - $$ = new_args_tail(p, 0, 0, 0, &@$); + $$ = new_empty_args_tail(p, &@$); /*% ripper: [Qnil, Qnil, Qnil] %*/ } ; @@ -4577,7 +4578,7 @@ primary : inline_primary m->nd_next = node_assign(p, (NODE *)NEW_MASGN(NEW_LIST($for_var, &@for_var), 0, &@for_var), internal_var, NO_LEX_CTXT, &@for_var); } /* {|*internal_id| = internal_id; ... } */ - args = new_args(p, m, 0, id, 0, new_args_tail(p, 0, 0, 0, &@for_var), &@for_var); + args = new_args(p, m, 0, id, 0, new_empty_args_tail(p, &@for_var), &@for_var); scope = NEW_SCOPE2(tbl, args, $compstmt, NULL, &@$); YYLTYPE do_keyword_loc = $do == keyword_do_cond ? @do : NULL_LOC; $$ = NEW_FOR($expr_value, scope, &@$, &@k_for, &@keyword_in, &do_keyword_loc, &@k_end); @@ -4975,6 +4976,9 @@ f_eq : {p->ctxt.in_argdef = 0;} '='; block_args_tail : args_tail_basic(primary_value) ; +block_args-opt_tail : opt_args_tail(block_args_tail) + ; + excessed_comma : ',' { /* magic number for rest_id in iseq_set_arguments() */ @@ -4983,76 +4987,19 @@ excessed_comma : ',' } ; -block_param : f_arg[pre] ',' f_opt_arg(primary_value)[opt] ',' f_rest_arg[rest] opt_args_tail(block_args_tail)[tail] - { - $$ = new_args(p, $pre, $opt, $rest, 0, $tail, &@$); - /*% ripper: params!($:pre, $:opt, $:rest, Qnil, *$:tail[0..2]) %*/ - } - | f_arg[pre] ',' f_opt_arg(primary_value)[opt] ',' f_rest_arg[rest] ',' f_arg[post] opt_args_tail(block_args_tail)[tail] - { - $$ = new_args(p, $pre, $opt, $rest, $post, $tail, &@$); - /*% ripper: params!($:pre, $:opt, $:rest, $:post, *$:tail[0..2]) %*/ - } - | f_arg[pre] ',' f_opt_arg(primary_value)[opt] opt_args_tail(block_args_tail)[tail] +block_param : args-list(primary_value, block_args-opt_tail) + | f_arg[pre] excessed_comma { - $$ = new_args(p, $pre, $opt, 0, 0, $tail, &@$); - /*% ripper: params!($:pre, $:opt, Qnil, Qnil, *$:tail[0..2]) %*/ - } - | f_arg[pre] ',' f_opt_arg(primary_value)[opt] ',' f_arg[post] opt_args_tail(block_args_tail)[tail] - { - $$ = new_args(p, $pre, $opt, 0, $post, $tail, &@$); - /*% ripper: params!($:pre, $:opt, Qnil, $:post, *$:tail[0..2]) %*/ - } - | f_arg[pre] ',' f_rest_arg[rest] opt_args_tail(block_args_tail)[tail] - { - $$ = new_args(p, $pre, 0, $rest, 0, $tail, &@$); - /*% ripper: params!($:pre, Qnil, $:rest, Qnil, *$:tail[0..2]) %*/ - } - | f_arg[pre] ',' f_rest_arg[rest] ',' f_arg[post] opt_args_tail(block_args_tail)[tail] - { - $$ = new_args(p, $pre, 0, $rest, $post, $tail, &@$); - /*% ripper: params!($:pre, Qnil, $:rest, $:post, *$:tail[0..2]) %*/ + $$ = new_empty_args_tail(p, &@excessed_comma); + $$ = new_args(p, $pre, 0, $excessed_comma, 0, $$, &@$); + /*% ripper: params!($:pre, Qnil, $:excessed_comma, Qnil, Qnil, Qnil, Qnil) %*/ } | f_arg[pre] opt_args_tail(block_args_tail)[tail] { $$ = new_args(p, $pre, 0, 0, 0, $tail, &@$); /*% ripper: params!($:pre, Qnil, Qnil, Qnil, *$:tail[0..2]) %*/ } - | f_opt_arg(primary_value)[opt] ',' f_rest_arg[rest] opt_args_tail(block_args_tail)[tail] - { - $$ = new_args(p, 0, $opt, $rest, 0, $tail, &@$); - /*% ripper: params!(Qnil, $:opt, $:rest, Qnil, *$:tail[0..2]) %*/ - } - | f_opt_arg(primary_value)[opt] ',' f_rest_arg[rest] ',' f_arg[post] opt_args_tail(block_args_tail)[tail] - { - $$ = new_args(p, 0, $opt, $rest, $post, $tail, &@$); - /*% ripper: params!(Qnil, $:opt, $:rest, $:post, *$:tail[0..2]) %*/ - } - | f_opt_arg(primary_value)[opt] opt_args_tail(block_args_tail)[tail] - { - $$ = new_args(p, 0, $opt, 0, 0, $tail, &@$); - /*% ripper: params!(Qnil, $:opt, Qnil, Qnil, *$:tail[0..2]) %*/ - } - | f_opt_arg(primary_value)[opt] ',' f_arg[post] opt_args_tail(block_args_tail)[tail] - { - $$ = new_args(p, 0, $opt, 0, $post, $tail, &@$); - /*% ripper: params!(Qnil, $:opt, Qnil, $:post, *$:tail[0..2]) %*/ - } - | f_rest_arg[rest] opt_args_tail(block_args_tail)[tail] - { - $$ = new_args(p, 0, 0, $rest, 0, $tail, &@$); - /*% ripper: params!(Qnil, Qnil, $:rest, Qnil, *$:tail[0..2]) %*/ - } - | f_rest_arg[rest] ',' f_arg[post] opt_args_tail(block_args_tail)[tail] - { - $$ = new_args(p, 0, 0, $rest, $post, $tail, &@$); - /*% ripper: params!(Qnil, Qnil, $:rest, $:post, *$:tail[0..2]) %*/ - } - | block_args_tail[tail] - { - $$ = new_args(p, 0, 0, 0, 0, $tail, &@$); - /*% ripper: params!(Qnil, Qnil, Qnil, Qnil, *$:tail[0..2]) %*/ - } + | tail-only-args(block_args_tail) ; opt_block_param_def : none @@ -5069,15 +5016,6 @@ block_param_def : '|' opt_block_param opt_bv_decl '|' $$ = $2; /*% ripper: block_var!($:2, $:3) %*/ } - | '|' f_arg excessed_comma opt_bv_decl '|' - { - p->max_numparam = ORDINAL_PARAM; - p->ctxt.in_argdef = 0; - $$ = new_args_tail(p, 0, 0, 0, &@3); - $$ = new_args(p, $2, 0, $3, 0, $$, &@$); - /*% ripper: params!($:2, Qnil, $:3, Qnil, Qnil, Qnil, Qnil) %*/ - /*% ripper: block_var!($:$, $:4) %*/ - } ; opt_block_param : /* none */ @@ -6260,10 +6198,15 @@ superclass : '<' ; f_opt_paren_args: f_paren_args - | /* none */ + | f_empty_arg { p->ctxt.in_argdef = 0; - $$ = new_args_tail(p, 0, 0, 0, &@$); + } + ; + +f_empty_arg : /* none */ + { + $$ = new_empty_args_tail(p, &@$); $$ = new_args(p, 0, 0, 0, 0, $$, &@$); /*% ripper: params!(Qnil, Qnil, Qnil, Qnil, Qnil, Qnil, Qnil) %*/ } @@ -6315,84 +6258,91 @@ args_tail : args_tail_basic(arg_value) } ; -f_args : f_arg[pre] ',' f_opt_arg(arg_value)[opt] ',' f_rest_arg[rest] opt_args_tail(args_tail)[tail] +%rule args-list(value, tail) + : f_arg[pre] ',' f_opt_arg(value)[opt] ',' f_rest_arg[rest] tail { $$ = new_args(p, $pre, $opt, $rest, 0, $tail, &@$); /*% ripper: params!($:pre, $:opt, $:rest, Qnil, *$:tail[0..2]) %*/ } - | f_arg[pre] ',' f_opt_arg(arg_value)[opt] ',' f_rest_arg[rest] ',' f_arg[post] opt_args_tail(args_tail)[tail] + | f_arg[pre] ',' f_opt_arg(value)[opt] ',' f_rest_arg[rest] ',' f_arg[post] tail { $$ = new_args(p, $pre, $opt, $rest, $post, $tail, &@$); /*% ripper: params!($:pre, $:opt, $:rest, $:post, *$:tail[0..2]) %*/ } - | f_arg[pre] ',' f_opt_arg(arg_value)[opt] opt_args_tail(args_tail)[tail] + | f_arg[pre] ',' f_opt_arg(value)[opt] tail { $$ = new_args(p, $pre, $opt, 0, 0, $tail, &@$); /*% ripper: params!($:pre, $:opt, Qnil, Qnil, *$:tail[0..2]) %*/ } - | f_arg[pre] ',' f_opt_arg(arg_value)[opt] ',' f_arg[post] opt_args_tail(args_tail)[tail] + | f_arg[pre] ',' f_opt_arg(value)[opt] ',' f_arg[post] tail { $$ = new_args(p, $pre, $opt, 0, $post, $tail, &@$); /*% ripper: params!($:pre, $:opt, Qnil, $:post, *$:tail[0..2]) %*/ } - | f_arg[pre] ',' f_rest_arg[rest] opt_args_tail(args_tail)[tail] + | f_arg[pre] ',' f_rest_arg[rest] tail { $$ = new_args(p, $pre, 0, $rest, 0, $tail, &@$); /*% ripper: params!($:pre, Qnil, $:rest, Qnil, *$:tail[0..2]) %*/ } - | f_arg[pre] ',' f_rest_arg[rest] ',' f_arg[post] opt_args_tail(args_tail)[tail] + | f_arg[pre] ',' f_rest_arg[rest] ',' f_arg[post] tail { $$ = new_args(p, $pre, 0, $rest, $post, $tail, &@$); /*% ripper: params!($:pre, Qnil, $:rest, $:post, *$:tail[0..2]) %*/ } - | f_arg[pre] opt_args_tail(args_tail)[tail] - { - $$ = new_args(p, $pre, 0, 0, 0, $tail, &@$); - /*% ripper: params!($:pre, Qnil, Qnil, Qnil, *$:tail[0..2]) %*/ - } - | f_opt_arg(arg_value)[opt] ',' f_rest_arg[rest] opt_args_tail(args_tail)[tail] + | f_opt_arg(value)[opt] ',' f_rest_arg[rest] tail { $$ = new_args(p, 0, $opt, $rest, 0, $tail, &@$); /*% ripper: params!(Qnil, $:opt, $:rest, Qnil, *$:tail[0..2]) %*/ } - | f_opt_arg(arg_value)[opt] ',' f_rest_arg[rest] ',' f_arg[post] opt_args_tail(args_tail)[tail] + | f_opt_arg(value)[opt] ',' f_rest_arg[rest] ',' f_arg[post] tail { $$ = new_args(p, 0, $opt, $rest, $post, $tail, &@$); /*% ripper: params!(Qnil, $:opt, $:rest, $:post, *$:tail[0..2]) %*/ } - | f_opt_arg(arg_value)[opt] opt_args_tail(args_tail)[tail] + | f_opt_arg(value)[opt] tail { $$ = new_args(p, 0, $opt, 0, 0, $tail, &@$); /*% ripper: params!(Qnil, $:opt, Qnil, Qnil, *$:tail[0..2]) %*/ } - | f_opt_arg(arg_value)[opt] ',' f_arg[post] opt_args_tail(args_tail)[tail] + | f_opt_arg(value)[opt] ',' f_arg[post] tail { $$ = new_args(p, 0, $opt, 0, $post, $tail, &@$); /*% ripper: params!(Qnil, $:opt, Qnil, $:post, *$:tail[0..2]) %*/ } - | f_rest_arg[rest] opt_args_tail(args_tail)[tail] + | f_rest_arg[rest] tail { $$ = new_args(p, 0, 0, $rest, 0, $tail, &@$); /*% ripper: params!(Qnil, Qnil, $:rest, Qnil, *$:tail[0..2]) %*/ } - | f_rest_arg[rest] ',' f_arg[post] opt_args_tail(args_tail)[tail] + | f_rest_arg[rest] ',' f_arg[post] tail { $$ = new_args(p, 0, 0, $rest, $post, $tail, &@$); /*% ripper: params!(Qnil, Qnil, $:rest, $:post, *$:tail[0..2]) %*/ } - | args_tail[tail] + ; + +%rule tail-only-args(tail) + : tail { $$ = new_args(p, 0, 0, 0, 0, $tail, &@$); /*% ripper: params!(Qnil, Qnil, Qnil, Qnil, *$:tail[0..2]) %*/ } - | /* none */ + ; + +f_args-opt_tail : opt_args_tail(args_tail) + ; + +f_args : args-list(arg_value, f_args-opt_tail) + | f_arg[pre] f_args-opt_tail[tail] { - $$ = new_args_tail(p, 0, 0, 0, &@$); - $$ = new_args(p, 0, 0, 0, 0, $$, &@$); - /*% ripper: params!(Qnil, Qnil, Qnil, Qnil, Qnil, Qnil, Qnil) %*/ + $$ = new_args(p, $pre, 0, 0, 0, $tail, &@$); + /*% ripper: params!($:pre, Qnil, Qnil, Qnil, *$:tail[0..2]) %*/ } + | tail-only-args(args_tail) + | f_empty_arg ; + args_forward : tBDOT3 { $$ = idFWD_KWREST; @@ -14542,7 +14492,7 @@ args_with_numbered(struct parser_params *p, rb_node_args_t *args, int max_numpar if (max_numparam > NO_PARAM || it_id) { if (!args) { YYLTYPE loc = RUBY_INIT_YYLLOC(); - args = new_args_tail(p, 0, 0, 0, 0); + args = new_empty_args_tail(p, 0); nd_set_loc(RNODE(args), &loc); } args->nd_ainfo.pre_args_num = it_id ? 1 : max_numparam; diff --git a/tool/lrama/NEWS.md b/tool/lrama/NEWS.md index f71118a9130f3e..5a82880506beb9 100644 --- a/tool/lrama/NEWS.md +++ b/tool/lrama/NEWS.md @@ -1,5 +1,7 @@ # NEWS for Lrama +## Lrama 0.8.0 (2026-xx-xx) + ## Lrama 0.7.1 (2025-12-24) ### Optimize IELR diff --git a/tool/lrama/lib/lrama/grammar/binding.rb b/tool/lrama/lib/lrama/grammar/binding.rb index 5940d153a9fa6c..94d00a410e13f6 100644 --- a/tool/lrama/lib/lrama/grammar/binding.rb +++ b/tool/lrama/lib/lrama/grammar/binding.rb @@ -30,6 +30,7 @@ def concatenated_args_str(token) def create_instantiate_rule(sym) Lrama::Lexer::Token::InstantiateRule.new( s_value: sym.s_value, + alias_name: sym.alias_name, location: sym.location, args: resolve_args(sym.args), lhs_tag: sym.lhs_tag diff --git a/tool/lrama/lib/lrama/grammar/code/rule_action.rb b/tool/lrama/lib/lrama/grammar/code/rule_action.rb index e71e93e5a5bb8d..24729a1ee07be1 100644 --- a/tool/lrama/lib/lrama/grammar/code/rule_action.rb +++ b/tool/lrama/lib/lrama/grammar/code/rule_action.rb @@ -11,11 +11,13 @@ class RuleAction < Code # # @rbs! # @rule: Rule + # @grammar: Grammar - # @rbs (type: ::Symbol, token_code: Lexer::Token::UserCode, rule: Rule) -> void - def initialize(type:, token_code:, rule:) + # @rbs (type: ::Symbol, token_code: Lexer::Token::UserCode, rule: Rule, grammar: Grammar) -> void + def initialize(type:, token_code:, rule:, grammar:) super(type: type, token_code: token_code) @rule = rule + @grammar = grammar end private @@ -53,9 +55,15 @@ def reference_to_c(ref) case when ref.type == :dollar && ref.name == "$" # $$ tag = ref.ex_tag || lhs.tag - raise_tag_not_found_error(ref) unless tag - # @type var tag: Lexer::Token::Tag - "(yyval.#{tag.member})" + if tag + # @type var tag: Lexer::Token::Tag + "(yyval.#{tag.member})" + elsif union_not_defined? + # When %union is not defined, YYSTYPE defaults to int + "(yyval)" + else + raise_tag_not_found_error(ref) + end when ref.type == :at && ref.name == "$" # @$ "(yyloc)" when ref.type == :index && ref.name == "$" # $:$ @@ -63,9 +71,15 @@ def reference_to_c(ref) when ref.type == :dollar # $n i = -position_in_rhs + ref.index tag = ref.ex_tag || rhs[ref.index - 1].tag - raise_tag_not_found_error(ref) unless tag - # @type var tag: Lexer::Token::Tag - "(yyvsp[#{i}].#{tag.member})" + if tag + # @type var tag: Lexer::Token::Tag + "(yyvsp[#{i}].#{tag.member})" + elsif union_not_defined? + # When %union is not defined, YYSTYPE defaults to int + "(yyvsp[#{i}])" + else + raise_tag_not_found_error(ref) + end when ref.type == :at # @n i = -position_in_rhs + ref.index "(yylsp[#{i}])" @@ -99,6 +113,11 @@ def lhs @rule.lhs end + # @rbs () -> bool + def union_not_defined? + @grammar.union.nil? + end + # @rbs (Reference ref) -> bot def raise_tag_not_found_error(ref) raise "Tag is not specified for '$#{ref.value}' in '#{@rule.display_name}'" diff --git a/tool/lrama/lib/lrama/grammar/rule.rb b/tool/lrama/lib/lrama/grammar/rule.rb index d00d6a88830ae9..b023b0e4546165 100644 --- a/tool/lrama/lib/lrama/grammar/rule.rb +++ b/tool/lrama/lib/lrama/grammar/rule.rb @@ -104,11 +104,11 @@ def initial_rule? id == 0 end - # @rbs () -> String? - def translated_code + # @rbs (Grammar grammar) -> String? + def translated_code(grammar) return nil unless token_code - Code::RuleAction.new(type: :rule_action, token_code: token_code, rule: self).translated_code + Code::RuleAction.new(type: :rule_action, token_code: token_code, rule: self, grammar: grammar).translated_code end # @rbs () -> bool diff --git a/tool/lrama/lib/lrama/output.rb b/tool/lrama/lib/lrama/output.rb index d527be8bd40f89..24cf725c774820 100644 --- a/tool/lrama/lib/lrama/output.rb +++ b/tool/lrama/lib/lrama/output.rb @@ -246,7 +246,7 @@ def user_actions <<-STR case #{rule.id + 1}: /* #{rule.as_comment} */ #line #{code.line} "#{@grammar_file_path}" -#{spaces}{#{rule.translated_code}} +#{spaces}{#{rule.translated_code(@grammar)}} #line [@oline@] [@ofile@] break; diff --git a/tool/lrama/lib/lrama/parser.rb b/tool/lrama/lib/lrama/parser.rb index 20c3ad347f0491..66111de8ab2340 100644 --- a/tool/lrama/lib/lrama/parser.rb +++ b/tool/lrama/lib/lrama/parser.rb @@ -767,14 +767,14 @@ def raise_parse_error(error_message, location) 105, 53, 53, 52, 52, 110, 110, 53, 53, 52, 209, 110, 110, 53, 53, 209, 52, 110, 110, 53, 53, 209, 52, 110, 193, 194, 195, 137, 216, 222, - 229, 217, 217, 217, 53, 53, 52, 52, 193, 194, + 230, 217, 217, 217, 53, 53, 52, 52, 193, 194, 195, 57, 57, 57, 57, 66, 67, 68, 69, 70, 72, 72, 72, 86, 89, 47, 57, 57, 113, 117, 117, 79, 123, 124, 131, 47, 133, 137, 139, 143, 149, 150, 151, 152, 133, 155, 156, 157, 110, 166, 149, 169, 172, 173, 72, 175, 176, 183, 189, 166, 196, 137, 200, 202, 137, 166, 211, 166, 137, 72, - 176, 218, 176, 72, 72, 227, 137, 72 ] + 176, 218, 176, 72, 137, 227, 137, 72, 72 ] racc_action_check = [ 51, 97, 51, 97, 41, 75, 165, 75, 165, 75, @@ -806,7 +806,7 @@ def raise_parse_error(error_message, location) 124, 125, 126, 127, 133, 136, 137, 138, 144, 150, 151, 153, 156, 158, 162, 163, 164, 170, 174, 176, 178, 179, 182, 184, 187, 189, 199, 200, 204, 205, - 207, 209, 212, 214, 216, 221, 222, 228 ] + 207, 209, 212, 214, 216, 221, 222, 224, 228 ] racc_action_pointer = [ 32, 23, 52, 93, nil, 31, 63, nil, 123, 68, @@ -830,16 +830,16 @@ def raise_parse_error(error_message, location) 189, nil, 236, nil, 239, nil, 162, 229, 194, 235, 10, nil, nil, nil, nil, nil, 195, nil, nil, 284, 237, 15, 200, nil, 233, 281, nil, 241, 173, 247, - 176, nil, 243, 174, 285, nil, 286, 201, 206, nil, - nil, 278, 241, nil, nil, nil, 175, nil, 289, nil, - nil ] + 176, nil, 243, 174, 285, nil, 239, 201, 206, nil, + nil, 278, 241, nil, 289, nil, 175, nil, 290, nil, + nil, nil ] racc_action_default = [ -1, -136, -1, -3, -10, -136, -136, -2, -3, -136, -14, -14, -136, -136, -136, -136, -136, -136, -136, -28, -29, -34, -35, -36, -136, -136, -136, -136, -136, -136, -136, -136, -136, -54, -54, -54, -136, -136, -136, -136, - -136, -136, -136, -13, 231, -4, -136, -14, -16, -17, + -136, -136, -136, -13, 232, -4, -136, -14, -16, -17, -20, -131, -100, -101, -130, -18, -23, -89, -24, -25, -136, -27, -37, -136, -136, -136, -41, -42, -43, -44, -45, -46, -55, -136, -47, -136, -48, -49, -92, -136, @@ -856,9 +856,9 @@ def raise_parse_error(error_message, location) -136, -124, -136, -109, -100, -110, -72, -72, -136, -70, -69, -75, -76, -116, -117, -118, -136, -78, -79, -136, -70, -108, -136, -111, -72, -54, -115, -63, -136, -100, - -119, -125, -65, -136, -54, -114, -54, -136, -136, -120, - -121, -136, -72, -112, -77, -122, -136, -126, -54, -123, - -113 ] + -119, -125, -65, -136, -54, -114, -72, -136, -136, -120, + -121, -136, -72, -112, -54, -122, -136, -126, -54, -77, + -123, -113 ] racc_goto_table = [ 73, 118, 136, 54, 48, 49, 164, 96, 91, 120, @@ -873,14 +873,14 @@ def raise_parse_error(error_message, location) 170, 177, 220, 199, 203, 205, 221, 186, 153, nil, nil, nil, nil, 116, 116, nil, 198, nil, nil, nil, nil, nil, 214, 78, 206, nil, 177, nil, nil, nil, - nil, nil, 210, nil, nil, nil, nil, 186, 210, 174, + nil, nil, 210, nil, 224, nil, nil, 186, 210, 174, 228, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 225, 210, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 215, nil, nil, nil, nil, nil, nil, nil, - nil, 223, nil, 224, nil, nil, nil, nil, nil, nil, - nil, nil, nil, nil, nil, 230 ] + nil, 223, nil, nil, nil, nil, nil, nil, nil, nil, + nil, 229, nil, nil, nil, 231 ] racc_goto_check = [ 29, 22, 42, 31, 14, 14, 35, 16, 8, 48, @@ -895,14 +895,14 @@ def raise_parse_error(error_message, location) 53, 22, 55, 56, 42, 42, 57, 22, 58, nil, nil, nil, nil, 31, 31, nil, 22, nil, nil, nil, nil, nil, 42, 31, 22, nil, 22, nil, nil, nil, - nil, nil, 22, nil, nil, nil, nil, 22, 22, 29, + nil, nil, 22, nil, 42, nil, nil, 22, 22, 29, 42, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 22, 22, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 29, nil, nil, nil, nil, nil, nil, nil, - nil, 29, nil, 29, nil, nil, nil, nil, nil, nil, - nil, nil, nil, nil, nil, 29 ] + nil, 29, nil, nil, nil, nil, nil, nil, nil, nil, + nil, 29, nil, nil, nil, 29 ] racc_goto_pointer = [ nil, 38, nil, nil, nil, -52, 23, 68, -38, -29, @@ -998,7 +998,7 @@ def raise_parse_error(error_message, location) 1, 94, :_reduce_74, 3, 94, :_reduce_75, 3, 94, :_reduce_76, - 6, 94, :_reduce_77, + 7, 94, :_reduce_77, 3, 94, :_reduce_78, 3, 94, :_reduce_79, 0, 102, :_reduce_none, @@ -1060,7 +1060,7 @@ def raise_parse_error(error_message, location) racc_reduce_n = 136 -racc_shift_n = 231 +racc_shift_n = 232 racc_token_table = { false => 0, @@ -1828,7 +1828,7 @@ def _reduce_76(val, _values, result) def _reduce_77(val, _values, result) on_action_error("intermediate %prec in a rule", val[1]) if @trailing_prec_seen 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]) + builder.symbols << Lrama::Lexer::Token::InstantiateRule.new(s_value: val[1].s_value, alias_name: val[5], location: @lexer.location, args: val[3], lhs_tag: val[6]) result = builder result