1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[ruby/racc] Remove Object monkey patch

I don't think we need this monkey patch anymore, so lets remove it!

https://github.com/ruby/racc/commit/464485e912
This commit is contained in:
Aaron Patterson 2021-04-27 11:49:20 -07:00 committed by Hiroshi SHIBATA
parent 7641a83d1f
commit b036a44e57
No known key found for this signature in database
GPG key ID: F9CF13417264FAC2

View file

@ -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,
@ -300,9 +294,9 @@ module Racc
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)