summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-07-11 08:27:06 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-07-11 08:27:06 +0000
commit960676a2de16f046be01f0ef54ec4efe93ce612d (patch)
treed535e0e4be365713092f94d9e0a2f8c4043e8062 /parse.y
parentdf803a57a903c7e005af218ca470c5241e1b38d0 (diff)
matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@825 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y7
1 files changed, 5 insertions, 2 deletions
diff --git a/parse.y b/parse.y
index 615519a908b..eb9c5e61981 100644
--- a/parse.y
+++ b/parse.y
@@ -3432,6 +3432,9 @@ yylex()
tokadd('@');
c = nextc();
}
+ if (ISDIGIT(c)) {
+ rb_compile_error("`@%c' is not a valid instance variable name", c);
+ }
if (!is_identchar(c)) {
pushback(c);
return '@';
@@ -3439,8 +3442,8 @@ yylex()
break;
default:
- if (c != '_' && !ISALPHA(c) && !ismbchar(c)) {
- rb_compile_error("Invalid char '%c' in expression", c);
+ if (!is_identchar(c) || ISDIGIT(c)) {
+ rb_compile_error("Invalid char '%c'(%03o) in expression", c, c);
goto retry;
}