ripper_ruby_parser 1.9.0 → 1.10.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4e4ee66b4ce6abf5b0eeacd55fd137dd7217bf728bc59f1ad6bdf0b197011f86
4
- data.tar.gz: a35a48bfa5178c5a9cec64017842246a4acb8b10a0c09fba2749de9aa650772c
3
+ metadata.gz: a110a987032924880be79cfbb79948e14f90868e8105055a0833284a6f939731
4
+ data.tar.gz: f38c7fa39cb0f1f6fc78cbe72956c77fe15fe74fe99507a3bd59d057618aed0a
5
5
  SHA512:
6
- metadata.gz: 0574addabb87b0f843c2a72a3e5c03b6ffff2461a9f1fa551412ee706841a2baeb354c1decd3ca7c902e1e78c2c2b7c4a346784ebb6c5b1064211b4ca08b8039
7
- data.tar.gz: cffd4a9f013b443e82b3b4d6149719b02119f182aafe86fc2984d81b131bc047bd1143ca5b06cd28dc32e71876cbb67452c9db47979a50d766e28ea7b7f590a2
6
+ metadata.gz: 7bf9631eb8941e2ed07ec265519ce8860f9d417cb224b2bbd1bbb8b32277374d76936be126c7893f73bcbcaa1414a25d4ca2280c9e0e701462cdbf5d34c3c77f
7
+ data.tar.gz: e517b02e7854fc644763932d8935dd5b145e2c7c4546874b419932a1d0f0d53b523cba356949f5b941e1fe6405c5b308cade8c42ba3d02078a8e7abe5df176a6
data/CHANGELOG.md CHANGED
@@ -6,6 +6,12 @@ This project adheres to [Semantic Versioning 2.0.0][1].
6
6
 
7
7
  This document is formatted based on [Keep A CHANGELOG][2].
8
8
 
