Closed Earlopain closed 1 month ago
This seems very odd that you would explicitly want an encoding error, as opposed to going through the normal diagnostics flow. @koic is this desired behavior here?
On second thought, you are right. I should have reported this to the parser gem instead, emulating this behaviour doesn't make much sense.
With plain
parser
, the following raises an error:Prism translation seems to ignore the
n
flag (but returns no ast):There's an open issue in
rubocop-ast
for this to not raise during parsing (https://github.com/rubocop/rubocop-ast/pull/305) but still a behaviour difference.parser
has the following code to construct a regexp. Maybe it just needs to be emulated? https://github.com/whitequark/parser/blob/570e06520b81a107948d10fadaea89bd612b9a8d/lib/parser/builders/default.rb#L2249-L2267