parser 2.7.0.5 → 2.7.1.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: 00a9bc5b2d70892e4743417168e53dc469c80328c3983e71b41f312becd116b0
4
- data.tar.gz: 1abbc88751dc8d3b7c28d2df69b71a773533ed2d3726de50df8cfaaa79887aaa
3
+ metadata.gz: 46184af7a1e0d843e62e720cd7795bb196972603e588eed69f47791b3c799288
4
+ data.tar.gz: 1a9d809fc7443fb09deb3a36ea19ad418ff56119040b14a292c9ed8d112d1f29
5
5
  SHA512:
6
- metadata.gz: 32455424b4003ba1510d53b162aa8691bdaea5708b4d88d392d6c89cfa3b6479f1d47c9f42fedd40e663366192434aaf851dbe65cbd1a629c54b7681cfb37879
7
- data.tar.gz: 0c464e9acd5cf95161e18552e4680230417a05e7ad14e805b8661e4bb2ee7a99f4ad2f4e0212c48b35bc9f3ed8549b6723925f0b194e0a57873a2eb472450dbb
6
+ metadata.gz: 9a91995ac131a4048976358a7bce1bd09b09893bb0b13fa39f2128c47fb0b1179f830a4adbb766df768bfbd2f89a1c5a5ee437dc1433ccaf5ad2307ff7c09d77
7
+ data.tar.gz: 4fe835bc9fe1ff030d57e9a4d9a4657a0d244db23bac3c117e8f78bfc51d9dc330f51257e04c8ba5ef737d3feab11152db2e1ecde1e8b136d4fcc4f253ed549d
@@ -2,26 +2,17 @@ dist: trusty
2
2
  language: ruby
3
3
  matrix:
4
4
  include:
5
- - name: 2.0.0 / Parser tests
6
- rvm: 2.0.0
7
- script: bundle exec rake test_cov
8
- - name: 2.2.10 / Parser tests
9
- rvm: 2.2.10
10
- script: bundle exec rake test_cov
11
- - name: 2.3.8 / Parser tests
12
- rvm: 2.3.8
13
- script: bundle exec rake test_cov
14
5
  - name: 2.4.9 / Parser tests
15
6
  rvm: 2.4.9
16
7
  script: bundle exec rake test_cov
17
- - name: 2.5.7 / Parser tests
18
- rvm: 2.5.7
8
+ - name: 2.5.8 / Parser tests
9
+ rvm: 2.5.8
19
10
  script: bundle exec rake test_cov
20
- - name: 2.6.5 / Parser tests
21
- rvm: 2.6.5
11
+ - name: 2.6.6 / Parser tests
12
+ rvm: 2.6.6
22
13
  script: bundle exec rake test_cov
23
- - name: 2.7.0 / Parser tests
24
- rvm: 2.7.0
14
+ - name: 2.7.1 / Parser tests
15
+ rvm: 2.7.1
25
16
  script: bundle exec rake test_cov
26
17
  - name: ruby-head / Parser tests
27
18
  rvm: ruby-head
@@ -32,14 +23,14 @@ matrix:
32
23
  - name: rbx-2 / Parser tests
33
24
  rvm: rbx-2
34
25
  script: bundle exec rake test_cov
35
- - name: 2.5.7 / Rubocop tests
36
- rvm: 2.5.7
26
+ - name: 2.5.8 / Rubocop tests
27
+ rvm: 2.5.8
37
28
  script: ./ci/run_rubocop_specs
38
- - name: 2.6.5 / Rubocop tests
39
- rvm: 2.6.5
29
+ - name: 2.6.6 / Rubocop tests
30
+ rvm: 2.6.6
40
31
  script: ./ci/run_rubocop_specs
41
- - name: 2.7.0 / Rubocop tests
42
- rvm: 2.7.0
32
+ - name: 2.7.1 / Rubocop tests
33
+ rvm: 2.7.1
43
34
  script: ./ci/run_rubocop_specs
