[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/swift-mode 8e72839 004/496: Add basic syntax table
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/swift-mode 8e72839 004/496: Add basic syntax table |
Date: |
Sun, 29 Aug 2021 11:32:56 -0400 (EDT) |
branch: elpa/swift-mode
commit 8e72839f4c82bedbcbb0bf3682a5b7810a6ece31
Author: Chris Barrett <chris.d.barrett@me.com>
Commit: Chris Barrett <chris.d.barrett@me.com>
Add basic syntax table
---
swift-mode.el | 27 ++++++++++++++++++++++++++-
1 file changed, 26 insertions(+), 1 deletion(-)
diff --git a/swift-mode.el b/swift-mode.el
index 40de349..748a905 100644
--- a/swift-mode.el
+++ b/swift-mode.el
@@ -89,6 +89,27 @@
;; Mode definition.
+;; FIXME: Syntax table based on tuareg-mode. Not really tested.
+(defvar swift-mode-syntax-table
+ (let ((st (make-syntax-table)))
+ (modify-syntax-entry ?_ "_" st)
+ (modify-syntax-entry ?. "'" st) ; Make qualified names a single symbol.
+ (modify-syntax-entry ?? ". p" st)
+ (modify-syntax-entry ?& ". p" st)
+ (modify-syntax-entry ?! ". p" st)
+
+ (dolist (c '(?$ ?% ?+ ?- ?/ ?: ?< ?= ?> ?@ ?^ ?|))
+ (modify-syntax-entry c "." st))
+
+ (modify-syntax-entry ?' "_" st) ; ' is part of symbols (for primes).
+ (modify-syntax-entry ?\" "\"" st) ; " is a string delimiter
+ (modify-syntax-entry ?\\ "\\" st)
+ (modify-syntax-entry ?* ". 23" st)
+ (modify-syntax-entry ?\( "()1n" st)
+ (modify-syntax-entry ?\) ")(4n" st)
+ st)
+ "Syntax table for `swift-mode'.")
+
(defvar swift-mode-map
(let ((map (make-sparse-keymap)))
map)
@@ -99,7 +120,11 @@
\\<swift-mode-map>"
:group 'swift
- (setq-local font-lock-defaults swift-mode--font-lock-defaults))
+ (setq-local font-lock-defaults swift-mode--font-lock-defaults)
+ (setq-local comment-start "//")
+ (setq-local tab-width 4)
+ (setq-local indent-tabs-mode nil)
+ )
(provide 'swift-mode)
- [nongnu] branch elpa/swift-mode created (now 800efe2), ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 00001ea 009/496: Fix keywords list, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode e90cf5e 012/496: Set comment vars, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode f39c05b 013/496: Tweak comment syntax, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 592a33f 021/496: Copy syntax table from rust-mode., ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 142c7db 023/496: Merge pull request #7 from syohex/fix-for-older-emacs, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 90802b5 041/496: Use lexical scoping, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 8641ebc 048/496: Mention old-school installation method, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 8e72839 004/496: Add basic syntax table,
ELPA Syncer <=
- [nongnu] elpa/swift-mode 5274877 010/496: Add single-line comments to syntax table, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode d110515 011/496: Font lock tweaks, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 272473b 005/496: Remove currently unused mode map, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode cbb19f2 003/496: Add basic font-locking, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 7df8b6d 037/496: Remove dash.el dependency., ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 09b50fa 042/496: [Fix #12] Merge mode code in a single file, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode c882c70 053/496: Replace `if` exprs with `when` exprs, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode d136303 076/496: Adding support for Swift REPL via comint-mode, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode 286c4b8 077/496: Merge pull request #21 from ap4y/feature_repl, ELPA Syncer, 2021/08/29
- [nongnu] elpa/swift-mode e0fba71 083/496: repl -> REPL, ELPA Syncer, 2021/08/29