node_query 1.13.3 → 1.13.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/Gemfile.lock +1 -1
- data/lib/node_query/adapter/syntax_tree.rb +8 -0
- data/lib/node_query/compiler/selector.rb +5 -1
- data/lib/node_query/version.rb +1 -1
- 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: a813be8532c9248503efccc43a4c42d3d6313744f72b5196611510acdd43bf2e
|
4
|
+
data.tar.gz: ae1d48b6cafc9f89037ebafee3233c7b96cc0e0229475496a0ddb9bee6f7d8b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a26f3812969af8538cf399c5213e12d6f8328b6099caefd120e56d279c2d6ce7b4dceceb7c57252ab4699d7a34ab498a08322f687918533ce64c093895466908
|
7
|
+
data.tar.gz: ddf9e451cc4c6dc52c2e4e5635108bfc8cbb19a2f4455c02cd6e0db6737a4ce2b59b263d341f9ee5dfc07b97a65061ef1b41b4c00c905d134558e9037f6ddd47
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
## 1.13.5 (2023-06-17)
|
4
|
+
|
5
|
+
* Separate syntax_tree tests from parser tests
|
6
|
+
* Flatten child iteration for syntax_tree
|
7
|
+
|
8
|
+
## 1.13.4 (2023-06-15)
|
9
|
+
|
10
|
+
* Support `Hash#except` for ruby 2
|
11
|
+
|
3
12
|
## 1.13.3 (2023-06-14)
|
4
13
|
|
5
14
|
* Use `deconstruct_key` to get syntax_tree node children
|
data/Gemfile.lock
CHANGED
@@ -3,6 +3,14 @@
|
|
3
3
|
require 'syntax_tree'
|
4
4
|
require 'syntax_tree_ext'
|
5
5
|
|
6
|
+
if RUBY_VERSION.to_i < 3
|
7
|
+
class Hash
|
8
|
+
def except(*keys)
|
9
|
+
self.reject { |k, _| keys.include?(k) }
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
6
14
|
class NodeQuery::SyntaxTreeAdapter
|
7
15
|
def is_node?(node)
|
8
16
|
node.is_a?(SyntaxTree::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
|
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
|
data/lib/node_query/version.rb
CHANGED
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.
|
4
|
+
version: 1.13.5
|
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-06-
|
11
|
+
date: 2023-06-17 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: ast node query language
|
14
14
|
email:
|