44
35
  allow_failures:
45
36
  - rvm: ruby-head
@@ -1,9 +1,19 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
- Not released (2020-03-20)
4
+ Not released (2020-04-03)
5
5
  -------------------------
6
6
 
7
+ API modifications:
8
+ * Bump ruby versions to 2.4.10, 2.5.8, 2.6.6, 2.7.1. (#665) (Ilya Bylich)
9
+
10
+ Features implemented:
11
+ * ruby27.y: allow newlines inside braced pattern. (#664) (Ilya Bylich)
12
+ * ruby27.y: Allow trailing comma in hash pattern (#661) (Koichi ITO)
13
+
14
+ v2.7.0.5 (2020-03-20)
15
+ ---------------------
16
+
7
17
  Features implemented:
8
18
  * ruby27.y: fix array pattern with tail source map (#659) (Vladimir Dementyev)
9
19
 
@@ -48,7 +48,7 @@ module Parser
48
48
  CurrentRuby = Ruby23
49
49
 
50
50
  when /^2\.4\./
51
- current_version = '2.4.9'
51
+ current_version = '2.4.10'
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.7'
60
+ current_version = '2.5.8'
61
61
  if RUBY_VERSION != current_version
62
62
  warn_syntax_deviation 'parser/ruby25', current_version
63
63
  end
@@ -66,7 +66,7 @@ module Parser
66
66
  CurrentRuby = Ruby25
67
67
 
68
68
  when /^2\.6\./
69
- current_version = '2.6.5'
69
+ current_version = '2.6.6'
70
70
  if RUBY_VERSION != current_version
71
71
  warn_syntax_deviation 'parser/ruby26', current_version
72
72
  end
@@ -75,7 +75,7 @@ module Parser
75
75
  CurrentRuby = Ruby26
76
76
 
77
77
  when /^2\.7\./
78
- current_version = '2.7.0'
78
+ current_version = '2.7.1'
79
79
  if RUBY_VERSION != current_version
80
80
  warn_syntax_deviation 'parser/ruby27', current_version
81
81
  end
@@ -1877,13 +1877,16 @@ opt_block_args_tail:
1877
1877
  | tLBRACE
1878
1878
  {
1879
1879
  @pattern_hash_keys.push
1880
+ result = @lexer.in_kwarg
1881
+ @lexer.in_kwarg = false
1880
1882
  }
1881
- p_kwargs tRCURLY
1883
+ p_kwargs rbrace
1882
1884
  {
1883
1885
  @pattern_hash_keys.pop
1886
+ @lexer.in_kwarg = val[1]
1884
1887
  result = @builder.hash_pattern(val[0], val[2], val[3])
1885
1888
  }
1886
- | tLBRACE tRCURLY
1889
+ | tLBRACE rbrace
1887
1890
  {
1888
1891
  result = @builder.hash_pattern(val[0], [], val[1])
1889
1892
  }
@@ -1986,6 +1989,10 @@ opt_block_args_tail:
1986
1989
  {
1987
1990
  result = val[0]
1988
1991
  }
1992
+ | p_kwarg tCOMMA
1993
+ {
1994
+ result = val[0]
1995
+ }
1989
1996
  | p_kwrest
1990
1997
  {
1991
1998
  result = val[0]
@@ -2898,6 +2905,10 @@ keyword_variable: kNIL
2898
2905
  {
2899
2906
  result = val[1]
2900
2907
  }
2908
+ rbrace: opt_nl tRCURLY
2909
+ {
2910
+ result = val[1]
2911
+ }
2901
2912
  trailer: | tNL | tCOMMA
2902
2913
 
2903
2914
  term: tSEMI
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Parser
4
- VERSION = '2.7.0.5'
4
+ VERSION = '2.7.1.0'
5
5
  end
@@ -8675,6 +8675,18 @@ class TestParser < Minitest::Test
8675
8675
  | ~ end (in_pattern.hash_pattern)}
8676
8676
  )
8677
8677
 
8678
+ assert_parses_pattern_match(
8679
+ s(:in_pattern,
8680
+ s(:hash_pattern,
8681
+ s(:pair, s(:sym, :a), s(:int, 1))),
8682
+ nil,
8683
+ s(:true)),
8684
+ %q{in { a: 1, } then true},
8685
+ %q{ ~~~~~~~~~ expression (in_pattern.hash_pattern)
8686
+ | ~ begin (in_pattern.hash_pattern)
8687
+ | ~ end (in_pattern.hash_pattern)}
8688
+ )
8689
+
8678
8690
  assert_parses_pattern_match(
8679
8691
  s(:in_pattern,
8680
8692
  s(:hash_pattern,
@@ -8746,6 +8758,67 @@ class TestParser < Minitest::Test
8746
8758
  %q{in a: 1, _a:, ** then true},
8747
8759
  %q{ ~~~~~~~~~~~~~ expression (in_pattern.hash_pattern)}
8748
8760
  )
8761
+
8762
+ assert_parses_pattern_match(
8763
+ s(:in_pattern,
8764
+ s(:hash_pattern,
8765
+ s(:pair,
8766
+ s(:sym, :a),
8767
+ s(:int, 1))), nil,
8768
+ s(:false)),
8769
+ %q{
8770
+ in {a: 1
8771
+ }
8772
+ false
8773
+ },
8774
+ %q{}
8775
+ )
8776
+
8777
+
8778
+ assert_parses_pattern_match(
8779
+ s(:in_pattern,
8780
+ s(:hash_pattern,
8781
+ s(:pair,
8782
+ s(:sym, :a),
8783
+ s(:int, 2))), nil,
8784
+ s(:false)),
8785
+ %q{
8786
+ in {a:
8787
+ 2}
8788
+ false
8789
+ },
8790
+ %q{}
8791
+ )
8792
+
8793
+ assert_parses_pattern_match(
8794
+ s(:in_pattern,
8795
+ s(:hash_pattern,
8796
+ s(:pair,
8797
+ s(:sym, :a),
8798
+ s(:hash_pattern,
8799
+ s(:match_var, :b))),
8800
+ s(:match_var, :c)), nil,
8801
+ s(:send, nil, :p,
8802
+ s(:lvar, :c))),
8803
+ %q{
8804
+ in a: {b:}, c:
8805
+ p c
8806
+ },
8807
+ %q{}
8808
+ )
8809
+
8810
+ assert_parses_pattern_match(
8811
+ s(:in_pattern,
8812
+ s(:hash_pattern,
8813
+ s(:match_var, :a)), nil,
8814
+ s(:true)),
8815
+ %q{
8816
+ in {a:
8817
+ }
8818
+ true
8819
+ },
8820
+ %q{}
8821
+ )
8749
8822
  end
8750
8823
 
8751
8824
  def test_pattern_matching_hash_with_string_keys
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.5
4
+ version: 2.7.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - whitequark
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-20 00:00:00.000000000 Z
11
+ date: 2020-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ast
@@ -297,9 +297,9 @@ licenses:
297
297
  - MIT
298
298
  metadata:
299
299
  bug_tracker_uri: https://github.com/whitequark/parser/issues
300
- changelog_uri: https://github.com/whitequark/parser/blob/v2.7.0.5/CHANGELOG.md
301
- documentation_uri: https://www.rubydoc.info/gems/parser/2.7.0.5
302
- source_code_uri: https://github.com/whitequark/parser/tree/v2.7.0.5
300
+ changelog_uri: https://github.com/whitequark/parser/blob/v2.7.1.0/CHANGELOG.md
301
+ documentation_uri: https://www.rubydoc.info/gems/parser/2.7.1.0
302
+ source_code_uri: https://github.com/whitequark/parser/tree/v2.7.1.0
303
303
  post_install_message:
304
304
  rdoc_options: []
305
305
  require_paths: