node_query 1.13.6 → 1.13.7

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: 1fc52310d059d7e75fec20edc82dbecbdfc4d35c1e020c11d00502c0e5fe5908
4
- data.tar.gz: 69d60bdc00ee3f045c9c04984f8b8d6428c1ade3c390b451965abe0343d436cc
3
+ metadata.gz: 9d3c978851b309269c480384d94e9df4d8f217c3c277cb26992fda3d52c29a9c
4
+ data.tar.gz: 88aff1c87c8b0383176b9821baae9997314ceee2993fecba4470614e4b2b48d6
5
5
  SHA512:
6
- metadata.gz: 6924c8b4f4cd528eba9702ffa65f8b5845cd6e2677af90f662e8e1586353f9ccf9b1fa37f6cdafcb7e12abeeb22af614d936f1f7261aa6dab5f7e458ff2f9667
7
- data.tar.gz: c8787e460af35970f72751cedf04fe3f453b3b7afd451c9d80516979706785857be0380506b46f321c1ba3c885fee93eff5eac496853524c996ccfd1df359137
6
+ metadata.gz: 90be84a8b0200d32b5996251a657474053fa95bb265c3b9403334c161a374ba54fd8ac4e64c77d15bccae65a9651539522300ba8a9c0c92fb9fde7d51696625f
7
+ data.tar.gz: 9fa294dfc8e0f1ab399aa21e6dfffdd3b2356e37674d287ba21d3e4c38ffc52727fd48a2edbcce4ca9b03016df322ac52d46b80518dbffb2022b01bdd0c163a3
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 1.13.7 (2023-06-26)
4
+
5
+ * Revert "Flatten syntax_tree children"
6
+
3
7
  ## 1.13.6 (2023-06-26)
4
8
 
5
9
  * Flatten syntax_tree children
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- node_query (1.13.6)
4
+ node_query (1.13.7)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -67,7 +67,7 @@ GEM
67
67
  shellany (0.0.1)
68
68
  syntax_tree (6.1.1)
69
69
  prettier_print (>= 1.2.0)
70
- syntax_tree_ext (0.6.1)
70
+ syntax_tree_ext (0.6.2)
71
71
  syntax_tree
72
72
  thor (1.2.1)
73
73
 
@@ -25,7 +25,7 @@ class NodeQuery::SyntaxTreeAdapter
25
25
  end
26
26
 
27
27
  def get_children(node)
28
- node.deconstruct_keys([]).except(:location, :comments).values.flatten
28
+ node.deconstruct_keys([]).except(:location, :comments).values
29
29
  end
30
30
 
31
31
  def get_siblings(node)
@@ -154,7 +154,11 @@ module NodeQuery::Compiler
154
154
  end
155
155
  else
156
156
  NodeQuery.adapter.get_children(node).each do |child_node|
157
- if NodeQuery.adapter.is_node?(child_node) && :begin == NodeQuery.adapter.get_node_type(child_node)
157
+ if child_node.is_a?(Array) # SyntaxTree may return an array in child node.
158
+ child_node.each do |child_child_node|
159
+ nodes << child_child_node if @rest.match?(child_child_node, child_child_node)
160
+ end
161
+ elsif NodeQuery.adapter.is_node?(child_node) && :begin == NodeQuery.adapter.get_node_type(child_node)
158
162
  NodeQuery.adapter.get_children(child_node).each do |child_child_node|
159
163
  nodes << child_child_node if @rest.match?(child_child_node, child_child_node)
160
164
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class NodeQuery
4
- VERSION = "1.13.6"
4
+ VERSION = "1.13.7"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: node_query
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.13.6
4
+ version: 1.13.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Huang