[ruby/yarp] Handle interpolated regular expressions with the o flag for locals checking
https://github.com/ruby/yarp/commit/db95191207
This commit is contained in:
parent
524d99daaf
commit
0fd57ee01d
@ -481,6 +481,8 @@ module YARP
|
||||
locals << []
|
||||
when PostExecutionNode
|
||||
locals.push([], [])
|
||||
when InterpolatedRegularExpressionNode
|
||||
locals << [] if node.once?
|
||||
end
|
||||
|
||||
stack.concat(node.child_nodes.compact)
|
||||
|
@ -26,3 +26,5 @@ foo /bar/
|
||||
/(?#\))/ =~ "hi"
|
||||
|
||||
%r#pound#
|
||||
|
||||
/aaa #{bbb}/o
|
||||
|
@ -1,6 +1,6 @@
|
||||
ProgramNode(0...278)(
|
||||
ProgramNode(0...293)(
|
||||
[:foo],
|
||||
StatementsNode(0...278)(
|
||||
StatementsNode(0...293)(
|
||||
[CallNode(0...9)(
|
||||
nil,
|
||||
nil,
|
||||
@ -138,6 +138,29 @@ ProgramNode(0...278)(
|
||||
(277...278),
|
||||
"pound",
|
||||
0
|
||||
),
|
||||
InterpolatedRegularExpressionNode(280...293)(
|
||||
(280...281),
|
||||
[StringNode(281...285)(nil, (281...285), nil, "aaa "),
|
||||
EmbeddedStatementsNode(285...291)(
|
||||
(285...287),
|
||||
StatementsNode(287...290)(
|
||||
[CallNode(287...290)(
|
||||
nil,
|
||||
nil,
|
||||
(287...290),
|
||||
nil,
|
||||
nil,
|
||||
nil,
|
||||
nil,
|
||||
2,
|
||||
"bbb"
|
||||
)]
|
||||
),
|
||||
(290...291)
|
||||
)],
|
||||
(291...293),
|
||||
128
|
||||
)]
|
||||
)
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user