unparser 0.6.14 → 0.6.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/unparser/emitter/pair.rb +18 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9d1d0033d21b1c64de6affcc9c555797edf5206dc2947484ff8391e3c8e739ce
|
4
|
+
data.tar.gz: 60732ffbcc8a43cd2f04a6cba76e955b7e764ada9d201cd51a0a624d093b3659
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 77db441f3e4da2b584065c597796d4adbb08b07e481b43ee85c80218375cbf8932bae847727afa9abee0be02ee5dea1c2effd5caa70216a5bafa34007d0c3820
|
7
|
+
data.tar.gz: c180d28c4ac14fe5d6b5756350592b472cd084ce932309fd6cc87f042dffb1f1870dd194260e71b53dbac71fa648bd359c7b4d3c8860c7508f7cc854c9d2ef25
|
@@ -17,7 +17,7 @@ module Unparser
|
|
17
17
|
def dispatch
|
18
18
|
if colon?
|
19
19
|
emit_colon
|
20
|
-
unless
|
20
|
+
unless implicit_value_lvar? || implicit_value_send?
|
21
21
|
write(' ')
|
22
22
|
visit(value)
|
23
23
|
end
|
@@ -36,8 +36,23 @@ module Unparser
|
|
36
36
|
write(key.children.first.to_s, ':')
|
37
37
|
end
|
38
38
|
|
39
|
-
def
|
40
|
-
|
39
|
+
def key_value
|
40
|
+
key.children.first
|
41
|
+
end
|
42
|
+
|
43
|
+
def implicit_value_lvar?
|
44
|
+
n_lvar?(value) && value.children.first.equal?(key_value)
|
45
|
+
end
|
46
|
+
|
47
|
+
def implicit_value_send?
|
48
|
+
children = value.children
|
49
|
+
|
50
|
+
n_send?(value) \
|
51
|
+
&& !key_value.end_with?('?') \
|
52
|
+
&& !key_value.end_with?('!') \
|
53
|
+
&& children.fetch(0).nil? \
|
54
|
+
&& children.fetch(1).equal?(key_value) \
|
55
|
+
&& children.at(2).nil?
|
41
56
|
end
|
42
57
|
end
|
43
58
|
end
|
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.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Markus Schirp
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-06-
|
11
|
+
date: 2024-06-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: diff-lcs
|
@@ -268,7 +268,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
268
268
|
- !ruby/object:Gem::Version
|
269
269
|
version: '0'
|
270
270
|
requirements: []
|
271
|
-
rubygems_version: 3.
|
271
|
+
rubygems_version: 3.5.9
|
272
272
|
signing_key:
|
273
273
|
specification_version: 4
|
274
274
|
summary: Generate equivalent source for parser gem AST nodes
|