parser 2.3.1.0 → 2.3.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/CHANGELOG.md +10 -1
- data/Rakefile +1 -0
- data/lib/parser/builders/default.rb +1 -1
- data/lib/parser/lexer/literal.rb +2 -2
- data/lib/parser/macruby.y +1 -0
- data/lib/parser/ruby19.y +1 -0
- data/lib/parser/ruby20.y +1 -0
- data/lib/parser/ruby21.y +1 -0
- data/lib/parser/ruby22.y +1 -0
- data/lib/parser/ruby23.y +1 -0
- data/lib/parser/ruby24.y +1 -0
- data/lib/parser/rubymotion.y +1 -0
- data/lib/parser/runner.rb +6 -1
- data/lib/parser/version.rb +1 -1
- data/test/test_parser.rb +20 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 87c2540f2a9f9c12e30397074ff44b6dc26326d8
|
4
|
+
data.tar.gz: 2d7dcc34d13dea8bd26ad5d2c3255da9458b694b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e8bbcc8a395ab2329190d5ed71baf2a9a24f1fcd548c1470a638fb9ed3364b44d1689699a29eaf5283420650e25cb94753f7b9c8dc7846e9a7e4c144ff443df
|
7
|
+
data.tar.gz: b224cee755968eeb44a1220afb6d1ed29559273c1178ae0783225542acd2bde2fc06d99e1cc3a65a01c055bbe34d251197e608564ba5b02805ac8a43783a9263
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,15 @@
|
|
1
1
|
Changelog
|
2
2
|
=========
|
3
3
|
|
4
|
+
v2.3.1.1 (2016-06-01)
|
5
|
+
---------------------
|
6
|
+
|
7
|
+
Bugs fixed:
|
8
|
+
* ruby{^18}.y: "lambda{|;a|a}": treat shadowarg as local inside block. (Ilya Bylich)
|
9
|
+
* Builders::Default: "foo&.bar{}": emit csend in block properly. (whitequark)
|
10
|
+
* runner.rb: re-add --23 (cremno)
|
11
|
+
* runner.rb: make --24 actually use the 2.4 parser (cremno)
|
12
|
+
|
4
13
|
v2.3.1.0 (2016-04-27)
|
5
14
|
---------------------
|
6
15
|
|
@@ -54,7 +63,7 @@ Bugs fixed:
|
|
54
63
|
* Add :csend to Parser::Meta::NODE_TYPES (Markus Schirp)
|
55
64
|
* lexer/dedenter: "\<\<x\n y\\n z\nx": don't dedent after escaped newline. (whitequark)
|
56
65
|
|
57
|
-
v2.3.1.
|
66
|
+
v2.3.1.1 (2016-01-16)
|
58
67
|
---------------------
|
59
68
|
|
60
69
|
v2.3.0.1 (2016-01-14)
|
data/Rakefile
CHANGED
@@ -749,7 +749,7 @@ module Parser
|
|
749
749
|
diagnostic :error, :block_and_blockarg, nil, last_arg.loc.expression, [loc(begin_t)]
|
750
750
|
end
|
751
751
|
|
752
|
-
if [:send, :super, :zsuper, :lambda].include?(method_call.type)
|
752
|
+
if [:send, :csend, :super, :zsuper, :lambda].include?(method_call.type)
|
753
753
|
n(:block, [ method_call, args, body ],
|
754
754
|
block_map(method_call.loc.expression, begin_t, end_t))
|
755
755
|
else
|
data/lib/parser/lexer/literal.rb
CHANGED
@@ -78,7 +78,7 @@ module Parser
|
|
78
78
|
!heredoc?)
|
79
79
|
|
80
80
|
# Capture opening delimiter in percent-literals.
|
81
|
-
@str_type
|
81
|
+
@str_type += delimiter if @str_type.start_with?('%'.freeze)
|
82
82
|
|
83
83
|
clear_buffer
|
84
84
|
|
@@ -187,7 +187,7 @@ module Parser
|
|
187
187
|
@buffer_s ||= ts
|
188
188
|
@buffer_e = te
|
189
189
|
|
190
|
-
@buffer
|
190
|
+
@buffer += string
|
191
191
|
end
|
192
192
|
|
193
193
|
def flush_string
|
data/lib/parser/macruby.y
CHANGED
data/lib/parser/ruby19.y
CHANGED
data/lib/parser/ruby20.y
CHANGED
data/lib/parser/ruby21.y
CHANGED
data/lib/parser/ruby22.y
CHANGED
data/lib/parser/ruby23.y
CHANGED
data/lib/parser/ruby24.y
CHANGED
data/lib/parser/rubymotion.y
CHANGED
data/lib/parser/runner.rb
CHANGED
@@ -84,9 +84,14 @@ module Parser
|
|
84
84
|
@parser_class = Parser::Ruby22
|
85
85
|
end
|
86
86
|
|
87
|
+
opts.on '--23', 'Parse as Ruby 2.3 would' do
|
88
|
+
require 'parser/ruby23'
|
89
|
+
@parser_class = Parser::Ruby23
|
90
|
+
end
|
91
|
+
|
87
92
|
opts.on '--24', 'Parse as Ruby 2.4 would' do
|
88
93
|
require 'parser/ruby24'
|
89
|
-
@parser_class = Parser::
|
94
|
+
@parser_class = Parser::Ruby24
|
90
95
|
end
|
91
96
|
|
92
97
|
opts.on '--mac', 'Parse as MacRuby 0.12 would' do
|
data/lib/parser/version.rb
CHANGED
data/test/test_parser.rb
CHANGED
@@ -2026,6 +2026,15 @@ class TestParser < Minitest::Test
|
|
2026
2026
|
%q{def f(var: defined?(var)) var end},
|
2027
2027
|
%q{},
|
2028
2028
|
ALL_VERSIONS - %w(1.8 1.9 mac ios 2.0))
|
2029
|
+
|
2030
|
+
assert_parses(
|
2031
|
+
s(:block,
|
2032
|
+
s(:send, nil, :lambda),
|
2033
|
+
s(:args, s(:shadowarg, :a)),
|
2034
|
+
s(:lvar, :a)),
|
2035
|
+
%q{lambda{|;a|a}},
|
2036
|
+
%q{},
|
2037
|
+
ALL_VERSIONS - %w(1.8))
|
2029
2038
|
end
|
2030
2039
|
|
2031
2040
|
def assert_parses_args(ast, code, versions=ALL_VERSIONS)
|
@@ -3416,6 +3425,17 @@ class TestParser < Minitest::Test
|
|
3416
3425
|
ALL_VERSIONS - %w(1.8 1.9 2.0 2.1 2.2 ios mac))
|
3417
3426
|
end
|
3418
3427
|
|
3428
|
+
def test_send_block_conditional
|
3429
|
+
assert_parses(
|
3430
|
+
s(:block,
|
3431
|
+
s(:csend,
|
3432
|
+
s(:lvar, :foo), :bar),
|
3433
|
+
s(:args), nil),
|
3434
|
+
%q{foo&.bar {}},
|
3435
|
+
%q{},
|
3436
|
+
ALL_VERSIONS - %w(1.8 1.9 2.0 2.1 2.2 ios mac))
|
3437
|
+
end
|
3438
|
+
|
3419
3439
|
def test_lvar_injecting_match
|
3420
3440
|
assert_parses(
|
3421
3441
|
s(:begin,
|
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.1.
|
4
|
+
version: 2.3.1.1
|
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-06-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ast
|