From: Dmitry Gutov Date: Sun, 13 Mar 2016 22:34:01 +0000 (+0200) Subject: Tweak the left precedence of '=>' X-Git-Tag: emacs-25.0.93~89^2~75 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9d463ae;p=emacs.git Tweak the left precedence of '=>' * lisp/progmodes/ruby-mode.el (ruby-smie-grammar): Tweak the left precedence of '=>', to improve indentation and sexp navigation. --- diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index 9884b7e1ac1..1c9f0f43086 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el @@ -388,7 +388,7 @@ It is used when `ruby-encoding-magic-comment-style' is set to `custom'." (cases (exp "then" insts) (cases "when" cases) (insts "else" insts)) (expseq (exp) );;(expseq "," expseq) - (hashvals (id "=>" exp1) (hashvals "," hashvals)) + (hashvals (exp1 "=>" exp1) (hashvals "," hashvals)) (insts-rescue-insts (insts) (insts-rescue-insts "rescue" insts-rescue-insts) (insts-rescue-insts "ensure" insts-rescue-insts)) diff --git a/test/indent/ruby.rb b/test/indent/ruby.rb index 941fffb2209..6ab814a4214 100644 --- a/test/indent/ruby.rb +++ b/test/indent/ruby.rb @@ -415,6 +415,12 @@ foo(bar: foo(:bar => tee) +regions = foo( + OpenStruct.new(id: 0, name: "foo") => [ + 10 + ] +) + {'a' => { 'b' => 'c', 'd' => %w(e f)