-
Notifications
You must be signed in to change notification settings - Fork 176
Open
Labels
bugSomething isn't workingSomething isn't working
Description
For example:
/\u{21!3}/$ ruby -c test.rb
Syntax OK
$ ruby --parser=parse.y -c test.rb
ruby: test.rb:1: invalid Unicode list: /\u{21!3}/ (SyntaxError)Prism knows this is invalid but intentionally ignores the error:
Lines 9810 to 9814 in 3340d87
| if (flags & PM_ESCAPE_FLAG_REGEXP) { | |
| // If this is a regular expression, we are going to | |
| // let the regular expression engine handle this | |
| // error instead of us. | |
| pm_buffer_append_bytes(regular_expression_buffer, start, (size_t) (parser->current.end - start)); |
This is because this regex is valid (invalid escape after comment in extended mode):
/# \u{21!3}/xAt runtime everything is right but it would be nice to also report this at parse-time.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working