Closed koic closed 2 months ago
Haven't checked it yet, but looks like in the first example it's a post-rescue (like in foo rescue bar
) while in the other the delimiter makes it a begin; rescue; end
thing. The former can't have a list of errors, the latter can, thus there's an array
node.
foo do next unless (bar rescue StandardError); end
# vs
foo do
next unless bar;
rescue StandardError;
end
Ah, it was my misunderstanding. Thank you for the detailed explanation!
There is an incompatibility with the AST parsing in the Parser gem.
Without a semicolon before
rescue
:With a semicolon before
rescue
:Expected
I expect both examples to generate the same AST as the one without a semicolon before
rescue
.Actual
An unexpected array node is generated in the example with a semicolon before
rescue
.