From: Urabe Shyouhei Date: 2009-07-23T03:51:58+09:00 Subject: [ruby-dev:38877] Re: [Backport #1183] Adding support for the new hash literal syntax 太古のメールに返信する上に-devに振るのですが、これできた気がします。test-allと かが一応通っていそうです。どんなもんでしょうか。 patchはredmineに貼ってあります。 Akinori MUSHA さんは書きました: > Backport #1183: Adding support for the new hash literal syntax > http://redmine.ruby-lang.org/issues/show/1183 > > Author: Akinori MUSHA > Status: Open, Priority: Normal > Assigned to: Akinori MUSHA, Category: core, Target version: Ruby 1.8.8 > > Attached is a patch for ruby_1_8 which adds support for the new literal syntax for hash and hash style arguments. > > However, there needs some more work to retain the use of colon in place of then/do, in order to keep backward compatibility, although it has been deprecated and dropped in 1.9. > > knu@daemon[1]% ruby-1.8.7 -ve 'if true: p(1); end' > ruby 1.8.7 (2008-11-11 patchlevel 73) [x86_64-freebsd7] > 1 > knu@daemon[1]% ruby-1.8 -ve 'if true: p(1); end' > ruby 1.8.7p5000 (2009-02-19 revision 22433) [x86_64-freebsd7] > -e:1: syntax error, unexpected tLABEL > if true: p(1); end > ^ > -e:1: syntax error, unexpected kEND, expecting $end > > > ---------------------------------------- > http://redmine.ruby-lang.org > > >