ruby_parser 3.10.0 → 3.10.1
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
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +1 -3
- data/History.rdoc +7 -0
- data/lib/ruby_lexer.rb +6 -4
- data/lib/ruby_parser.rb +1 -1
- data/lib/ruby_parser_extras.rb +1 -1
- data/test/test_ruby_parser.rb +9 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1f350ff7bf3488d00b47a3600fd72700fdd74f9f
|
4
|
+
data.tar.gz: 33372b3af380e0a55e49b67d7679175a9e853cf1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ccba7c96b1ee7a9ea715ff77337cbdaca1b33f3ccf6f0125e54d8e0d3b689ffb0e9bf3e04c2e2f9952f887b111a1cc999d8f1eeb07ed0e18b07e04bcda61787c
|
7
|
+
data.tar.gz: a744bab946600077d2d6b770cf9bcec6c9f9ad197f8224d2575caf73c4ca0c365d96672cb885ad90019a594678db11487827b2ecc12c00cc55100da859fce85b
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
@@ -1,3 +1 @@
|
|
1
|
-
��"��
|
2
|
-
G��t��X?��T����^�jd�Ӳ���l��5�7K�Y�y"#����:�ْ����@N�
|
3
|
-
4�Z�^]�-N��������
|
1
|
+
r)NG)�W؊��"���������w���*k��nIâk&�?8������N�����{�h��.�*�v��j=D�� �WLטw&X���A""C�*�j�~Y����]C5%�I~Y�ã�R�2Y�z?,A�j�d%��/�s�j6w�'����riS� �-���B��x��M�{E�|��M�Q�h���J}b�]պ|��5Nh�N��LQ����PZ�h�=uݤR*w��;����e9�(Y��ɧ
|
data/History.rdoc
CHANGED
data/lib/ruby_lexer.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# encoding: UTF-8
|
2
2
|
|
3
|
+
$DEBUG = true if ENV["DEBUG"]
|
4
|
+
|
3
5
|
class RubyLexer
|
4
6
|
|
5
7
|
# :stopdoc:
|
@@ -216,7 +218,7 @@ class RubyLexer
|
|
216
218
|
|
217
219
|
string_content = string_buffer.join.delete("\r")
|
218
220
|
|
219
|
-
string_content = heredoc_dedent(string_content) if content_indent &&
|
221
|
+
string_content = heredoc_dedent(string_content) if content_indent && ruby23plus?
|
220
222
|
|
221
223
|
return :tSTRING_CONTENT, string_content
|
222
224
|
end
|
@@ -265,7 +267,7 @@ class RubyLexer
|
|
265
267
|
self.string_buffer = []
|
266
268
|
|
267
269
|
heredoc_indent_mods = '-'
|
268
|
-
heredoc_indent_mods += '\~' if
|
270
|
+
heredoc_indent_mods += '\~' if ruby23plus?
|
269
271
|
|
270
272
|
case
|
271
273
|
when scan(/([#{heredoc_indent_mods}]?)([\'\"\`])(.*?)\2/) then
|
@@ -1175,8 +1177,8 @@ class RubyLexer
|
|
1175
1177
|
parser.class.version >= 22
|
1176
1178
|
end
|
1177
1179
|
|
1178
|
-
def
|
1179
|
-
|
1180
|
+
def ruby23plus?
|
1181
|
+
parser.class.version >= 23
|
1180
1182
|
end
|
1181
1183
|
|
1182
1184
|
def process_string # TODO: rewrite / remove
|
data/lib/ruby_parser.rb
CHANGED
data/lib/ruby_parser_extras.rb
CHANGED
data/test/test_ruby_parser.rb
CHANGED
@@ -3412,6 +3412,13 @@ module TestRubyParserShared23Plus
|
|
3412
3412
|
assert_parse rb, pt
|
3413
3413
|
end
|
3414
3414
|
|
3415
|
+
def test_heredoc_squiggly
|
3416
|
+
rb = "a = <<~\"EOF\"\n blah blah\n EOF\n\n"
|
3417
|
+
pt = s(:lasgn, :a, s(:str, "blah blah\n"))
|
3418
|
+
|
3419
|
+
assert_parse rb, pt
|
3420
|
+
end
|
3421
|
+
|
3415
3422
|
def test_slashy_newlines_within_string
|
3416
3423
|
rb = %(puts "hello\\
|
3417
3424
|
my\\
|
@@ -3440,6 +3447,8 @@ class TestRubyParser < Minitest::Test
|
|
3440
3447
|
def test_cls_version
|
3441
3448
|
assert_equal 18, RubyParser::V18.version
|
3442
3449
|
assert_equal 23, RubyParser::V23.version
|
3450
|
+
assert_equal 24, RubyParser::V24.version
|
3451
|
+
assert_equal 24, Ruby24Parser.version
|
3443
3452
|
refute RubyParser::Parser.version
|
3444
3453
|
end
|
3445
3454
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby_parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.10.
|
4
|
+
version: 3.10.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Davis
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
30
30
|
E4oJcnPkJAr0rw504JGtlZtONZQblwmRJOIdXzolaE3NRGUzGVOUSptZppAKiavY
|
31
31
|
fO6tdKQc/5RfA8oQEkg8hrxA5PQSz4TOFJGLpFvIapEk6tMruQ0bHgkhr9auXg==
|
32
32
|
-----END CERTIFICATE-----
|
33
|
-
date: 2017-07-
|
33
|
+
date: 2017-07-21 00:00:00.000000000 Z
|
34
34
|
dependencies:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: sexp_processor
|
metadata.gz.sig
CHANGED
Binary file
|