Tweak the left precedence of '=>'

* lisp/progmodes/ruby-mode.el (ruby-smie-grammar): Tweak the left
precedence of '=>', to improve indentation and sexp navigation.
This commit is contained in:
Dmitry Gutov 2016-03-14 00:34:01 +02:00
parent 5b705bc97d
commit 9d463aec8b
2 changed files with 7 additions and 1 deletions

View file

@ -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))

View file

@ -415,6 +415,12 @@ def qux
foo(:bar =>
tee)
regions = foo(
OpenStruct.new(id: 0, name: "foo") => [
10
]
)
{'a' => {
'b' => 'c',
'd' => %w(e f)