node_query 1.13.10 → 1.13.11

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: 587cefdbcb8ef9ae22bdf3ec6f9a5ccbbe468c67801a841cdd96204634567b05
4
- data.tar.gz: 4257ea586307071a0edb6ef6657af7a2227ed4b6006532d4186c1f02ed4d4711
3
+ metadata.gz: d162f1ed40046054e6b68d3b89341508485ca005541c16408c632f86f205a818
4
+ data.tar.gz: 191962526bb18daa93b6e506181c99d211cdc3273fe861d4e6aec699720b5557
5
5
  SHA512:
6
- metadata.gz: 60efa801673c6243456a98a50249edb70d7c46443def3b160530d2d9ab7633e62b4c012c9ed5f08f13ea8d3756870d63b194c9529818a4f3b2cc6c5a6a134533
7
- data.tar.gz: ab891c93073c30d513f6886c72d7c5054268de9772231c350d190597978250510f25120fbbb339e9d93c96710f73dc7609b0199bccaf5a595794e11fefb90952
6
+ metadata.gz: 6a3ed7084d7268f5e4aef354fd5b49abec8e255ca542a755992eabb705402e23eabfead3d16b37a6b451c63c5703bdf2f24da59be8bbdbbe9b623e02b44dcf9f
7
+ data.tar.gz: 00d10e20a2a6cbc4db6340bdc01f77a543361e689cc877fbb5923f996306c51301cd40612fbf9d6e3928954aa680a0f3055cea6d273dc7043bfaebb960e9cfed
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 1.13.11 (2023-08-17)
4
+
5
+ * Do not handle if `child_node` is nil
6
+
3
7
  ## 1.13.10 (2023-08-12)
4
8
 
5
9
  * Update `node_query_parser.y`
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- node_query (1.13.10)
4
+ node_query (1.13.11)
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.2)
70
+ syntax_tree_ext (0.6.4)
71
71
  syntax_tree
72
72
  thor (1.2.1)
73
73
 
@@ -33,15 +33,7 @@ class NodeQuery::Helper
33
33
  # @yieldparam child [Node] child node
34
34
  def handle_recursive_child(node, &block)
35
35
  NodeQuery.adapter.get_children(node).each do |child|
36
- if NodeQuery.adapter.is_node?(child)
37
- block.call(child)
38
- handle_recursive_child(child, &block)
39
- elsif child.is_a?(Array)
40
- child.each do |child_child|
41
- block.call(child_child)
42
- handle_recursive_child(child_child, &block)
43
- end
44
- end
36
+ handle_child(child, &block)
45
37
  end
46
38
  end
47
39
 
@@ -67,5 +59,18 @@ class NodeQuery::Helper
67
59
 
68
60
  node.to_s
69
61
  end
62
+
63
+ private
64
+
65
+ def handle_child(node, &block)
66
+ if NodeQuery.adapter.is_node?(node)
67
+ block.call(node)
68
+ handle_recursive_child(node, &block)
69
+ elsif node.is_a?(Array)
70
+ node.each do |child_node|
71
+ handle_child(child_node, &block) unless child_node.nil?
72
+ end
73
+ end
74
+ end
70
75
  end
71
76
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class NodeQuery
4
- VERSION = "1.13.10"
4
+ VERSION = "1.13.11"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: node_query
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.13.10
4
+ version: 1.13.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Huang
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-08-12 00:00:00.000000000 Z
11
+ date: 2023-08-17 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: ast node query language
14
14
  email:
@@ -78,7 +78,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
78
78
  - !ruby/object:Gem::Version
79
79
  version: '0'
80
80
  requirements: []
81
- rubygems_version: 3.4.17
81
+ rubygems_version: 3.4.18
82
82
  signing_key:
83
83
  specification_version: 4
84
84
  summary: ast node query language