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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2f40dfeee0e474212f0bfb56c32bfa6ac2c15345
4
- data.tar.gz: 3b138c15fc4ccea9cdaeb78a29d735b4ce044075
3
+ metadata.gz: 1f350ff7bf3488d00b47a3600fd72700fdd74f9f
4
+ data.tar.gz: 33372b3af380e0a55e49b67d7679175a9e853cf1
5
5
  SHA512:
6
- metadata.gz: eab6b5f51918c84302a104d5f9f6957c4848478a2a52c63a013e50dde8e447d88f384721c699a5fdb2e104fa260c3cfc8ab4af135fccc0a320a09ebc2e876917
7
- data.tar.gz: 9dd361bb654390734c54292fe533291c583a202ffde25b417e133abc03cc96b143a0df5669aa4158c4b0938a3aa782d727452778648681eb6b3a2e2495b8358a
6
+ metadata.gz: ccba7c96b1ee7a9ea715ff77337cbdaca1b33f3ccf6f0125e54d8e0d3b689ffb0e9bf3e04c2e2f9952f887b111a1cc999d8f1eeb07ed0e18b07e04bcda61787c
7
+ data.tar.gz: a744bab946600077d2d6b770cf9bcec6c9f9ad197f8224d2575caf73c4ca0c365d96672cb885ad90019a594678db11487827b2ecc12c00cc55100da859fce85b
Binary file
data.tar.gz.sig CHANGED
@@ -1,3 +1 @@
1
- ��"�� ����%{e��磵F�Ne
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��ɧ
@@ -1,3 +1,10 @@
1
+ === 3.10.1 / 2017-07-21
2
+
3
+ * 2 bug fixes:
4
+
5
+ * Fixed identification of parser version whether Ruby##Parser or Parser::V##.
6
+ * Fixed squiggly heredoc lexing when using 24 parser.
7
+
1
8
  === 3.10.0 / 2017-07-17
2
9
 
3
10
  * 4 minor enhancements:
@@ -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 && ruby23?
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 ruby23?
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 ruby23?
1179
- Ruby23Parser === parser
1180
+ def ruby23plus?
1181
+ parser.class.version >= 23
1180
1182
  end
1181
1183
 
1182
1184
  def process_string # TODO: rewrite / remove
@@ -17,7 +17,7 @@ class RubyParser
17
17
  end
18
18
 
19
19
  def self.version
20
- Parser > self and self.name[/V(\d+)$/, 1].to_i
20
+ Parser > self and self.name[/(?:V|Ruby)(\d+)/, 1].to_i
21
21
  end
22
22
  end
23
23
 
@@ -7,7 +7,7 @@ require "rp_extensions"
7
7
  require "rp_stringscanner"
8
8
 
9
9
  module RubyParserStuff
10
- VERSION = "3.10.0"
10
+ VERSION = "3.10.1"
11
11
 
12
12
  attr_accessor :lexer, :in_def, :in_single, :file
13
13
  attr_reader :env, :comments
@@ -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.0
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-17 00:00:00.000000000 Z
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