emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[nongnu] elpa/swift-mode 0f57a7d 179/496: Add lexer rule for ":" token.


From: ELPA Syncer
Subject: [nongnu] elpa/swift-mode 0f57a7d 179/496: Add lexer rule for ":" token.
Date: Sun, 29 Aug 2021 11:33:31 -0400 (EDT)

branch: elpa/swift-mode
commit 0f57a7dd058a7e834959ac773dc226e45929514f
Author: ap4y <lod@pisem.net>
Commit: ap4y <lod@pisem.net>

    Add lexer rule for ":" token.
    
    It's important in conjuctiontions with case statement. It's a common
    rule to connect ":" with a variable. In this case ":" will appear as a
    part of the identifier, we need this token separately to acivate grammar.
---
 swift-mode.el | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/swift-mode.el b/swift-mode.el
index 382c1a5..7efd717 100644
--- a/swift-mode.el
+++ b/swift-mode.el
@@ -212,6 +212,7 @@
    ((looking-at "}") (forward-char 1) "}")
 
    ((looking-at ",") (forward-char 1) ",")
+   ((looking-at ":") (forward-char 1) ":")
 
    ((looking-at "<") (forward-char 1)
     (if (looking-at "[[:upper:]]") "<T" "OP"))
@@ -245,6 +246,7 @@
      ((eq (char-before) ?\}) (backward-char 1) "}")
 
      ((eq (char-before) ?,) (backward-char 1) ",")
+     ((eq (char-before) ?:) (backward-char 1) ":")
 
      ((eq (char-before) ?<) (backward-char 1)
       (if (looking-at "<[[:upper:]]") "<T" "OP"))



reply via email to

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