Avoid syntax error regarding colons in the expression; fix
Reported and inspired by based on CRuby's `parse.y`.
MODIFY
mrbgems/mruby-compiler/core/parse.y
mrbgems/mruby-compiler/core/parse.y
@@ -5882,14 +5882,14 @@ parser_yylex(parser_state *p)
p->lstate = EXPR_BEG;
return tLABEL_TAG;
}
- if (!ISSPACE(c) || IS_BEG()) {
- pushback(p, c);
- p->lstate = EXPR_FNAME;
- return tSYMBEG;
- }
+ if (IS_END() || ISSPACE(c) || c == '#') {
pushback(p, c);
p->lstate = EXPR_BEG;
return ':';
+ }
+ pushback(p, c);
+ p->lstate = EXPR_FNAME;
+ return tSYMBEG;
case '/':
if (IS_BEG()) {

MODIFY
mrbgems/mruby-compiler/core/y.tab.c
mrbgems/mruby-compiler/core/y.tab.c
@@ -11883,14 +11883,14 @@ parser_yylex(parser_state *p)
p->lstate = EXPR_BEG;
return tLABEL_TAG;
}
- if (!ISSPACE(c) || IS_BEG()) {
- pushback(p, c);
- p->lstate = EXPR_FNAME;
- return tSYMBEG;
- }
+ if (IS_END() || ISSPACE(c) || c == '#') {
pushback(p, c);
p->lstate = EXPR_BEG;
return ':';
+ }
+ pushback(p, c);
+ p->lstate = EXPR_FNAME;
+ return tSYMBEG;
case '/':
if (IS_BEG()) {

Avoid syntax error regarding colons in the expression; fix #5290

Reported and inspired by @hasumikin; based on CRuby's `parse.y`.