Skip to content

Commit

Permalink
* lib/racc/parser.rb (do_parse, yyparse): using class eval to define
Browse files Browse the repository at this point in the history
  method and avoid __send__.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29789 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
tenderlove authored and hsbt committed May 10, 2019
1 parent 6e482d9 commit 4e43732
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/racc/parser.rb
Expand Up @@ -222,9 +222,11 @@ def _racc_init_sysvars
# def next_token
# @q.shift
# end
class_eval %{
def do_parse
__send__(Racc_Main_Parsing_Routine, _racc_setup(), false)
#{Racc_Main_Parsing_Routine}(_racc_setup(), false)
end
}

# The method to fetch next token.
# If you use #do_parse method, you must implement #next_token.
Expand Down Expand Up @@ -281,9 +283,11 @@ def _racc_do_parse_rb(arg, in_debug)
#
# RECEIVER#METHOD_ID is a method to get next token.
# It must 'yield' the token, which format is [TOKEN-SYMBOL, VALUE].
class_eval %{
def yyparse(recv, mid)
__send__(Racc_YY_Parse_Method, recv, mid, _racc_setup(), false)
#{Racc_YY_Parse_Method}(recv, mid, _racc_setup(), true)
end
}

def _racc_yyparse_rb(recv, mid, arg, c_debug)
action_table, action_check, action_default, action_pointer,
Expand Down

0 comments on commit 4e43732

Please sign in to comment.