diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-07-23 10:03:30 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-07-23 10:03:30 +0000 |
commit | 65658ea0d4f17b90bb09003405a7560d6df0b58e (patch) | |
tree | 156fdae18505dc97515c157a5ca2bffcdd8482a1 /parse.y | |
parent | 2bcd502a71bc0a140f3b78ed0d148745fb648555 (diff) | |
download | ruby-65658ea0d4f17b90bb09003405a7560d6df0b58e.tar.gz |
* 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.y | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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; |