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

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

[nongnu] elpa/swift-mode f39c05b 013/496: Tweak comment syntax


From: ELPA Syncer
Subject: [nongnu] elpa/swift-mode f39c05b 013/496: Tweak comment syntax
Date: Sun, 29 Aug 2021 11:32:58 -0400 (EDT)

branch: elpa/swift-mode
commit f39c05b05389896a16213d4fc0c0f0a107cbec91
Author: Chris Barrett <chris.d.barrett@me.com>
Commit: Chris Barrett <chris.d.barrett@me.com>

    Tweak comment syntax
---
 swift-mode.el | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/swift-mode.el b/swift-mode.el
index 69a9fdf..1e4fbf0 100644
--- a/swift-mode.el
+++ b/swift-mode.el
@@ -122,7 +122,8 @@
 
 ;; Mode definition.
 
-;; FIXME: Syntax table based on tuareg-mode. Not really tested.
+;; FIXME: Syntax table cobbled together from entries in tuareg-mode and
+;; fsharp-mode. Not really tested.
 (defvar swift-mode-syntax-table
   (let ((st (make-syntax-table)))
     (modify-syntax-entry ?_ "_" st)
@@ -130,8 +131,14 @@
     (modify-syntax-entry ?? ". p" st)
     (modify-syntax-entry ?& ". p" st)
     (modify-syntax-entry ?! ". p" st)
+
+    ;; C++-style comments (//)
     (modify-syntax-entry ?/ ". 12b" st)
     (modify-syntax-entry ?\n "> b" st)
+    ;; C-style comments (/* */)
+    (modify-syntax-entry ?/ "()1n" st)
+    (modify-syntax-entry ?*  ". 23n" st)
+    (modify-syntax-entry ?/ ")(4n" st)
 
     (dolist (c '(?$ ?% ?+ ?- ?/ ?: ?< ?= ?> ?@ ?^ ?|))
       (modify-syntax-entry c "." st))



reply via email to

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