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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 999565504b59c7ad12546445a92d20f6ff6235ed29d76c8c52eb73513c23d9e7
4
- data.tar.gz: e04475df2071b10e772259cc6697875067432121122541a5ef5a5092eeee4e1f
3
+ metadata.gz: 77bd0a20c41d5920ff53bc78caad94a0c2fc7d713ae9e6c2eeaf25e007b4eb87
4
+ data.tar.gz: e172d0fc395b41eefe2a4e2e522c62729ba7ba6ccbcf7c4caffe9a3d644d09dc
5
5
  SHA512:
6
- metadata.gz: ef4a0c50b91ba31b62c2274a6d442589fa277e0a606811800e9590ae73e7f6236d80fbc01c1d180adf2d64532d87dc99fcfa4953a28fa272dcce2fb195e8b224
7
- data.tar.gz: 88e285335392b9269787035fe5dccc073758157496bcade661be8acbb912ec134e86fa75e8a2e3fbc0a62f7fa8a38c9f581cbecd9059bbddfe03812f958002cd
6
+ metadata.gz: 07a1e0b7f53363979ca9a9a4601982adc897f82d7aad0dde87219c9510e4dd2f81a0b1d2bdb9c74ca60ea46f44a36c515caa7f009876dbbb2ab0f38046e4ab8e
7
+ data.tar.gz: cf89632cc8124a50e6d0964a527738f2deb98978f7caa66609d04e438c5daafafa30ba5cfd9b30a18f50b32e9319f6c478178267465eaa6385e222b1bf831dc3
@@ -1,9 +1,16 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
- Not released (2018-07-10)
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
 
@@ -39,7 +39,7 @@ module Parser
39
39
  CurrentRuby = Ruby22
40
40
 
41
41
  when /^2\.3\./
42
- current_version = '2.3.7'
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.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.1'
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
@@ -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
- emit(:tSTAR2)
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;
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Parser
4
- VERSION = '2.5.1.2'
4
+ VERSION = '2.5.3.0'
5
5
  end
@@ -3534,4 +3534,10 @@ class TestLexer < Minitest::Test
3534
3534
  :tNL, nil, [4, 5])
3535
3535
  end
3536
3536
 
3537
+ def test_ambiguous_integer_re
3538
+ assert_scanned('1re',
3539
+ :tINTEGER, 1, [0, 1],
3540
+ :tIDENTIFIER, 're', [1, 3])
3541
+ end
3542
+
3537
3543
  end
@@ -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.1.2
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-07-10 00:00:00.000000000 Z
11
+ date: 2018-10-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ast