9
+ ## 1.10.0 / 2022-03-13
10
+
11
+ * Handle shadow arguments ([#161])
12
+ * Drop support for Ruby 2.5 ([#165])
13
+ * Support running on Ruby 3.1([#180])
14
+
9
15
  ## 1.9.0 / 2021-08-10
10
16
 
11
17
  * Fix escape sequence handling in non-interpolating strings and word lists
@@ -226,6 +232,9 @@ This document is formatted based on [Keep A CHANGELOG][2].
226
232
  * Initial release
227
233
 
228
234
  <!-- Pull request links -->
235
+ [#180]: https://github.com/mvz/ripper_ruby_parser/pull/180
236
+ [#165]: https://github.com/mvz/ripper_ruby_parser/pull/165
237
+ [#161]: https://github.com/mvz/ripper_ruby_parser/pull/161
229
238
  [#155]: https://github.com/mvz/ripper_ruby_parser/pull/155
230
239
  [#154]: https://github.com/mvz/ripper_ruby_parser/pull/154
231
240
  [#153]: https://github.com/mvz/ripper_ruby_parser/pull/153
data/README.md CHANGED
@@ -10,8 +10,8 @@ Parse with Ripper, produce sexps that are compatible with RubyParser.
10
10
 
11
11
  * Drop-in replacement for RubyParser
12
12
  * Should handle 1.9 and later syntax gracefully
13
- * Requires Ruby 2.5 or higher
14
- * Compatible with RubyParser 3.17.0
13
+ * Requires Ruby 2.6 or higher
14
+ * Compatible with RubyParser 3.18.0
15
15
 
16
16
  ## Known incompatibilities
17
17
 
@@ -64,7 +64,7 @@ If you want to send pull requests or patches, please:
64
64
 
65
65
  (The MIT License)
66
66
 
67
- Copyright (c) 2012, 2014-2020 Matijs van Zuijlen
67
+ Copyright (c) 2012, 2014-2022 Matijs van Zuijlen
68
68
 
69
69
  Permission is hereby granted, free of charge, to any person obtaining
70
70
  a copy of this software and associated documentation files (the
@@ -14,6 +14,9 @@ module RipperRubyParser
14
14
  make_iter call, args, safe_unwrap_void_stmt(stmt)
15
15
  end
16
16
 
17
+ # NOTE: Argument forwarding is handled differently in Ruby 3.0 and 3.1
18
+ # 3.0: s(:params, nil, nil, s(:args_forward), nil, nil, nil, nil)
19
+ # 3.1: s(:params, nil, nil, nil, nil, nil, s(:args_forward), :&)
17
20
  def process_params(exp)
18
21
  _, normal, defaults, splat, rest, kwargs, doublesplat, block = exp.shift 8
19
22
 
@@ -40,10 +43,15 @@ module RipperRubyParser
40
43
  end
41
44
 
42
45
  def process_block_var(exp)
43
- _, args, = exp.shift 3
46
+ _, args, shadowargs = exp.shift 3
44
47
 
45
48
  names = process(args)
46
49
 
50
+ if shadowargs
51
+ shadowargs = map_process_list(shadowargs).map { |item| item[1] }
52
+ names << s(:shadow, *shadowargs)
53
+ end
54
+
47
55
  convert_arguments names
48
56
  end
49
57
 
@@ -177,11 +185,18 @@ module RipperRubyParser
177
185
  def handle_double_splat(doublesplat)
178
186
  return [] unless doublesplat
179
187
 
180
- [s(:dsplat, process(doublesplat))]
188
+ contents = process(doublesplat)
189
+ case contents.sexp_type
190
+ when :forward_args # Argument forwarding in Ruby 3.1
191
+ [contents]
192
+ else
193
+ [s(:dsplat, contents)]
194
+ end
181
195
  end
182
196
 
183
197
  def handle_block_argument(block)
184
198
  return [] unless block
199
+ return [] if block == :& # Part of argument forwarding in Ruby 3.1; ignore
185
200
 
186
201
  [process(block)]
187
202
  end
@@ -7,7 +7,7 @@ module RipperRubyParser
7
7
  # character literals
8
8
  def process_at_CHAR(exp)
9
9
  _, val, pos = exp.shift 3
10
- with_position(pos, s(:str, fix_encoding(unescape(val[1..-1]))))
10
+ with_position(pos, s(:str, fix_encoding(unescape(val[1..]))))
11
11
  end
12
12
 
13
13
  def process_array(exp)
@@ -195,7 +195,7 @@ module RipperRubyParser
195
195
 
196
196
  def process_at_backref(exp)
197
197
  _, str, pos = exp.shift 3
198
- name = str[1..-1]
198
+ name = str[1..]
199
199
  with_position pos do
200
200
  if /[0-9]/.match?(name)
201
201
  s(:nth_ref, name.to_i)
@@ -131,7 +131,7 @@ module RipperRubyParser
131
131
  end
132
132
 
133
133
  def unescape_hex_char(bare)
134
- hex_to_char(bare[1..-1])
134
+ hex_to_char(bare[1..])
135
135
  end
136
136
 
137
137
  def unescape_unicode_char(bare)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RipperRubyParser
4
- VERSION = "1.9.0"
4
+ VERSION = "1.10.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ripper_ruby_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.0
4
+ version: 1.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matijs van Zuijlen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-10 00:00:00.000000000 Z
11
+ date: 2022-03-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sexp_processor
@@ -43,6 +43,9 @@ dependencies:
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.3'
48
+ - - ">="
46
49
  - !ruby/object:Gem::Version
47
50
  version: 1.3.1
48
51
  type: :development
@@ -50,6 +53,9 @@ dependencies:
50
53
  version_requirements: !ruby/object:Gem::Requirement
51
54
  requirements:
52
55
  - - "~>"
56
+ - !ruby/object:Gem::Version
57
+ version: '1.3'
58
+ - - ">="
53
59
  - !ruby/object:Gem::Version
54
60
  version: 1.3.1
55
61
  - !ruby/object:Gem::Dependency
@@ -100,74 +106,82 @@ dependencies:
100
106
  requirements:
101
107
  - - "~>"
102
108
  - !ruby/object:Gem::Version
103
- version: 1.18.0
109
+ version: '1.25'
104
110
  type: :development
105
111
  prerelease: false
106
112
  version_requirements: !ruby/object:Gem::Requirement
107
113
  requirements:
108
114
  - - "~>"
109
115
  - !ruby/object:Gem::Version
110
- version: 1.18.0
116
+ version: '1.25'
111
117
  - !ruby/object:Gem::Dependency
112
118
  name: rubocop-minitest
113
119
  requirement: !ruby/object:Gem::Requirement
114
120
  requirements:
115
121
  - - "~>"
116
122
  - !ruby/object:Gem::Version
117
- version: 0.15.0
123
+ version: 0.17.0
118
124
  type: :development
119
125
  prerelease: false
120
126
  version_requirements: !ruby/object:Gem::Requirement
121
127
  requirements:
122
128
  - - "~>"
123
129
  - !ruby/object:Gem::Version
124
- version: 0.15.0
130
+ version: 0.17.0
131
+ - !ruby/object:Gem::Dependency
132
+ name: rubocop-packaging
133
+ requirement: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - "~>"
136
+ - !ruby/object:Gem::Version
137
+ version: 0.5.1
138
+ type: :development
139
+ prerelease: false
140
+ version_requirements: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - "~>"
143
+ - !ruby/object:Gem::Version
144
+ version: 0.5.1
125
145
  - !ruby/object:Gem::Dependency
126
146
  name: rubocop-performance
127
147
  requirement: !ruby/object:Gem::Requirement
128
148
  requirements:
129
149
  - - "~>"
130
150
  - !ruby/object:Gem::Version
131
- version: 1.11.0
151
+ version: '1.13'
132
152
  type: :development
133
153
  prerelease: false
134
154
  version_requirements: !ruby/object:Gem::Requirement
135
155
  requirements:
136
156
  - - "~>"
137
157
  - !ruby/object:Gem::Version
138
- version: 1.11.0
158
+ version: '1.13'
139
159
  - !ruby/object:Gem::Dependency
140
160
  name: ruby_parser
141
161
  requirement: !ruby/object:Gem::Requirement
142
162
  requirements:
143
163
  - - "~>"
144
164
  - !ruby/object:Gem::Version
145
- version: 3.17.0
165
+ version: '3.18'
146
166
  type: :development
147
167
  prerelease: false
148
168
  version_requirements: !ruby/object:Gem::Requirement
149
169
  requirements:
150
170
  - - "~>"
151
171
  - !ruby/object:Gem::Version
152
- version: 3.17.0
172
+ version: '3.18'
153
173
  - !ruby/object:Gem::Dependency
154
174
  name: sexp_processor
155
175
  requirement: !ruby/object:Gem::Requirement
156
176
  requirements:
157
- - - ">="
158
- - !ruby/object:Gem::Version
159
- version: 4.13.0
160
- - - "<"
177
+ - - "~>"
161
178
  - !ruby/object:Gem::Version
162
179
  version: '4.16'
163
180
  type: :development
164
181
  prerelease: false
165
182
  version_requirements: !ruby/object:Gem::Requirement
166
183
  requirements:
167
- - - ">="
168
- - !ruby/object:Gem::Version
169
- version: 4.13.0
170
- - - "<"
184
+ - - "~>"
171
185
  - !ruby/object:Gem::Version
172
186
  version: '4.16'
173
187
  - !ruby/object:Gem::Dependency
@@ -221,6 +235,7 @@ metadata:
221
235
  homepage_uri: http://www.github.com/mvz/ripper_ruby_parser
222
236
  source_code_uri: https://github.com/mvz/ripper_ruby_parser
223
237
  changelog_uri: https://github.com/mvz/ripper_ruby_parser/blob/master/CHANGELOG.md
238
+ rubygems_mfa_required: 'true'
224
239
  post_install_message:
225
240
  rdoc_options:
226
241
  - "--main"
@@ -231,14 +246,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
231
246
  requirements:
232
247
  - - ">="
233
248
  - !ruby/object:Gem::Version
234
- version: 2.5.0
249
+ version: 2.6.0
235
250
  required_rubygems_version: !ruby/object:Gem::Requirement
236
251
  requirements:
237
252
  - - ">="
238
253
  - !ruby/object:Gem::Version
239
254
  version: '0'
240
255
  requirements: []
241
- rubygems_version: 3.2.22
256
+ rubygems_version: 3.2.33
242
257
  signing_key:
243
258
  specification_version: 4
244
259
  summary: Parse with Ripper, produce sexps that are compatible with RubyParser.