diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-12-19 14:33:11 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-12-19 14:33:11 +0000 |
commit | 6df4e18914e9d3a4ad76b46df5cc6683ee38bf21 (patch) | |
tree | 581374f734f3d43d1b0659082af4b20248e7940e | |
parent | 47084e129c41ec05d8149f634b3d3ae09b38756d (diff) | |
download | ruby-6df4e18914e9d3a4ad76b46df5cc6683ee38bf21.tar.gz |
* parse.y (rb_symname_p): fixed wrong validation. [ruby-dev:28047]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9715 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | parse.y | 5 | ||||
-rw-r--r-- | test/ruby/test_symbol.rb | 27 |
3 files changed, 34 insertions, 2 deletions
@@ -1,10 +1,12 @@ -Mon Dec 19 23:30:59 2005 Nobuyoshi Nakada <nobu@ruby-lang.org> +Mon Dec 19 23:32:39 2005 Nobuyoshi Nakada <nobu@ruby-lang.org> * Makefile.in (XCFLAGS): separated as well as win32/Makefile.sub. * main.c (always_gc): dllimport is required for VC to import a DLL symbol. fixed: [ruby-dev:28051] + * parse.y (rb_symname_p): fixed wrong validation. [ruby-dev:28047] + Mon Dec 19 23:09:24 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp> * st.c: uses malloc instead of xmalloc to avoid GC. syck uses st_insert @@ -8360,7 +8360,9 @@ rb_symname_p(const char *name) break; case '>': - if (*++m == '>') ++m; + switch (*++m) { + case '>': case '=': ++m; break; + } break; case '=': @@ -8380,6 +8382,7 @@ rb_symname_p(const char *name) break; case '|': case '^': case '&': case '/': case '%': case '~': case '`': + ++m; break; case '[': diff --git a/test/ruby/test_symbol.rb b/test/ruby/test_symbol.rb index b6dd203596..2ccfe64c92 100644 --- a/test/ruby/test_symbol.rb +++ b/test/ruby/test_symbol.rb @@ -29,6 +29,33 @@ class TestSymbol < Test::Unit::TestCase assert_inspect_evaled(':foo') assert_inspect_evaled(':foo!') assert_inspect_evaled(':bar?') + assert_inspect_evaled(':<<') + assert_inspect_evaled(':>>') + assert_inspect_evaled(':<=') + assert_inspect_evaled(':>=') + assert_inspect_evaled(':=~') + assert_inspect_evaled(':==') + assert_inspect_evaled(':===') + assert_raise(SyntaxError) {eval ':='} + assert_inspect_evaled(':*') + assert_inspect_evaled(':**') + assert_raise(SyntaxError) {eval ':***'} + assert_inspect_evaled(':+') + assert_inspect_evaled(':-') + assert_inspect_evaled(':+@') + assert_inspect_evaled(':-@') + assert_inspect_evaled(':|') + assert_inspect_evaled(':^') + assert_inspect_evaled(':&') + assert_inspect_evaled(':/') + assert_inspect_evaled(':%') + assert_inspect_evaled(':~') + assert_inspect_evaled(':`') + assert_inspect_evaled(':[]') + assert_inspect_evaled(':[]=') + assert_raise(SyntaxError) {eval ':||'} + assert_raise(SyntaxError) {eval ':&&'} + assert_raise(SyntaxError) {eval ':['} end def test_inspect_dollar |