Skip to content

Conversation

@tompng
Copy link
Member

@tompng tompng commented Jun 28, 2023

No description provided.

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.

5 less pends, this is awesome 🎉

@st0012
Copy link
Member

st0012 commented Jun 28, 2023

cc @nirvdrum

@st0012 st0012 merged commit b7b0717 into ruby:master Jun 28, 2023
matzbot pushed a commit to ruby/ruby that referenced this pull request Jun 28, 2023
@tompng tompng deleted the reduce_pend_truffleruby branch June 28, 2023 17:59
@tompng
Copy link
Member Author

tompng commented Jun 28, 2023

The pended test was failing before mostly because the error message of SyntaxError is different in truffleruby.
IRB uses SyntaxError#message to check the code termination by Regexp.

irb/lib/irb/ruby-lex.rb

Lines 304 to 318 in 6269138

rescue SyntaxError => e
case e.message
when /unterminated (?:string|regexp) meets end of file/
# "unterminated regexp meets end of file"
#
# example:
# /
#
# "unterminated string meets end of file"
#
# example:
# '
return :recoverable_error
when /syntax error, unexpected end-of-input/
# "syntax error, unexpected end-of-input, expecting keyword_end"

In the recent refactor, IRB's reliance to SyntaxError#message is reduced.
In show-source command, it is changed to only check if the code is syntax valid or not.
This is why these pend can be removed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants