parser 2.5.1.2 → 2.5.3.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/CHANGELOG.md +8 -1
- data/lib/parser/current.rb +3 -3
- data/lib/parser/lexer.rl +4 -3
- data/lib/parser/version.rb +1 -1
- data/test/test_lexer.rb +6 -0
- data/test/test_parser.rb +17 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 77bd0a20c41d5920ff53bc78caad94a0c2fc7d713ae9e6c2eeaf25e007b4eb87
|
4
|
+
data.tar.gz: e172d0fc395b41eefe2a4e2e522c62729ba7ba6ccbcf7c4caffe9a3d644d09dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 07a1e0b7f53363979ca9a9a4601982adc897f82d7aad0dde87219c9510e4dd2f81a0b1d2bdb9c74ca60ea46f44a36c515caa7f009876dbbb2ab0f38046e4ab8e
|
7
|
+
data.tar.gz: cf89632cc8124a50e6d0964a527738f2deb98978f7caa66609d04e438c5daafafa30ba5cfd9b30a18f50b32e9319f6c478178267465eaa6385e222b1bf831dc3
|
data/CHANGELOG.md
CHANGED
@@ -1,9 +1,16 @@
|
|
1
1
|
Changelog
|
2
2
|
=========
|
3
3
|
|
4
|
-
Not released (2018-
|
4
|
+
Not released (2018-10-29)
|
5
5
|
-------------------------
|
6
6
|
|
7
|
+
Bugs fixed:
|
8
|
+
* lexer.rl: Fix parsing of 'm :key => m do; m() do end; end'. (#526) (Ilya Bylich)
|
9
|
+
* lexer.rl: Fix parsing of ambiguous 1re. (#523) (Ilya Bylich)
|
10
|
+
|
11
|
+
v2.5.1.2 (2018-07-10)
|
12
|
+
---------------------
|
13
|
+
|
7
14
|
Bugs fixed:
|
8
15
|
* lexer.rl: Partially revert 5ba072d and properly handle 'm = -> *args do end'. (Ilya Bylich)
|
9
16
|
|
data/lib/parser/current.rb
CHANGED
@@ -39,7 +39,7 @@ module Parser
|
|
39
39
|
CurrentRuby = Ruby22
|
40
40
|
|
41
41
|
when /^2\.3\./
|
42
|
-
current_version = '2.3.
|
42
|
+
current_version = '2.3.8'
|
43
43
|
if RUBY_VERSION != current_version
|
44
44
|
warn_syntax_deviation 'parser/ruby23', current_version
|
45
45
|
end
|
@@ -48,7 +48,7 @@ module Parser
|
|
48
48
|
CurrentRuby = Ruby23
|
49
49
|
|
50
50
|
when /^2\.4\./
|
51
|
-
current_version = '2.4.
|
51
|
+
current_version = '2.4.5'
|
52
52
|
if RUBY_VERSION != current_version
|
53
53
|
warn_syntax_deviation 'parser/ruby24', current_version
|
54
54
|
end
|
@@ -57,7 +57,7 @@ module Parser
|
|
57
57
|
CurrentRuby = Ruby24
|
58
58
|
|
59
59
|
when /^2\.5\./
|
60
|
-
current_version = '2.5.
|
60
|
+
current_version = '2.5.3'
|
61
61
|
if RUBY_VERSION != current_version
|
62
62
|
warn_syntax_deviation 'parser/ruby25', current_version
|
63
63
|
end
|
data/lib/parser/lexer.rl
CHANGED
@@ -625,6 +625,7 @@ class Parser::Lexer
|
|
625
625
|
| 'r' % { @num_xfrm = lambda { |chars| emit(:tRATIONAL, Rational(chars)) } }
|
626
626
|
| 'i' % { @num_xfrm = lambda { |chars| emit(:tIMAGINARY, Complex(0, chars)) } }
|
627
627
|
| 'ri' % { @num_xfrm = lambda { |chars| emit(:tIMAGINARY, Complex(0, Rational(chars))) } }
|
628
|
+
| 're' % { @num_xfrm = lambda { |chars| emit(:tINTEGER, chars, @ts, @te - 2); p -= 2 } }
|
628
629
|
| 'if' % { @num_xfrm = lambda { |chars| emit(:tINTEGER, chars, @ts, @te - 2); p -= 2 } }
|
629
630
|
| 'rescue' % { @num_xfrm = lambda { |chars| emit(:tINTEGER, chars, @ts, @te - 6); p -= 6 } };
|
630
631
|
|
@@ -2243,16 +2244,16 @@ class Parser::Lexer
|
|
2243
2244
|
# OPERATORS
|
2244
2245
|
#
|
2245
2246
|
|
2246
|
-
'*'
|
2247
|
+
'*' | '=>'
|
2247
2248
|
=> {
|
2248
|
-
|
2249
|
+
emit_table(PUNCTUATION)
|
2249
2250
|
fgoto expr_value;
|
2250
2251
|
};
|
2251
2252
|
|
2252
2253
|
# When '|', '~', '!', '=>' are used as operators
|
2253
2254
|
# they do not accept any symbols (or quoted labels) after.
|
2254
2255
|
# Other binary operators accept it.
|
2255
|
-
( operator_arithmetic | operator_rest ) - ( '|' | '~' | '!'
|
2256
|
+
( operator_arithmetic | operator_rest ) - ( '|' | '~' | '!' | '*' )
|
2256
2257
|
=> {
|
2257
2258
|
emit_table(PUNCTUATION);
|
2258
2259
|
fnext expr_value; fbreak;
|
data/lib/parser/version.rb
CHANGED
data/test/test_lexer.rb
CHANGED
data/test/test_parser.rb
CHANGED
@@ -7035,4 +7035,21 @@ class TestParser < Minitest::Test
|
|
7035
7035
|
%q{},
|
7036
7036
|
ALL_VERSIONS)
|
7037
7037
|
end
|
7038
|
+
|
7039
|
+
def test_parser_bug_525
|
7040
|
+
assert_parses(
|
7041
|
+
s(:block,
|
7042
|
+
s(:send, nil, :m1,
|
7043
|
+
s(:hash,
|
7044
|
+
s(:pair,
|
7045
|
+
s(:sym, :k),
|
7046
|
+
s(:send, nil, :m2)))),
|
7047
|
+
s(:args),
|
7048
|
+
s(:block,
|
7049
|
+
s(:send, nil, :m3),
|
7050
|
+
s(:args), nil)),
|
7051
|
+
'm1 :k => m2 do; m3() do end; end',
|
7052
|
+
%q{},
|
7053
|
+
ALL_VERSIONS)
|
7054
|
+
end
|
7038
7055
|
end
|
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.5.
|
4
|
+
version: 2.5.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- whitequark
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-10-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ast
|