emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r116233: Fix bug#16609


From: Dmitry Gutov
Subject: [Emacs-diffs] trunk r116233: Fix bug#16609
Date: Sat, 01 Feb 2014 14:55:12 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 116233
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/16609
committer: Dmitry Gutov <address@hidden>
branch nick: trunk
timestamp: Sat 2014-02-01 16:54:58 +0200
message:
  Fix bug#16609
  
  * lisp/progmodes/ruby-mode.el (ruby-smie--implicit-semi-p): Check for
  `:' before binary operators.  Don't check for `:'
  before `[' and `(', or their syntax status.  A percent literal
  can't end with either.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/progmodes/ruby-mode.el    
rubymode.el-20091113204419-o5vbwnq5f7feedwu-8804
  test/indent/ruby.rb            ruby.rb-20120424165921-h044139hbrd7snvw-1
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-02-01 07:55:57 +0000
+++ b/lisp/ChangeLog    2014-02-01 14:54:58 +0000
@@ -1,3 +1,10 @@
+2014-02-01  Dmitry Gutov  <address@hidden>
+
+       * progmodes/ruby-mode.el (ruby-smie--implicit-semi-p): Check for
+       `:' before binary operators (bug#16609).  Don't check for `:'
+       before `[' and `(', or their syntax status.  A percent literal
+       can't end with either.
+
 2014-02-01  Lars Ingebrigtsen  <address@hidden>
 
        * subr.el (butlast): Document what an omitted N means (bug#13437).

=== modified file 'lisp/progmodes/ruby-mode.el'
--- a/lisp/progmodes/ruby-mode.el       2014-01-31 17:33:12 +0000
+++ b/lisp/progmodes/ruby-mode.el       2014-02-01 14:54:58 +0000
@@ -422,14 +422,17 @@
   (save-excursion
     (skip-chars-backward " \t")
     (not (or (bolp)
+             (memq (char-before) '(?\[ ?\())
              (and (memq (char-before)
-                        '(?\; ?- ?+ ?* ?/ ?: ?. ?, ?\[ ?\( ?\\ ?& ?> ?< ?%
-                          ?~ ?^))
+                        '(?\; ?- ?+ ?* ?/ ?: ?. ?, ?\\ ?& ?> ?< ?% ?~ ?^))
+                  ;; Not a binary operator symbol.
+                  (not (eq (char-before (1- (point))) ?:))
                   ;; Not the end of a regexp or a percent literal.
                   (not (memq (car (syntax-after (1- (point)))) '(7 15))))
              (and (eq (char-before) ?\?)
                   (equal (save-excursion (ruby-smie--backward-token)) "?"))
              (and (eq (char-before) ?=)
+                  ;; Not a symbol :==, :!=, or a foo= method.
                   (string-match "\\`\\s." (save-excursion
                                             (ruby-smie--backward-token))))
              (and (eq (char-before) ?|)

=== modified file 'test/indent/ruby.rb'
--- a/test/indent/ruby.rb       2014-01-31 17:13:49 +0000
+++ b/test/indent/ruby.rb       2014-02-01 14:54:58 +0000
@@ -135,6 +135,13 @@
 # Bug#15208
 if something == :==
   do_something
+
+  return false unless method == :+
+  x = y + z # Bug#16609
+
+  a = 1 ? 2 :(
+    2 + 3
+  )
 end
 
 # Example from http://www.ruby-doc.org/docs/ProgrammingRuby/html/language.html


reply via email to

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