]> code.delx.au - gnu-emacs/commitdiff
Tweak the left precedence of '=>'
authorDmitry Gutov <dgutov@yandex.ru>
Sun, 13 Mar 2016 22:34:01 +0000 (00:34 +0200)
committerDmitry Gutov <dgutov@yandex.ru>
Sun, 13 Mar 2016 23:45:01 +0000 (01:45 +0200)
* lisp/progmodes/ruby-mode.el (ruby-smie-grammar): Tweak the left
precedence of '=>', to improve indentation and sexp navigation.

lisp/progmodes/ruby-mode.el
test/indent/ruby.rb

index 9884b7e1ac1f6ce6e3bee84f8d05bbfcacc58f92..1c9f0f43086fab4e9479524c6f5a4edeefc0f724 100644 (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))
index 941fffb2209a31cabdd58f706b2456895820f4d5..6ab814a4214327774f2e37f9686ac85f16402fbb 100644 (file)
@@ -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)