Commit daedb2b9 authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto

Merge pull request #43 from unak/__end__

Support ``__END__'' as the mark of the end of a script (ISO Ruby).
parents c8048756 6db869c3
...@@ -4455,6 +4455,9 @@ parser_yylex(parser_state *p) ...@@ -4455,6 +4455,9 @@ parser_yylex(parser_state *p)
c = nextc(p); c = nextc(p);
if (c < 0) break; if (c < 0) break;
} while (identchar(c)); } 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]) { switch (tok(p)[0]) {
case '@': case '$': case '@': case '$':
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment