branch: elpa/swift-mode
commit 9e6c538a6b355c9ba2ec10995df60053c7357c9a
Author: ap4y <l...@pisem.net>
Commit: ap4y <l...@pisem.net>

    Correct DECSPEC regex and lexer rule
---
 swift-mode.el | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/swift-mode.el b/swift-mode.el
index 1666781..c8e2d42 100644
--- a/swift-mode.el
+++ b/swift-mode.el
@@ -203,8 +203,7 @@
                 "<<" ">>" "??")))
 
 (defvar swift-smie--decl-specifier-regexp
-  (rx (? (or "class" "mutating" "override" "static" "unowned" "weak"))
-      "(?=[[:space:]]*func)"))
+  
"\\(?1:class\\|mutating\\|override\\|static\\|unowned\\|weak\\)\\(?:[[:space:]]*func\\)")
 
 (defvar swift-smie--access-modifier-regexp
   (regexp-opt '("private" "public" "internal")))
@@ -250,7 +249,7 @@
     (goto-char (match-end 0)) "OP")
 
    ((looking-at swift-smie--decl-specifier-regexp)
-    (goto-char (match-end 0)) "DECSPEC")
+    (goto-char (match-end 1)) "DECSPEC")
 
    ((looking-at swift-smie--access-modifier-regexp)
     (goto-char (match-end 0)) "ACCESSMOD")
@@ -293,7 +292,7 @@
       (goto-char (match-beginning 0)) "OP")
 
      ((looking-back swift-smie--decl-specifier-regexp (- (point) 8) t)
-      (goto-char (match-beginning 0)) "DECSPEC")
+      (goto-char (match-beginning 1)) "DECSPEC")
 
      ((looking-back swift-smie--access-modifier-regexp (- (point) 8) t)
       (goto-char (match-beginning 0)) "ACCESSMOD")

Reply via email to