Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions lib/racc/statetransitiontable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@

require 'racc/parser'

unless Object.method_defined?(:funcall)
class Object
alias funcall __send__
end
end

module Racc

StateTransitionTable = Struct.new(:action_table,
Expand Down Expand Up @@ -300,9 +294,9 @@ def define_actions(c)
c.module_eval "def _reduce_none(vals, vstack) vals[0] end"
@grammar.each do |rule|
if rule.action.empty?
c.funcall(:alias_method, "_reduce_#{rule.ident}", :_reduce_none)
c.alias_method("_reduce_#{rule.ident}", :_reduce_none)
else
c.funcall(:define_method, "_racc_action_#{rule.ident}", &rule.action.proc)
c.define_method("_racc_action_#{rule.ident}", &rule.action.proc)
c.module_eval(<<-End, __FILE__, __LINE__ + 1)
def _reduce_#{rule.ident}(vals, vstack)
_racc_action_#{rule.ident}(*vals)
Expand Down