node_mutation 1.23.0 → 1.23.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 +5 -0
- data/Gemfile.lock +1 -1
- data/lib/node_mutation/adapter/prism.rb +4 -3
- data/lib/node_mutation/adapter/syntax_tree.rb +1 -0
- data/lib/node_mutation/version.rb +1 -1
- data/lib/node_mutation.rb +2 -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: d39b10154354f3e35da27b09c378c6d518f47e67249b08143bd452dad5c14292
|
4
|
+
data.tar.gz: d3f988104df2610c420c7d5622b3f18775e64f878a2978ebc48ca2dbccd3f783
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d31f713b129027619f955d8fb96c41562a760d1203333ee6f552f3aed99f76350b0e705649428a249fb63db75c871a562199273f8f21f4956439b7391b9f365c
|
7
|
+
data.tar.gz: 16dfcebbf38b0ca70fa02a4e4d5b22ca2915cb2b74e2d77a3b1840ac5bd476bbcbb55d4824e88343fc44f86ee55ed306ea4c6f2e1a022a740660949ccd19a044
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -138,9 +138,9 @@ class NodeMutation::PrismAdapter < NodeMutation::Adapter
|
|
138
138
|
|
139
139
|
if node.respond_to?("#{child_name}_loc")
|
140
140
|
node_loc = node.send("#{child_name}_loc")
|
141
|
-
if node_loc
|
142
|
-
|
143
|
-
|
141
|
+
NodeMutation::Struct::Range.new(node_loc.start_offset, node_loc.end_offset) if node_loc
|
142
|
+
elsif node.is_a?(Prism::CallNode) && child_name.to_sym == :name
|
143
|
+
NodeMutation::Struct::Range.new(node.message_loc.start_offset, node.message_loc.end_offset)
|
144
144
|
else
|
145
145
|
raise NodeMutation::MethodNotSupported,
|
146
146
|
"#{direct_child_name} is not supported for #{get_source(node)}" unless node.respond_to?(direct_child_name)
|
@@ -150,6 +150,7 @@ class NodeMutation::PrismAdapter < NodeMutation::Adapter
|
|
150
150
|
return child_node_range(child_node, nested_child_name) if nested_child_name
|
151
151
|
|
152
152
|
return nil if child_node.nil?
|
153
|
+
return nil if child_node == []
|
153
154
|
|
154
155
|
if child_node.is_a?(Prism::Node)
|
155
156
|
return(
|
@@ -152,6 +152,7 @@ class NodeMutation::SyntaxTreeAdapter < NodeMutation::Adapter
|
|
152
152
|
return child_node_range(child_node, nested_child_name) if nested_child_name
|
153
153
|
|
154
154
|
return nil if child_node.nil?
|
155
|
+
return nil if child_node == []
|
155
156
|
|
156
157
|
if child_node.is_a?(SyntaxTree::Node)
|
157
158
|
return(
|
data/lib/node_mutation.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: node_mutation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.23.
|
4
|
+
version: 1.23.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Huang
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-02-
|
11
|
+
date: 2024-02-16 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: ast node mutation apis
|
14
14
|
email:
|