synvert-core 0.58.0 → 0.58.2

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: 991e04b61994a2fd44aaaa4cb35564a56d359ffd2b9277fb805f6fb684a2f3ce
4
- data.tar.gz: 0d969850a6915e9861937fa2a4e77ee36d93954b0aa764ffa3a56396d83becba
3
+ metadata.gz: b5580dae81209573a74a22792f5f50f329805eb67d74c67d28beb9438115a6ba
4
+ data.tar.gz: 3e97957ff1b4af95a5506ff240c0e500ccf69242d4c03a5db16c84ae03917520
5
5
  SHA512:
6
- metadata.gz: 4d7a0dfe005762899d89eaede4db3219b1d6d03c94d640b1b2168234402747e658f9e19a537f6f129b8cc1e8741ca45cddfa32ed354d8e8361a08a544b41e99f
7
- data.tar.gz: fe58dedc331361f6cfbf1627e55f677e61073271a40ad7ea62bb57233ab9350f8c99750f5346360511d64e3ba0f35d112683029b377e866f3591a9a3f7ea575c
6
+ metadata.gz: 6829aded4d70daf81fa7cab074c7029ee945997434d357cc251cd993ba89ec56bb1b74b4d98964a150cad0d8f3fbb0f9781f31c5eab760b3c5ba392dffac17f1
7
+ data.tar.gz: 57d35f30118d60e234595d66b65580f29b205e7f09115ce3b44c1085d6845ff02c831855e2cd7267983b9e7a87a1480080f28a4cb533a0520b944e445bccd15b
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.58.2 (2021-10-23)
4
+
5
+ * Do not break the whole `recursive_children`
6
+
3
7
  ## 0.58.0 (2021-10-23)
4
8
 
5
9
  * Support `left_value` and `right_value` for `and` and `or` node
@@ -432,8 +432,8 @@ module Parser::AST
432
432
  def recursive_children(&block)
433
433
  children.each do |child|
434
434
  if child.is_a?(Parser::AST::Node)
435
- result = yield child
436
- child.recursive_children(&block) unless result == :stop
435
+ stop = yield child
436
+ child.recursive_children(&block) unless stop == :stop
437
437
  end
438
438
  end
439
439
  end
@@ -55,7 +55,7 @@ module Synvert::Core
55
55
 
56
56
  def squeeze_spaces
57
57
  if file_source[@begin_pos - 1] == ' ' && file_source[@end_pos] == ' '
58
- @begin_pos = @begin_pos - 1
58
+ @begin_pos -= 1
59
59
  end
60
60
  end
61
61
 
@@ -67,19 +67,19 @@ module Synvert::Core
67
67
  after_line_is_blank = lines[end_line] == ''
68
68
 
69
69
  if lines.length > 1 && before_line_is_blank && after_line_is_blank
70
- @end_pos = @end_pos + "\n".length
70
+ @end_pos += "\n".length
71
71
  end
72
72
  end
73
73
 
74
74
  def remove_comma
75
75
  if ',' == file_source[@begin_pos - 1]
76
- @begin_pos = @begin_pos - 1
76
+ @begin_pos -= 1
77
77
  elsif ', ' == file_source[@begin_pos - 2, 2]
78
- @begin_pos = @begin_pos - 2
78
+ @begin_pos -= 2
79
79
  elsif ', ' == file_source[@end_pos, 2]
80
- @end_pos = @end_pos + 2
80
+ @end_pos += 2
81
81
  elsif ',' == file_source[@end_pos]
82
- @end_pos = @end_pos + 1
82
+ @end_pos += 1
83
83
  end
84
84
  end
85
85
 
@@ -21,7 +21,7 @@ module Synvert::Core
21
21
  elsif File.exist?(File.join(Configuration.path, '.rvmrc'))
22
22
  versionFile = '.rvmrc'
23
23
  end
24
- return true if !versionFile
24
+ return true unless versionFile
25
25
 
26
26
  version = File.read(File.join(Configuration.path, versionFile))
27
27
  Gem::Version.new(version) >= Gem::Version.new(@version)
@@ -89,10 +89,12 @@ module Synvert::Core
89
89
  return matching_nodes
90
90
  end
91
91
  current_node.recursive_children do |child_node|
92
+ stop = nil
92
93
  if child_node.match?(@rules)
93
94
  matching_nodes << child_node
94
- break :stop
95
+ stop = :stop
95
96
  end
97
+ stop
96
98
  end
97
99
  else
98
100
  current_node.each do |node|
@@ -101,10 +103,12 @@ module Synvert::Core
101
103
  next
102
104
  end
103
105
  node.recursive_children do |child_node|
106
+ stop = nil
104
107
  if child_node.match?(@rules)
105
108
  matching_nodes << child_node
106
- break :stop
109
+ stop = :stop
107
110
  end
111
+ stop
108
112
  end
109
113
  end
110
114
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Synvert
4
4
  module Core
5
- VERSION = '0.58.0'
5
+ VERSION = '0.58.2'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: synvert-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.58.0
4
+ version: 0.58.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Huang