emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-25 9d463ae 3/3: Tweak the left precedence of '=>'


From: Dmitry Gutov
Subject: [Emacs-diffs] emacs-25 9d463ae 3/3: Tweak the left precedence of '=>'
Date: Sun, 13 Mar 2016 23:46:06 +0000

branch: emacs-25
commit 9d463aec8b3d848556bbe320c0cf8bd310528168
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>

    Tweak the left precedence of '=>'
    
    * lisp/progmodes/ruby-mode.el (ruby-smie-grammar): Tweak the left
    precedence of '=>', to improve indentation and sexp navigation.
---
 lisp/progmodes/ruby-mode.el |    2 +-
 test/indent/ruby.rb         |    6 ++++++
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el
index 9884b7e..1c9f0f4 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 941fffb..6ab814a 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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]