ripper_ruby_parser 1.5.0 → 1.5.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bad890447c64972884e94b2470b0fcb8114aad1af6e9b44c27d05f1187a789d3
|
4
|
+
data.tar.gz: ea2965906b883f6b8f1d7481cd04d89c3d1dcc57c8bba022adfc27b1af01df1a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c4ef6f13a7914774863c9503dfd27dd099e5adf1f122c7f7f38105b9b7570a7dfe5b51ac744a2a7a200b6c7012937477a933f2651b7e48e7b41b70a81f6bb7dc
|
7
|
+
data.tar.gz: c28f34964b94a8d7bd28fb47924d8ffd7f99104bb22ce90de48ed6b9ac2c1b32b789bf5c5059bc02c7d29ae5d98622cfc72f0d41d6eba6fc77f177e65679917e
|
data/CHANGELOG.md
CHANGED
@@ -19,7 +19,9 @@ module RipperRubyParser
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def process_defs(exp)
|
22
|
-
_, receiver, _,
|
22
|
+
_, receiver, _, ident, params, body = exp.shift 6
|
23
|
+
|
24
|
+
ident, = extract_node_symbol_with_position ident
|
23
25
|
|
24
26
|
in_method do
|
25
27
|
params = convert_method_args(process(params))
|
@@ -27,10 +29,7 @@ module RipperRubyParser
|
|
27
29
|
body = with_kwrest(kwrest) { method_body(body) }
|
28
30
|
end
|
29
31
|
|
30
|
-
s(:defs,
|
31
|
-
process(receiver),
|
32
|
-
extract_node_symbol(process(method)),
|
33
|
-
params, *body)
|
32
|
+
s(:defs, process(receiver), ident, params, *body)
|
34
33
|
end
|
35
34
|
|
36
35
|
def process_return(exp)
|
@@ -177,6 +177,12 @@ describe RipperRubyParser::Parser do
|
|
177
177
|
must_be_parsed_as s(:defn, :+, s(:args),
|
178
178
|
s(:nil))
|
179
179
|
end
|
180
|
+
|
181
|
+
it 'works when the method name is a keyword' do
|
182
|
+
'def for; end'.
|
183
|
+
must_be_parsed_as s(:defn, :for, s(:args),
|
184
|
+
s(:nil))
|
185
|
+
end
|
180
186
|
end
|
181
187
|
|
182
188
|
describe 'for singleton method definitions' do
|
@@ -207,6 +213,14 @@ describe RipperRubyParser::Parser do
|
|
207
213
|
s(:args, :"*baz"),
|
208
214
|
s(:nil))
|
209
215
|
end
|
216
|
+
|
217
|
+
it 'works when the method name is a keyword' do
|
218
|
+
'def foo.for; end'.
|
219
|
+
must_be_parsed_as s(:defs,
|
220
|
+
s(:call, nil, :foo),
|
221
|
+
:for, s(:args),
|
222
|
+
s(:nil))
|
223
|
+
end
|
210
224
|
end
|
211
225
|
|
212
226
|
describe 'for the alias statement' do
|
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.5.
|
4
|
+
version: 1.5.1
|
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: 2019-03-
|
11
|
+
date: 2019-03-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sexp_processor
|