unparser 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/unparser/adamantium/method_builder.rb +2 -1
- data/lib/unparser/buffer.rb +2 -2
- data/lib/unparser/cli.rb +1 -0
- data/lib/unparser/emitter/hash_pattern.rb +1 -1
- data/lib/unparser/node_details/send.rb +5 -2
- data/lib/unparser/node_helpers.rb +3 -1
- data/lib/unparser/writer/send/unary.rb +1 -1
- data/lib/unparser/writer/send.rb +2 -2
- metadata +8 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d9558d9e9cdfea4d859aaccc4c0ae5e90d28ef05c0cee26710923dd48692c5a
|
4
|
+
data.tar.gz: 0d8e0fe60dc8d5e443c63137e0bbe1d0117b1688eb3f8c2a7f6df273812abfe6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e78f9eadbc554546e0a77fbf8ae198252bd30ee00d893f29c21a4e454d07be7f235eafa8c2501296fd5e3b00102d4b412cbadc6ae4d1f269cad187f8f69dbc3a
|
7
|
+
data.tar.gz: c22cae778457ea0377a939c9940a0aa7976631e87f53ed67e9218759102f563eae76b7102418f3f55c834c229ec4ad10b3cc532b2c3ef6383f13ebb67b01c1b1
|
data/README.md
CHANGED
@@ -10,7 +10,7 @@ The following constraints apply:
|
|
10
10
|
|
11
11
|
* No support for macruby extensions
|
12
12
|
* Only support for the [modern AST](https://github.com/whitequark/parser/#usage) format
|
13
|
-
* Only support for Ruby >= 2.
|
13
|
+
* Only support for Ruby >= 2.6
|
14
14
|
|
15
15
|
Notable Users:
|
16
16
|
|
@@ -110,7 +110,7 @@ If you need to generate Ruby Syntax outside of this band feel free to contact me
|
|
110
110
|
Testing:
|
111
111
|
--------
|
112
112
|
|
113
|
-
Unparser currently successfully round trips almost all ruby code around. Using
|
113
|
+
Unparser currently successfully round trips almost all ruby code around. Using Ruby >= 2.6.
|
114
114
|
If there is a non round trippable example that is NOT subjected to known [Limitations](#limitations).
|
115
115
|
please report a bug.
|
116
116
|
|
data/lib/unparser/buffer.rb
CHANGED
data/lib/unparser/cli.rb
CHANGED
@@ -19,7 +19,10 @@ module Unparser
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def binary_syntax_allowed?
|
22
|
-
selector_binary_operator?
|
22
|
+
selector_binary_operator? \
|
23
|
+
&& arguments.one? \
|
24
|
+
&& !n_splat?(arguments.first) \
|
25
|
+
&& !n_kwargs?(arguments.first)
|
23
26
|
end
|
24
27
|
|
25
28
|
def selector_unary_operator?
|
@@ -48,7 +51,7 @@ module Unparser
|
|
48
51
|
memoize :assignment?
|
49
52
|
|
50
53
|
def arguments
|
51
|
-
children[2
|
54
|
+
children[2..]
|
52
55
|
end
|
53
56
|
memoize :arguments
|
54
57
|
|
@@ -36,18 +36,20 @@ module Unparser
|
|
36
36
|
args
|
37
37
|
array
|
38
38
|
array_pattern
|
39
|
-
empty_else
|
40
39
|
begin
|
41
40
|
block
|
42
41
|
cbase
|
43
42
|
const
|
44
43
|
dstr
|
44
|
+
empty_else
|
45
45
|
ensure
|
46
46
|
hash
|
47
47
|
hash_pattern
|
48
48
|
if
|
49
49
|
in_pattern
|
50
50
|
int
|
51
|
+
kwarg
|
52
|
+
kwargs
|
51
53
|
kwsplat
|
52
54
|
lambda
|
53
55
|
match_rest
|
data/lib/unparser/writer/send.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unparser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Markus Schirp
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-11-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: diff-lcs
|
@@ -44,28 +44,28 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.
|
47
|
+
version: 0.11.1
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.
|
54
|
+
version: 0.11.1
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: mutant-rspec
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0.
|
61
|
+
version: 0.11.1
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 0.
|
68
|
+
version: 0.11.1
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rspec
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -257,15 +257,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
257
257
|
requirements:
|
258
258
|
- - ">="
|
259
259
|
- !ruby/object:Gem::Version
|
260
|
-
version: '2.
|
260
|
+
version: '2.6'
|
261
261
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
262
262
|
requirements:
|
263
263
|
- - ">="
|
264
264
|
- !ruby/object:Gem::Version
|
265
265
|
version: '0'
|
266
266
|
requirements: []
|
267
|
-
|
268
|
-
rubygems_version: 2.7.6.2
|
267
|
+
rubygems_version: 3.1.6
|
269
268
|
signing_key:
|
270
269
|
specification_version: 4
|
271
270
|
summary: Generate equivalent source for parser gem AST nodes
|