mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Add syntax error for incomplete instance/class variables
This commit is contained in:
+10
-1
@@ -4812,7 +4812,16 @@ parser_yylex(parser_state *p)
|
||||
tokadd(p, '@');
|
||||
c = nextc(p);
|
||||
}
|
||||
if (c != -1 && isdigit(c)) {
|
||||
if (c == -1) {
|
||||
if (p->bidx == 1) {
|
||||
yyerror(p, "incomplete instance variable syntax");
|
||||
}
|
||||
else {
|
||||
yyerror(p, "incomplete class variable syntax");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
else if (isdigit(c)) {
|
||||
if (p->bidx == 1) {
|
||||
yyerror_i(p, "`@%c' is not allowed as an instance variable name", c);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user