Actions
Bug #18988
closedRipper cannot parse some code that has regexp named capture
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.2.0dev (2022-08-29T15:47:09Z :detached: cd7506593a) [x86_64-linux]
Description
Ripper does not seems to recognize regexp named capture defining new local variables, fails to parse some code.
requie 'ripper'
# expect syntax ok, got syntax error
Ripper.sexp("/(?<a>)/ =~ ''; x = a **a, a if false")
# expect syntax error, got syntax ok
Ripper.sexp("/(?<a>)/ =~ ''; x = a **a, **a if false")
# "exit" is a method call, got string_literal
Ripper.sexp("/(?<a>)/ =~ ''; a %(exit)")
Actions
Like0
Like0Like0Like0