diff --git a/lib/lrama/new_parser.rb b/lib/lrama/new_parser.rb index ad0f5ee6..cc8f2f6f 100644 --- a/lib/lrama/new_parser.rb +++ b/lib/lrama/new_parser.rb @@ -185,7 +185,7 @@ def build_token(type:, s_value:, line:, column:, alias_name: nil) 3, 48, :_reduce_none, 2, 48, :_reduce_none, 2, 48, :_reduce_none, - 2, 48, :_reduce_none, + 2, 48, :_reduce_15, 2, 48, :_reduce_16, 0, 53, :_reduce_17, 0, 54, :_reduce_18, @@ -501,7 +501,12 @@ def _reduce_8(val, _values, result) # reduce 14 omitted -# reduce 15 omitted +module_eval(<<'.,.,', 'parser.y', 18) + def _reduce_15(val, _values, result) + val[1].each {|token| token.references = []; @grammar.lex_param = @grammar.build_code(:lex_param, token).token_code.s_value} + result + end +.,., module_eval(<<'.,.,', 'parser.y', 19) def _reduce_16(val, _values, result) diff --git a/parser.y b/parser.y index 22d0d3c4..eebff800 100644 --- a/parser.y +++ b/parser.y @@ -16,7 +16,7 @@ rule | "%define" variable value | "%require" STRING | "%param" params - | "%lex-param" params + | "%lex-param" params { val[1].each {|token| token.references = []; @grammar.lex_param = @grammar.build_code(:lex_param, token).token_code.s_value} } | "%parse-param" params { val[1].each {|token| token.references = []; @grammar.parse_param = @grammar.build_code(:parse_param, token).token_code.s_value} } | "%initial-action" "{" {@lexer.status = :c_declaration; @lexer.end_symbol = '}'} C_DECLARATION {@lexer.status = :initial; @lexer.end_symbol = nil} "}" | ";"