For example:
$ 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:
|
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):
At runtime everything is right but it would be nice to also report this at parse-time.
For example:
Prism knows this is invalid but intentionally ignores the error:
prism/src/prism.c
Lines 9810 to 9814 in 3340d87
This is because this regex is valid (invalid escape after comment in extended mode):
At runtime everything is right but it would be nice to also report this at parse-time.