Skip to content

Commit

Permalink
Merge pull request #164 from ruby/drop-ruby-2-4
Browse files Browse the repository at this point in the history
Drop to support Ruby 2.4
  • Loading branch information
hsbt authored Jun 25, 2021
2 parents b81645f + 464485e commit aa95f31
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ruby: [ '3.0', 2.7, 2.6, 2.5, 2.4, head, jruby-9.2.17.0, jruby-head ]
ruby: [ '3.0', 2.7, 2.6, 2.5, head, jruby-9.2.17.0, jruby-head ]
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
Expand Down
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
2 changes: 1 addition & 1 deletion racc.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ DESC
"doc/en/Overview-of-racc.md"
]
s.require_paths = ["lib"]
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.required_ruby_version = ">= 2.5"
s.rdoc_options = ["--main", "README.rdoc"]
s.extra_rdoc_files = [
"README.ja.rdoc", "README.rdoc",
Expand Down

0 comments on commit aa95f31

Please sign in to comment.