diff options
-rw-r--r-- | parse.y | 14 | ||||
-rw-r--r-- | test/ruby/test_continuation.rb | 14 |
2 files changed, 10 insertions, 18 deletions
@@ -7162,11 +7162,17 @@ parser_yylex(struct parser_params *parser) if (tokadd_mbchar(c) == -1) return 0; c = nextc(); } while (parser_is_identchar()); - if ((c == '!' || c == '?') && !peek('=')) { - tokadd(c); - } - else { + switch (tok()[0]) { + case '@': case '$': pushback(c); + break; + default: + if ((c == '!' || c == '?') && !peek('=')) { + tokadd(c); + } + else { + pushback(c); + } } tokfix(); diff --git a/test/ruby/test_continuation.rb b/test/ruby/test_continuation.rb index 272599650..09787c158 100644 --- a/test/ruby/test_continuation.rb +++ b/test/ruby/test_continuation.rb @@ -51,19 +51,5 @@ class TestContinuation < Test::Unit::TestCase c.call } end - - def test_sort - assert_normal_exit(<<-'End') - require 'continuation' - n = 1000 - ary = (1..100).to_a - ary.sort! {|a,b| - callcc {|k| $k = k } if !defined? $k - a <=> b - } - n -= 1 - $k.call if 0 < n - End - end end |