parser 2.3.0.7 → 2.3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/CHANGELOG.md +12 -1
- data/Rakefile +1 -0
- data/lib/parser/all.rb +1 -0
- data/lib/parser/builders/default.rb +3 -1
- data/lib/parser/current.rb +4 -4
- data/lib/parser/lexer.rl +3 -3
- data/lib/parser/ruby24.y +2346 -0
- data/lib/parser/runner.rb +2 -2
- data/lib/parser/version.rb +1 -1
- data/parser.gemspec +1 -0
- data/test/helper.rb +1 -1
- data/test/parse_helper.rb +1 -0
- data/test/test_current.rb +1 -1
- data/test/test_parser.rb +32 -7
- metadata +4 -2
data/lib/parser/runner.rb
CHANGED
data/lib/parser/version.rb
CHANGED
data/parser.gemspec
CHANGED
data/test/helper.rb
CHANGED
|
@@ -8,7 +8,7 @@ if ENV.include?('COVERAGE') && SimpleCov.usable?
|
|
|
8
8
|
if defined?(TracePoint)
|
|
9
9
|
require_relative 'racc_coverage_helper'
|
|
10
10
|
|
|
11
|
-
RaccCoverage.start(%w(ruby18.y ruby19.y ruby20.y ruby21.y ruby22.y ruby23.y),
|
|
11
|
+
RaccCoverage.start(%w(ruby18.y ruby19.y ruby20.y ruby21.y ruby22.y ruby23.y ruby24.y),
|
|
12
12
|
File.expand_path('../../lib/parser', __FILE__))
|
|
13
13
|
|
|
14
14
|
# Report results faster.
|
data/test/parse_helper.rb
CHANGED
|
@@ -27,6 +27,7 @@ module ParseHelper
|
|
|
27
27
|
when '2.1' then parser = Parser::Ruby21.new
|
|
28
28
|
when '2.2' then parser = Parser::Ruby22.new
|
|
29
29
|
when '2.3' then parser = Parser::Ruby23.new
|
|
30
|
+
when '2.4' then parser = Parser::Ruby24.new
|
|
30
31
|
when 'mac' then parser = Parser::MacRuby.new
|
|
31
32
|
when 'ios' then parser = Parser::RubyMotion.new
|
|
32
33
|
else raise "Unrecognized Ruby version #{version}"
|
data/test/test_current.rb
CHANGED
|
@@ -17,7 +17,7 @@ class TestCurrent < Minitest::Test
|
|
|
17
17
|
when /^2\.3\.\d+/
|
|
18
18
|
assert_equal Parser::Ruby23, Parser::CurrentRuby
|
|
19
19
|
when /^2\.4\.\d+/
|
|
20
|
-
assert_equal Parser::
|
|
20
|
+
assert_equal Parser::Ruby24, Parser::CurrentRuby
|
|
21
21
|
else
|
|
22
22
|
flunk "Update test_current for #{RUBY_VERSION}"
|
|
23
23
|
end
|
data/test/test_parser.rb
CHANGED
|
@@ -4182,21 +4182,32 @@ class TestParser < Minitest::Test
|
|
|
4182
4182
|
assert_diagnoses(
|
|
4183
4183
|
[:error, :masgn_as_condition],
|
|
4184
4184
|
%q{if (a, b = foo); end},
|
|
4185
|
-
%q{ ~~~~~~~~~~ location}
|
|
4185
|
+
%q{ ~~~~~~~~~~ location},
|
|
4186
|
+
%w(1.8 1.9 2.0 2.1 2.2 2.3 ios mac))
|
|
4187
|
+
end
|
|
4188
|
+
|
|
4189
|
+
def test_if_masgn__24
|
|
4190
|
+
assert_diagnoses(
|
|
4191
|
+
[:error, :masgn_as_condition],
|
|
4192
|
+
%q{if (a, b = foo); end},
|
|
4193
|
+
%q{ ~~~~~~~~~~ location},
|
|
4194
|
+
ALL_VERSIONS - %w(1.8 1.9 2.0 2.1 2.2 2.3 ios mac))
|
|
4186
4195
|
end
|
|
4187
4196
|
|
|
4188
4197
|
def test_if_mod_masgn
|
|
4189
4198
|
assert_diagnoses(
|
|
4190
4199
|
[:error, :masgn_as_condition],
|
|
4191
4200
|
%q{1 if (a, b = foo)},
|
|
4192
|
-
%q{ ~~~~~~~~~~ location}
|
|
4201
|
+
%q{ ~~~~~~~~~~ location},
|
|
4202
|
+
%w(1.8 1.9 2.0 2.1 2.2 2.3 ios mac))
|
|
4193
4203
|
end
|
|
4194
4204
|
|
|
4195
4205
|
def test_tern_masgn
|
|
4196
4206
|
assert_diagnoses(
|
|
4197
4207
|
[:error, :masgn_as_condition],
|
|
4198
4208
|
%q{(a, b = foo) ? 1 : 2},
|
|
4199
|
-
%q{ ~~~~~~~~~~ location}
|
|
4209
|
+
%q{ ~~~~~~~~~~ location},
|
|
4210
|
+
%w(1.8 1.9 2.0 2.1 2.2 2.3 ios mac))
|
|
4200
4211
|
end
|
|
4201
4212
|
|
|
4202
4213
|
def test_cond_begin
|
|
@@ -4225,13 +4236,13 @@ class TestParser < Minitest::Test
|
|
|
4225
4236
|
[:error, :masgn_as_condition],
|
|
4226
4237
|
%q{if foo && (a, b = bar); end},
|
|
4227
4238
|
%q{ ~~~~~~~~~~ location},
|
|
4228
|
-
|
|
4239
|
+
%w(1.9 2.0 2.1 2.2 2.3 ios mac))
|
|
4229
4240
|
|
|
4230
4241
|
assert_diagnoses(
|
|
4231
4242
|
[:error, :masgn_as_condition],
|
|
4232
4243
|
%q{if foo || (a, b = bar); end},
|
|
4233
4244
|
%q{ ~~~~~~~~~~ location},
|
|
4234
|
-
|
|
4245
|
+
%w(1.9 2.0 2.1 2.2 2.3 ios mac))
|
|
4235
4246
|
|
|
4236
4247
|
assert_parses(
|
|
4237
4248
|
s(:if,
|
|
@@ -4454,14 +4465,16 @@ class TestParser < Minitest::Test
|
|
|
4454
4465
|
assert_diagnoses(
|
|
4455
4466
|
[:error, :masgn_as_condition],
|
|
4456
4467
|
%q{while (a, b = foo); end},
|
|
4457
|
-
%q{ ~~~~~~~~~~ location}
|
|
4468
|
+
%q{ ~~~~~~~~~~ location},
|
|
4469
|
+
%w(1.8 1.9 2.0 2.1 2.2 2.3 ios mac))
|
|
4458
4470
|
end
|
|
4459
4471
|
|
|
4460
4472
|
def test_while_mod_masgn
|
|
4461
4473
|
assert_diagnoses(
|
|
4462
4474
|
[:error, :masgn_as_condition],
|
|
4463
4475
|
%q{foo while (a, b = foo)},
|
|
4464
|
-
%q{ ~~~~~~~~~~ location}
|
|
4476
|
+
%q{ ~~~~~~~~~~ location},
|
|
4477
|
+
%w(1.8 1.9 2.0 2.1 2.2 2.3 ios mac))
|
|
4465
4478
|
end
|
|
4466
4479
|
|
|
4467
4480
|
def test_for
|
|
@@ -5403,6 +5416,18 @@ class TestParser < Minitest::Test
|
|
|
5403
5416
|
%q{a = 1; a b: 1},
|
|
5404
5417
|
%q{},
|
|
5405
5418
|
ALL_VERSIONS - %w(1.8))
|
|
5419
|
+
|
|
5420
|
+
assert_parses(
|
|
5421
|
+
s(:def, :foo,
|
|
5422
|
+
s(:args,
|
|
5423
|
+
s(:arg, :raise)),
|
|
5424
|
+
s(:send, nil, :raise,
|
|
5425
|
+
s(:const,
|
|
5426
|
+
s(:const, nil, :A), :B),
|
|
5427
|
+
s(:str, ""))),
|
|
5428
|
+
%q{def foo raise; raise A::B, ''; end},
|
|
5429
|
+
%q{},
|
|
5430
|
+
ALL_VERSIONS - %w(1.8))
|
|
5406
5431
|
end
|
|
5407
5432
|
|
|
5408
5433
|
def test_parser_bug_198
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: parser
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.3.0
|
|
4
|
+
version: 2.3.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- whitequark
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-
|
|
11
|
+
date: 2016-04-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: ast
|
|
@@ -281,6 +281,8 @@ files:
|
|
|
281
281
|
- lib/parser/ruby22.y
|
|
282
282
|
- lib/parser/ruby23.rb
|
|
283
283
|
- lib/parser/ruby23.y
|
|
284
|
+
- lib/parser/ruby24.rb
|
|
285
|
+
- lib/parser/ruby24.y
|
|
284
286
|
- lib/parser/rubymotion.rb
|
|
285
287
|
- lib/parser/rubymotion.y
|
|
286
288
|
- lib/parser/runner.rb
|