]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/progmodes/ruby-mode.el (ruby-smie--args-separator-p): Handle
authorDmitry Gutov <dgutov@yandex.ru>
Mon, 14 Oct 2013 01:51:20 +0000 (04:51 +0300)
committerDmitry Gutov <dgutov@yandex.ru>
Mon, 14 Oct 2013 01:51:20 +0000 (04:51 +0300)
methods ending with `?' and `!'.

* test/indent/ruby.rb: More examples for bug#15594, both failing and
now passing.

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

index 9410366f0c2dd77b7f3a8f164f16232cbea81719..120fbb197eb52efe6d52692b77200a42589ebefe 100644 (file)
@@ -1,3 +1,8 @@
+2013-10-14  Dmitry Gutov  <dgutov@yandex.ru>
+
+       * progmodes/ruby-mode.el (ruby-smie--args-separator-p): Handle
+       methods ending with `?' and `!'.
+
 2013-10-14  Akinori MUSHA  <knu@iDaemons.org>
 
        * progmodes/ruby-mode.el (ruby-encoding-map): Add a mapping from
index 3441c35de35c7f1a534986060cd8bcd68c255911..a29540ad3a3dfd6b7bf19f0797bcd0cf85ed343f 100644 (file)
@@ -327,7 +327,9 @@ explicitly declared in magic comment."
 
 (defun ruby-smie--args-separator-p (pos)
   (and
-   (eq ?w (char-syntax (char-before)))
+   (or (eq (char-syntax (preceding-char)) '?w)
+       (and (memq (preceding-char) '(?! ??))
+            (eq (char-syntax (char-before (1- (point)))) '?w)))
    (< pos (point-max))
    (memq (char-syntax (char-after pos)) '(?w ?\"))))
 
index 7e8405e3676ba108b7abec7ec45a38dd6d9f0e06..2f99c003c590373171731954f34da42717e7a034 100644 (file)
@@ -1,3 +1,8 @@
+2013-10-14  Dmitry Gutov  <dgutov@yandex.ru>
+
+       * indent/ruby.rb: More examples for bug#15594, both failing and
+       now passing.
+
 2013-10-11  Dmitry Gutov  <dgutov@yandex.ru>
 
        * indent/ruby.rb: Add two more cases.
index 67584c01c7af9d0065c618c45203041cbd16c722..912648378c36cd45fc438dde9a06838758d9c392 100644 (file)
@@ -155,6 +155,16 @@ if foo?
   bar
 end
 
+method arg1,                   # bug#15594
+       method2 arg2,
+               arg3
+
+method? arg1,
+        arg2
+
+method! arg1,
+        arg2
+
 # Examples below still fail with `ruby-use-smie' on:
 
 foo +
@@ -171,6 +181,17 @@ if foo &&
     bar
 end
 
-method1 arg1,                   # bug#15594
-        method2 arg2,
-                arg3
+method !arg1,
+        arg2
+
+method [],
+       arg2
+
+method {:a => 1, :b => 2},
+       arg2
+
+method :foo,
+       :bar
+
+method (a + b),
+       c