branch: externals/sql-indent
commit 68e66af96229f60ed75536764250da5340e4bc7a
Merge: 102d31f d410084
Author: Alex Harsanyi <[email protected]>
Commit: Alex Harsanyi <[email protected]>

    Merge branch 'master' of github.com:alex-hhh/emacs-sql-indent
---
 sql-indent.el | 42 +++++++++++++++++++++++++++++++-----------
 1 file changed, 31 insertions(+), 11 deletions(-)

diff --git a/sql-indent.el b/sql-indent.el
index 5b91e59..b20e155 100644
--- a/sql-indent.el
+++ b/sql-indent.el
@@ -1800,21 +1800,41 @@ determine how to indent each type of syntactic element."
 ;;; alignment rules
 
 (defvar sqlind-align-rules
-  ;; Line up he two sides of an equal sign in an update expression
-  `((sql-update-lineup-equals
-     (regexp . , ".*?\\(\\s *\\)=\\(\\s *\\).*")
-     (modes . '(sql-mode))
-     (group . (1 2))
+  '(;; Line up the two side of arrow =>
+    (sql-arrow-lineup
+     (regexp . "\\(\\s-*\\)=>\\(\\s-*\\)")
+     (modes quote (sql-mode))
+     (group 1 2)
      (case-fold . t)
      (repeat . t))
-    ;; lineup the column aliases (the "as name" part) in a select statement
-    (sql-sqlect-lineup-column-names
-     (regexp . , ".*?\\(\\s +\\)as\\(\\s +\\).*")
-     (modes . '(sql-mode))
-     (group . (1 2))
+    ;; Line up the two sides of an assigment
+    (sql-assign-lineup
+     (regexp . "\\(\\s-*\\):=\\(\\s-*\\)")
+     (modes quote (sql-mode))
+     (group 1 2)
+     (case-fold . t)
+     (repeat . t))
+    ;; Line up the two sides of in / out / in out parameter
+    (sql-param-lineup-in-out
+     (regexp . "\\(\\s-+\\)\\(in out\\|in\\|out\\)\\(\\s-+\\)")
+     (modes quote (sql-mode))
+     (group 1 3)
      (case-fold . t)
      (repeat . t))
-    )
+    ;; Line up the two sides of an equal sign in an update expression
+    (sql-equals
+     (regexp . "\\(\\s-*[^:]\\)=\\([^>]\\s-*\\)")
+     (modes quote (sql-mode))
+     (group 1 2)
+     (case-fold . t)
+     (repeat . t))
+    ;; lineup the column aliases (the "as name" part) in a select statement
+    (sql-select-lineup-column-names
+     (regexp . ".*?\\(\\s +\\)as\\(\\s +\\).*")
+     (modes quote (sql-mode))
+     (group 1 2)
+     (case-fold . t)
+     (repeat . t)))
   "Align rules for SQL codes.
 
 These rules help aligning some SQL statements, such as the column

Reply via email to