Bug #5136
closed:"!".inspect の結果が1.9.3devと1.9.2とでは異なる
Description
=begin
(({:"!".inspect})) とか (({:!.inspect})) の結果が1.9.3devと1.9.2 では異なるようです。
$ bin/ruby -v -e 'puts :!.inspect'
ruby 1.9.3dev (2011-08-01 revision 32798) [x86_64-darwin10.8.0]
:"!"
$ ruby -v -e 'puts :"!".inspect'
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-darwin10.6.0]
:!
$ bin/ruby -v -e 'puts :!.inspect'
ruby 1.9.3dev (2011-08-01 revision 32798) [x86_64-darwin10.8.0]
:"!"
$ ruby -v -e 'puts :!.inspect'
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-darwin10.6.0]
:!
ちなみに 1.8.7 では以下の通り、前者は1.9.3devと同じ出力で、後者はSyntaxError となります。
$ ruby -v -e 'puts :"!".inspect'
ruby 1.8.7 (2011-02-18 patchlevel 334) [i686-darwin10.6.0]
:"!"
$ ruby -v -e 'puts :!.inspect'
ruby 1.8.7 (2011-02-18 patchlevel 334) [i686-darwin10.6.0]
-e:1: syntax error, unexpected '!', expecting tSTRING_CONTENT or tSTRING_DBEG or tSTRING_DVAR or tSTRING_END
puts :!.inspect
^
=end
Updated by nobu (Nobuyoshi Nakada) over 13 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
This issue was solved with changeset r32809.
Ayumu, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
- parse.y (rb_enc_symname2_p): :! is valid symbol. [Bug #5136]