whitequark / parser

A Ruby parser.
Other
1.59k stars 199 forks source link

Catch encoding errors when parsing invalid encoding regexp #1033

Closed Earlopain closed 3 months ago

Earlopain commented 3 months ago

This errors when trying to set the regexp source string to binary.

prism parser logic: https://github.com/ruby/prism/blob/89c22f0e6cbe7aac81c789ca35786a9a97afcb57/src/prism.c#L7169-L7198 (whew, quite complicated)

Closes #1032

iliabylich commented 3 months ago

Thanks a lot!

iliabylich commented 3 months ago

Ah, do you need a release?

Earlopain commented 3 months ago

I don't, no. It was for a pr in rubocop-ast (https://github.com/rubocop/rubocop-ast/pull/305), let's check with @r7kamura instead. Thanks for asking!