lib/node_mutation/adapter/parser.rb in node_mutation-1.22.1 vs lib/node_mutation/adapter/parser.rb in node_mutation-1.22.2
- old
+ new
@@ -183,11 +183,11 @@
NodeMutation::Struct::Range.new(node.loc.double_colon.begin_pos, node.loc.double_colon.end_pos)
when %i[defs dot]
NodeMutation::Struct::Range.new(node.loc.operator.begin_pos, node.loc.operator.end_pos) if node.loc.operator
when %i[defs self]
NodeMutation::Struct::Range.new(node.loc.operator.begin_pos - 'self'.length, node.loc.operator.begin_pos)
- when %i[float value], %i[int value], %i[rational value], %i[str value], %i[sym value]
+ when %i[float value], %i[int value], %i[sym value]
NodeMutation::Struct::Range.new(node.loc.expression.begin_pos, node.loc.expression.end_pos)
when %i[lvasgn variable], %i[ivasgn variable], %i[cvasgn variable], %i[gvasgn variable]
NodeMutation::Struct::Range.new(node.loc.name.begin_pos, node.loc.name.end_pos)
when %i[send dot], %i[csend dot]
NodeMutation::Struct::Range.new(node.loc.dot.begin_pos, node.loc.dot.end_pos) if node.loc.dot
@@ -199,9 +199,11 @@
end
when %i[send parentheses], %i[csend parentheses]
if node.loc.begin && node.loc.end
NodeMutation::Struct::Range.new(node.loc.begin.begin_pos, node.loc.end.end_pos)
end
+ when %i[str value]
+ NodeMutation::Struct::Range.new(node.loc.expression.begin_pos + 1, node.loc.expression.end_pos - 1)
else
raise NodeMutation::MethodNotSupported,
"#{direct_child_name} is not supported for #{get_source(node)}" unless node.respond_to?(direct_child_name)
child_node = node.send(direct_child_name)