Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop to support Ruby 2.4 #164

Merged
merged 3 commits into from
Jun 25, 2021
Merged
Show file tree
Hide file tree
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
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