Skip to content

Commit 69d0a3b

Browse files
kddnewtonst0012
authored andcommitted
[ruby/irb] Simplify regexp to account for prism error messages
(ruby/irb#954) ruby/irb@e0c29be074 Co-authored-by: Stan Lo <[email protected]>
1 parent 2f915e7 commit 69d0a3b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/irb/ruby-lex.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ def check_code_syntax(code, local_variables:)
230230
# example:
231231
# '
232232
return :recoverable_error
233-
when /syntax error, unexpected end-of-input/
233+
when /unexpected end-of-input/
234234
# "syntax error, unexpected end-of-input, expecting keyword_end"
235235
#
236236
# example:
@@ -240,7 +240,7 @@ def check_code_syntax(code, local_variables:)
240240
# fuga
241241
# end
242242
return :recoverable_error
243-
when /syntax error, unexpected keyword_end/
243+
when /unexpected keyword_end/
244244
# "syntax error, unexpected keyword_end"
245245
#
246246
# example:
@@ -250,7 +250,7 @@ def check_code_syntax(code, local_variables:)
250250
# example:
251251
# end
252252
return :unrecoverable_error
253-
when /syntax error, unexpected '\.'/
253+
when /unexpected '\.'/
254254
# "syntax error, unexpected '.'"
255255
#
256256
# example:

0 commit comments

Comments
 (0)