summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2022-08-11 22:24:47 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2022-08-12 15:58:18 +0900
commit844a0edbae6e74293e3d0cb1ceeeb66a4371d06d (patch)
tree7e1652945a9a290633476d2dd8b09e5e8fa69025 /parse.y
parent803a07263001e5466bba0f53fcc85784f4b5c686 (diff)
[Bug #18962] Do not read again once reached EOF
`Ripper::Lexer#parse` re-parses the source code with syntax errors when `raise_errors: false`. Co-Authored-By: tompng <tomoyapenguin@gmail.com>
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/6233
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y1
1 files changed, 1 insertions, 0 deletions
diff --git a/parse.y b/parse.y
index b4c3106b8c..d0f37a18cc 100644
--- a/parse.y
+++ b/parse.y
@@ -9299,6 +9299,7 @@ parser_yylex(struct parser_params *p)
case '\004': /* ^D */
case '\032': /* ^Z */
case -1: /* end of script. */
+ p->eofp = 1;
return 0;
/* white spaces */