--- Begin Message ---
Subject: |
24.0.93; ruby-mode improperly handles symbols with keyword names in JS-style hashes |
Date: |
Sat, 11 Feb 2012 04:27:33 +0400 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 |
Ruby 1.9 introduced the new syntax for hashes:
{key1: value1, key2: value2}
which is synonymous to {:key1 => value1, :key2 => value2}
The latest ruby-mode highlights the keywords in the new-style hashes
properly, but fails to account for the case when the symbol's name is an
otherwise reserved keyword. Examples:
link_to("root", root_path, class: "pink")
before_filter :do_stuff, if: :not_busy?
announce("The end is near!", end: "2012-12-31")
In all examples, the symbol (class, if, end) is being highlighted as a
reserved keyword, and the indentation becomes broken on all lines below it.
There's a similar bug on the Ruby bug tracker:
http://bugs.ruby-lang.org/issues/5140
See attachment for the patch.
ruby-keyword-symbols-patch.diff
Description: Text document
--- End Message ---
--- Begin Message ---
Subject: |
Re: bug#10786: 24.0.93; ruby-mode improperly handles symbols with keyword names in JS-style hashes |
Date: |
Wed, 21 Mar 2012 14:33:28 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.94 (gnu/linux) |
Thanks, installed,
Stefan
--- End Message ---