mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Merge pull request #43 from unak/__end__
Support ``__END__'' as the mark of the end of a script (ISO Ruby).
This commit is contained in:
@@ -4455,6 +4455,9 @@ parser_yylex(parser_state *p)
|
||||
c = nextc(p);
|
||||
if (c < 0) break;
|
||||
} while (identchar(c));
|
||||
if (p->column == 0 && p->bidx == 7 && (c < 0 || c == '\n') &&
|
||||
strncmp(tok(p), "__END__", p->bidx) == 0)
|
||||
return -1;
|
||||
|
||||
switch (tok(p)[0]) {
|
||||
case '@': case '$':
|
||||
|
||||
Reference in New Issue
Block a user