Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance regexp to account for prism error messages #954

Merged
merged 1 commit into from
May 10, 2024
Merged

Conversation

kddnewton
Copy link
Contributor

Prism changes this error message slightly to provide more information. Currently:

$ ./ruby -c -e 'foo.;'
-e:1: syntax error, unexpected ';'
foo.;
./ruby: compile error (SyntaxError)
$ ./ruby --parser=prism -c -e 'foo.;'
./ruby: warning: The compiler based on the Prism parser is currently experimental and compatibility with the compiler based on parse.y is not yet complete. Please report any issues you find on the `ruby/prism` issue tracker.
./ruby: -e:1: syntax error found (SyntaxError)
> 1 | foo.;
    |     ^ unexpected ';'; expecting a message to send to the receiver
  2 | 

This is the only regexp that needs to change to get all of the CRuby/IRB tests passing with --parser=prism.

Copy link
Member

@st0012 st0012 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add a comment to explain the pattern for escape sequence?

lib/irb/ruby-lex.rb Outdated Show resolved Hide resolved
@st0012 st0012 merged commit e0c29be into master May 10, 2024
59 checks passed
@st0012 st0012 deleted the prism-tests branch May 10, 2024 09:39
matzbot pushed a commit to ruby/ruby that referenced this pull request May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants