mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Merge pull request #1138 from h2so5/syntax-error-for-incomplete-global-variable
Add syntax error for incomplete global variables
This commit is contained in:
@@ -4726,6 +4726,10 @@ parser_yylex(parser_state *p)
|
||||
p->lstate = EXPR_END;
|
||||
token_column = newtok(p);
|
||||
c = nextc(p);
|
||||
if (c == -1) {
|
||||
yyerror(p, "incomplete global variable syntax");
|
||||
return 0;
|
||||
}
|
||||
switch (c) {
|
||||
case '_': /* $_: last read line string */
|
||||
c = nextc(p);
|
||||
|
||||
Reference in New Issue
Block a user