synvert-core 0.57.0 → 0.57.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/synvert/core/node_ext.rb +2 -2
- data/lib/synvert/core/version.rb +1 -1
- data/spec/synvert/core/node_ext_spec.rb +20 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d308267b7dc3f8561869a44ab25b6ffb329f4dfbc04ae66e960de167faa1ee4a
|
4
|
+
data.tar.gz: c6863adae12f49e7d8c0eb79c336f11b5dfaead8b7679a32c32a2131a0cd2ccf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce3db59d4d4d047c4abafbe3130252615bf601fc980c601d93552777105c646eb76174e04ae5e7af16004570f4d091c7549c40c5b5b0e803ab8eb916607ae34a
|
7
|
+
data.tar.gz: 2095af835a69d267a8d78112752aa553c002cb0699f3ca082b2ef0600e95b772eba9aae76cbd863ae3e8d7a7101c92942e03ae89e34d0c3abd6a636a5b65ac29
|
data/CHANGELOG.md
CHANGED
@@ -215,7 +215,7 @@ module Parser::AST
|
|
215
215
|
# @return [Parser::AST::Node] variable nodes.
|
216
216
|
# @raise [Synvert::Core::MethodNotSupported] if calls on other node.
|
217
217
|
def left_value
|
218
|
-
if %i[masgn lvasgn ivasgn cvasgn].include? type
|
218
|
+
if %i[masgn lvasgn ivasgn cvasgn and or].include? type
|
219
219
|
children[0]
|
220
220
|
elsif :or_asgn == type
|
221
221
|
children[0].children[0]
|
@@ -229,7 +229,7 @@ module Parser::AST
|
|
229
229
|
# @return [Array<Parser::AST::Node>] variable nodes.
|
230
230
|
# @raise [Synvert::Core::MethodNotSupported] if calls on other node.
|
231
231
|
def right_value
|
232
|
-
if %i[masgn lvasgn ivasgn cvasgn or_asgn].include? type
|
232
|
+
if %i[masgn lvasgn ivasgn cvasgn or_asgn and or].include? type
|
233
233
|
children[1]
|
234
234
|
else
|
235
235
|
raise Synvert::Core::MethodNotSupported, "right_value is not handled for #{debug_info}"
|
data/lib/synvert/core/version.rb
CHANGED
@@ -291,6 +291,16 @@ describe Parser::AST::Node do
|
|
291
291
|
node = parse('a ||= 1')
|
292
292
|
expect(node.left_value).to eq :a
|
293
293
|
end
|
294
|
+
|
295
|
+
it 'gets for and' do
|
296
|
+
node = parse('foo && bar')
|
297
|
+
expect(node.left_value).to eq parse('foo')
|
298
|
+
end
|
299
|
+
|
300
|
+
it 'gets for or' do
|
301
|
+
node = parse('foo || bar')
|
302
|
+
expect(node.left_value).to eq parse('foo')
|
303
|
+
end
|
294
304
|
end
|
295
305
|
|
296
306
|
describe '#right_value' do
|
@@ -323,6 +333,16 @@ describe Parser::AST::Node do
|
|
323
333
|
node = parse('a ||= 1')
|
324
334
|
expect(node.right_value).to eq parse('1')
|
325
335
|
end
|
336
|
+
|
337
|
+
it 'gets for and' do
|
338
|
+
node = parse('foo && bar')
|
339
|
+
expect(node.right_value).to eq parse('bar')
|
340
|
+
end
|
341
|
+
|
342
|
+
it 'gets for or' do
|
343
|
+
node = parse('foo || bar')
|
344
|
+
expect(node.right_value).to eq parse('bar')
|
345
|
+
end
|
326
346
|
end
|
327
347
|
|
328
348
|
describe '#to_value' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: synvert-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.57.
|
4
|
+
version: 0.57.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Huang
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-10-
|
11
|
+
date: 2021-10-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|