node_mutation 1.22.0 → 1.22.2
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 -1
- data/Gemfile.lock +1 -1
- data/lib/node_mutation/adapter/parser.rb +4 -0
- data/lib/node_mutation/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: b356f4d7717749c2ab7c3642b8cda4a9bff43a3c23579e79963a0faf5f408962
|
4
|
+
data.tar.gz: fc6baa97db54a507a1867eebf913231e4df4c614caf1f3ba88860ee5ddf4648d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 49a928c2134940bec43877077af74fce088df6603f624e0b273da6a740b0f5aabc3a682751f5739d6869b32c71c667ba90567130d776acb1ae4a1212d48d4582
|
7
|
+
data.tar.gz: 47ae1f5eb4ffd36a3e121c7bd7936578c10f9c83785a4abadb67eba4f5b76c9ff9f1edfdcfb0beecb719f87bf436a11dde8474b176b2499b8a8d4567f7220359
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# NodeMutation
|
2
2
|
|
3
|
+
## 1.22.2 (2023-12-04)
|
4
|
+
|
5
|
+
* `str` child node range does not include quotes
|
6
|
+
|
7
|
+
## 1.22.1 (2023-12-04)
|
8
|
+
|
9
|
+
* `child_node_range` supports int/float/str/sym `value`
|
10
|
+
|
3
11
|
## 1.22.0 (2023-11-27)
|
4
12
|
|
5
13
|
* Add `adapter` parameter to `NodeMutation`
|
@@ -127,7 +135,7 @@
|
|
127
135
|
|
128
136
|
## 1.13.1 (2023-03-31)
|
129
137
|
|
130
|
-
* Remove both
|
138
|
+
* Remove both whitespace only when next char is nil
|
131
139
|
|
132
140
|
## 1.13.0 (2023-03-31)
|
133
141
|
|
data/Gemfile.lock
CHANGED
@@ -185,6 +185,8 @@ class NodeMutation::ParserAdapter < NodeMutation::Adapter
|
|
185
185
|
NodeMutation::Struct::Range.new(node.loc.operator.begin_pos, node.loc.operator.end_pos) if node.loc.operator
|
186
186
|
when %i[defs self]
|
187
187
|
NodeMutation::Struct::Range.new(node.loc.operator.begin_pos - 'self'.length, node.loc.operator.begin_pos)
|
188
|
+
when %i[float value], %i[int value], %i[sym value]
|
189
|
+
NodeMutation::Struct::Range.new(node.loc.expression.begin_pos, node.loc.expression.end_pos)
|
188
190
|
when %i[lvasgn variable], %i[ivasgn variable], %i[cvasgn variable], %i[gvasgn variable]
|
189
191
|
NodeMutation::Struct::Range.new(node.loc.name.begin_pos, node.loc.name.end_pos)
|
190
192
|
when %i[send dot], %i[csend dot]
|
@@ -199,6 +201,8 @@ class NodeMutation::ParserAdapter < NodeMutation::Adapter
|
|
199
201
|
if node.loc.begin && node.loc.end
|
200
202
|
NodeMutation::Struct::Range.new(node.loc.begin.begin_pos, node.loc.end.end_pos)
|
201
203
|
end
|
204
|
+
when %i[str value]
|
205
|
+
NodeMutation::Struct::Range.new(node.loc.expression.begin_pos + 1, node.loc.expression.end_pos - 1)
|
202
206
|
else
|
203
207
|
raise NodeMutation::MethodNotSupported,
|
204
208
|
"#{direct_child_name} is not supported for #{get_source(node)}" unless node.respond_to?(direct_child_name)
|
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.22.
|
4
|
+
version: 1.22.2
|
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-
|
11
|
+
date: 2023-12-04 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: ast node mutation apis
|
14
14
|
email:
|