summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-02-04 05:51:21 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-02-04 05:51:21 +0000
commitd739fc5a77cc4e5837c181c4cbd875fc22ad000b (patch)
treeac0ba2c82a78fbdd4068bf2fe484b0d700e2e0ab
parent00f34f92741b4092a5f53afff0b9f01679325247 (diff)
* trunk/parse.y (rb_enc_symname2_p): support "!", "!=" and "!~".
[ruby-dev:33592] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--parse.y10
2 files changed, 14 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 50509f77ce..4e49b69543 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Mon Feb 4 14:51:19 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * trunk/parse.y (rb_enc_symname2_p): support "!", "!=" and "!~".
+ [ruby-dev:33592]
+
Mon Feb 4 13:58:42 2008 NAKAMURA Usaku <usa@ruby-lang.org>
* lib/delegate.rb (Delegator.preserved, DelegateClass.methods): extend
diff --git a/parse.y b/parse.y
index 377b8e9f23..39cd51df9d 100644
--- a/parse.y
+++ b/parse.y
@@ -8906,11 +8906,19 @@ rb_enc_symname2_p(const char *name, int len, rb_encoding *enc)
if (*++m == '=') ++m;
break;
+ case '!':
+ switch (*++m) {
+ case '\0': return Qtrue;
+ case '=': case '~': ++m; break;
+ default: return Qfalse;
+ }
+ break;
+
default:
localid = !rb_enc_isupper(*m, enc);
id:
if (m >= e || (*m != '_' && !rb_enc_isalpha(*m, enc) && ISASCII(*m)))
- return Qfalse;
+ return Qfalse;
while (m < e && is_identchar(m, e, enc)) m += rb_enc_mbclen(m, e, enc);
if (localid) {
switch (*m) {