Skip to content

Commit

Permalink
* Bump maintenance branches to 3.0.1, 2.7.3, 2.6.7, and 2.5.9
Browse files Browse the repository at this point in the history
These Rubies has been released.

- https://www.ruby-lang.org/ja/news/2021/04/05/ruby-3-0-1-released/
- https://www.ruby-lang.org/en/news/2021/04/05/ruby-2-7-3-released/
- https://www.ruby-lang.org/en/news/2021/04/05/ruby-2-6-7-released/
- https://www.ruby-lang.org/en/news/2021/04/05/ruby-2-5-9-released/

## Ruby 3.0 branch

Bump 3.0 branch from 3.0.0 to 3.0.1
ruby/ruby@v3_0_0...v3_0_1

There seems to be no change to the syntax.

## Ruby 2.7 branch

Bump 2.7 branch from 2.7.2 to 2.7.3
ruby/ruby@v2_7_2...v2_7_3

There is the leading arguments support to arguments forwarding change to the syntax.
Thas PR is backport whitequark#712 to Ruby 2.7 branch.

cf. ruby/ruby@27fca66

## Ruby 2.6 branch

Bump 2.6 branch from 2.6.6 to 2.6.7
ruby/ruby@v2_6_6...v2_6_7

There seems to be no change to the syntax.

## Ruby 2.5 branch

Bump 2.5 branch from 2.5.8 to 2.5.9
ruby/ruby@v2_5_8...v2_5_9

There seems to be no change to the syntax.
  • Loading branch information
koic committed Apr 6, 2021
1 parent de619a2 commit 67de7a1
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Expand Up @@ -17,14 +17,14 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: ["2.4.10", "2.5.8", "2.6.6", "2.7.2", "3.0.0", "jruby-9.2"]
ruby: ["2.4.10", "2.5.9", "2.6.7", "2.7.3", "3.0.1", "jruby-9.2"]
test_command: ["bundle exec rake test"]
include:
- ruby: "head"
test_command: "bundle exec rake test || true"
- ruby: "truffleruby"
test_command: "bundle exec rake test || true"
- ruby: "3.0.0"
- ruby: "3.0.1"
test_command: "./ci/run_rubocop_specs || true"
steps:
- uses: actions/checkout@v2
Expand Down
8 changes: 4 additions & 4 deletions lib/parser/current.rb
Expand Up @@ -57,7 +57,7 @@ def warn_syntax_deviation(feature, version)
CurrentRuby = Ruby24

when /^2\.5\./
current_version = '2.5.8'
current_version = '2.5.9'
if RUBY_VERSION != current_version
warn_syntax_deviation 'parser/ruby25', current_version
end
Expand All @@ -66,7 +66,7 @@ def warn_syntax_deviation(feature, version)
CurrentRuby = Ruby25

when /^2\.6\./
current_version = '2.6.6'
current_version = '2.6.7'
if RUBY_VERSION != current_version
warn_syntax_deviation 'parser/ruby26', current_version
end
Expand All @@ -75,7 +75,7 @@ def warn_syntax_deviation(feature, version)
CurrentRuby = Ruby26

when /^2\.7\./
current_version = '2.7.2'
current_version = '2.7.3'
if RUBY_VERSION != current_version
warn_syntax_deviation 'parser/ruby27', current_version
end
Expand All @@ -84,7 +84,7 @@ def warn_syntax_deviation(feature, version)
CurrentRuby = Ruby27

when /^3\.0\./
current_version = '3.0.0'
current_version = '3.0.1'
if RUBY_VERSION != current_version
warn_syntax_deviation 'parser/ruby30', current_version
end
Expand Down
14 changes: 14 additions & 0 deletions lib/parser/ruby27.y
Expand Up @@ -872,6 +872,14 @@ rule
{
result = val
}
| tLPAREN2 args tCOMMA args_forward rparen
{
unless @static_env.declared_forward_args?
diagnostic :error, :unexpected_token, { :token => 'tBDOT3' } , val[3]
end

result = [val[0], [*val[1], @builder.forwarded_args(val[3])], val[4]]
}
| tLPAREN2 args_forward rparen
{
unless @static_env.declared_forward_args?
Expand Down Expand Up @@ -2546,6 +2554,12 @@ keyword_variable: kNIL
@lexer.state = :expr_value
}
| tLPAREN2 f_arg tCOMMA args_forward rparen
{
args = [ *val[1], @builder.forward_arg(val[3]) ]
result = @builder.args(val[0], args, val[4])
@static_env.declare_forward_args
}
| tLPAREN2 args_forward rparen
{
result = @builder.forward_only_args(val[0], val[1], val[2])
Expand Down
4 changes: 2 additions & 2 deletions test/test_parser.rb
Expand Up @@ -7992,7 +7992,7 @@ def test_forward_args_invalid
[:error, :unexpected_token, { :token => 'tBDOT3' }],
%q{def foo(x,y,z); bar(x, y, z, ...); end},
%q{ ^^^ location},
SINCE_3_0)
SINCE_2_7)

assert_diagnoses(
[:error, :unexpected_token, { :token => 'tBDOT3' }],
Expand Down Expand Up @@ -8085,7 +8085,7 @@ def test_trailing_forward_arg
| ~~~~~~~~~~~ expression (args)
| ~ end (args)
| ~~~ expression (args.forward_arg)},
SINCE_3_0)
SINCE_2_7)
end


Expand Down

0 comments on commit 67de7a1

Please sign in to comment.