Skip to content

Commit

Permalink
Simplify regexp to account for prism error messages (#954)
Browse files Browse the repository at this point in the history
Co-authored-by: Stan Lo <[email protected]>
  • Loading branch information
kddnewton and st0012 authored May 10, 2024
1 parent 66318d0 commit e0c29be
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/irb/ruby-lex.rb
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ def check_code_syntax(code, local_variables:)
# example:
# '
return :recoverable_error
when /syntax error, unexpected end-of-input/
when /unexpected end-of-input/
# "syntax error, unexpected end-of-input, expecting keyword_end"
#
# example:
Expand All @@ -240,7 +240,7 @@ def check_code_syntax(code, local_variables:)
# fuga
# end
return :recoverable_error
when /syntax error, unexpected keyword_end/
when /unexpected keyword_end/
# "syntax error, unexpected keyword_end"
#
# example:
Expand All @@ -250,7 +250,7 @@ def check_code_syntax(code, local_variables:)
# example:
# end
return :unrecoverable_error
when /syntax error, unexpected '\.'/
when /unexpected '\.'/
# "syntax error, unexpected '.'"
#
# example:
Expand Down

0 comments on commit e0c29be

Please sign in to comment.