summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-07-23 10:03:30 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-07-23 10:03:30 +0000
commit65658ea0d4f17b90bb09003405a7560d6df0b58e (patch)
tree156fdae18505dc97515c157a5ca2bffcdd8482a1 /parse.y
parent2bcd502a71bc0a140f3b78ed0d148745fb648555 (diff)
* parse.y (rb_enc_symname_type): :$a!, @a! and so on are not
valid symbols, so they should be inspected with quotes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32639 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y2
1 files changed, 2 insertions, 0 deletions
diff --git a/parse.y b/parse.y
index 366090f903..315723287f 100644
--- a/parse.y
+++ b/parse.y
@@ -9758,10 +9758,12 @@ rb_enc_symname_type(const char *name, long len, rb_encoding *enc)
while (m < e && is_identchar(m, e, enc)) m += rb_enc_mbclen(m, e, enc);
switch (*m) {
case '!': case '?':
+ if (type == ID_GLOBAL || type == ID_CLASS || type == ID_INSTANCE) return -1;
type = ID_JUNK;
++m;
break;
case '=':
+ if (type != ID_CONST && type != ID_LOCAL) return -1;
type = ID_ATTRSET;
++m;
break;