branch: elpa/swift-mode
commit f39c05b05389896a16213d4fc0c0f0a107cbec91
Author: Chris Barrett <chris.d.barr...@me.com>
Commit: Chris Barrett <chris.d.barr...@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