parser 2.7.0.1 → 2.7.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +6 -0
- data/CHANGELOG.md +7 -1
- data/lib/parser/lexer.rl +5 -1
- data/lib/parser/version.rb +1 -1
- data/test/parse_helper.rb +3 -0
- data/test/test_parser.rb +12 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb64651ef64daa71d4c55d8ab253c90ce470eaf85f3b0ce98dfe5f171a681c80
|
4
|
+
data.tar.gz: a875a3b5c4a92b7fae3a58c379c300519e7c328641a7cb8d8a65e3f131118eed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8bd9f983ef31671217011a895e07b466f5327578f1dbc2288e5bcd08e367d038e0ee53c35ee1851323c8b04ab20e3fd27c1347a7615c869a99ebcebc8a949baf
|
7
|
+
data.tar.gz: cab52019893fb86e6fe66aaa9391d9d6cd721daac62550f7a0d2303bafbcc6deac349c4366315f8bc4ba15f6309b7ead3f30e3ff8fcd0e15a394c63c86071db7
|
data/.travis.yml
CHANGED
@@ -20,6 +20,9 @@ matrix:
|
|
20
20
|
- name: 2.6.5 / Parser tests
|
21
21
|
rvm: 2.6.5
|
22
22
|
script: bundle exec rake test_cov
|
23
|
+
- name: 2.7.0 / Parser tests
|
24
|
+
rvm: 2.7.0
|
25
|
+
script: bundle exec rake test_cov
|
23
26
|
- name: ruby-head / Parser tests
|
24
27
|
rvm: ruby-head
|
25
28
|
script: bundle exec rake test_cov
|
@@ -35,6 +38,9 @@ matrix:
|
|
35
38
|
- name: 2.6.5 / Rubocop tests
|
36
39
|
rvm: 2.6.5
|
37
40
|
script: ./ci/run_rubocop_specs
|
41
|
+
- name: 2.7.0 / Rubocop tests
|
42
|
+
rvm: 2.7.0
|
43
|
+
script: ./ci/run_rubocop_specs
|
38
44
|
allow_failures:
|
39
45
|
- rvm: ruby-head
|
40
46
|
- rvm: rbx-2
|
data/CHANGELOG.md
CHANGED
@@ -1,9 +1,15 @@
|
|
1
1
|
Changelog
|
2
2
|
=========
|
3
3
|
|
4
|
-
Not released (
|
4
|
+
Not released (2020-01-08)
|
5
5
|
-------------------------
|
6
6
|
|
7
|
+
Bugs fixed:
|
8
|
+
* lexer.rl: fix paren_nest for curly braces (#646) (Ilya Bylich)
|
9
|
+
|
10
|
+
v2.7.0.1 (2019-12-30)
|
11
|
+
---------------------
|
12
|
+
|
7
13
|
Bugs fixed:
|
8
14
|
* dedenter.rb: prevent `ArgumentError` when processing binary en… (#642) (Koichi ITO)
|
9
15
|
|
data/lib/parser/lexer.rl
CHANGED
@@ -1064,7 +1064,6 @@ class Parser::Lexer
|
|
1064
1064
|
emit(:tRCURLY, '}'.freeze, p - 1, p)
|
1065
1065
|
@cond.lexpop
|
1066
1066
|
@cmdarg.lexpop
|
1067
|
-
@paren_nest -= 1
|
1068
1067
|
else
|
1069
1068
|
emit(:tSTRING_DEND, '}'.freeze, p - 1, p)
|
1070
1069
|
end
|
@@ -1079,6 +1078,8 @@ class Parser::Lexer
|
|
1079
1078
|
fbreak;
|
1080
1079
|
end
|
1081
1080
|
end
|
1081
|
+
|
1082
|
+
@paren_nest -= 1
|
1082
1083
|
};
|
1083
1084
|
|
1084
1085
|
action extend_interp_code {
|
@@ -2165,6 +2166,9 @@ class Parser::Lexer
|
|
2165
2166
|
emit_do
|
2166
2167
|
end
|
2167
2168
|
end
|
2169
|
+
if tok == '{'.freeze
|
2170
|
+
@paren_nest += 1
|
2171
|
+
end
|
2168
2172
|
@command_start = true
|
2169
2173
|
|
2170
2174
|
fnext expr_value; fbreak;
|
data/lib/parser/version.rb
CHANGED
data/test/parse_helper.rb
CHANGED
@@ -127,6 +127,9 @@ module ParseHelper
|
|
127
127
|
|
128
128
|
assert parser.instance_eval { @lexer }.cmdarg.empty?,
|
129
129
|
"(#{version}) expected cmdarg to be empty after parsing"
|
130
|
+
|
131
|
+
assert_equal 0, parser.instance_eval { @lexer.instance_eval { @paren_nest } },
|
132
|
+
"(#{version}) expected paren_nest to be 0 after parsing"
|
130
133
|
end
|
131
134
|
|
132
135
|
# Use like this:
|
data/test/test_parser.rb
CHANGED
@@ -9294,4 +9294,16 @@ class TestParser < Minitest::Test
|
|
9294
9294
|
%{ ^^ location},
|
9295
9295
|
SINCE_2_7)
|
9296
9296
|
end
|
9297
|
+
|
9298
|
+
def test_parser_bug_645
|
9299
|
+
assert_parses(
|
9300
|
+
s(:block,
|
9301
|
+
s(:lambda),
|
9302
|
+
s(:args,
|
9303
|
+
s(:optarg, :arg,
|
9304
|
+
s(:hash))), nil),
|
9305
|
+
'-> (arg={}) {}',
|
9306
|
+
%{},
|
9307
|
+
SINCE_1_9)
|
9308
|
+
end
|
9297
9309
|
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.7.0.
|
4
|
+
version: 2.7.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- whitequark
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ast
|
@@ -311,7 +311,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
311
311
|
- !ruby/object:Gem::Version
|
312
312
|
version: '0'
|
313
313
|
requirements: []
|
314
|
-
rubygems_version: 3.0.
|
314
|
+
rubygems_version: 3.0.6
|
315
315
|
signing_key:
|
316
316
|
specification_version: 4
|
317
317
|
summary: A Ruby parser written in pure Ruby.
|