Bug #5136

:"!".inspect の結果が1.9.3devと1.9.2とでは異なる

Added by Ayumu AIZAWA about 4 years ago. Updated about 4 years ago.

[ruby-dev:44314]
Status:Closed
Priority:Normal
Assignee:-
ruby -v:ruby 1.9.3dev (2011-08-01 revision 32798) [x86_64-darwin10.8.0] Backport:

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

Associated revisions

Revision 32809
Added by Nobuyoshi Nakada about 4 years ago

  • parse.y (rb_enc_symname2_p): :! is valid symbol. [Bug #5136]

Revision 32809
Added by Nobuyoshi Nakada about 4 years ago

  • parse.y (rb_enc_symname2_p): :! is valid symbol. [Bug #5136]

History

#1 Updated by Nobuyoshi Nakada about 4 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]

Also available in: Atom PDF