[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/zig-mode fead48b 002/104: Initial revision.
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/zig-mode fead48b 002/104: Initial revision. |
Date: |
Sun, 29 Aug 2021 11:36:52 -0400 (EDT) |
branch: elpa/zig-mode
commit fead48b6369e538c1f4c2c98d45d2d26fe973329
Author: Andrea Orru <andreaorru1991@gmail.com>
Commit: Andrea Orru <andreaorru1991@gmail.com>
Initial revision.
---
zig-mode.el | 135 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 135 insertions(+)
diff --git a/zig-mode.el b/zig-mode.el
new file mode 100644
index 0000000..eaad3b0
--- /dev/null
+++ b/zig-mode.el
@@ -0,0 +1,135 @@
+;;; zig-mode.el --- A major mode for the Zig programming language -*-
lexical-binding: t -*-
+
+;; Version: 0.0.1
+;; Author: Andrea Orru <andreaorru1991@gmail.com>, Andrew Kelley
<superjoe30@gmail.com>
+;; Keywords: zig, languages
+;; Package-Requires: ((emacs "24.0"))
+;; URL: https://github.com/AndreaOrru/zig-mode
+
+;;; Commentary:
+;;
+
+;;; Code:
+(defvar zig-mode-builtins
+ '("@addWithOverflow"
+ "@alignOf"
+ "@alloca"
+ "@cDefine"
+ "@cImport"
+ "@cInclude"
+ "@cUndef"
+ "@canImplicitCast"
+ "@clz"
+ "@cmpxchg"
+ "@compileError"
+ "@compileLog"
+ "@compileVar"
+ "@ctz"
+ "@divExact"
+ "@embedFile"
+ "@errorName"
+ "@fence"
+ "@generatedCode"
+ "@import"
+ "@intType"
+ "@isFloat"
+ "@isInteger"
+ "@maxValue"
+ "@memberCount"
+ "@minValue"
+ "@mulWithOverflow"
+ "@setDebugSafety"
+ "@setGlobalAlign"
+ "@setGlobalLinkage"
+ "@setGlobalSection"
+ "@shlWithOverflow"
+ "@sizeOf"
+ "@subWithOverflow"
+ "@truncate"
+ "@typeName"
+ "@typeOf"
+ "@unreachable"))
+
+(defvar zig-mode-keywords
+ '("asm"
+ "break"
+ "coldcc"
+ "comptime"
+ "const"
+ "continue"
+ "defer"
+ "else"
+ "enum"
+ "export"
+ "extern"
+ "fn"
+ "for"
+ "goto"
+ "if"
+ "inline"
+ "nakedcc"
+ "noalias"
+ "packed"
+ "pub"
+ "return"
+ "struct"
+ "switch"
+ "try"
+ "union"
+ "unreachable"
+ "use"
+ "var"
+ "volatile"
+ "while"))
+
+(defvar zig-mode-constants
+ '("null"
+ "this"
+ "undefined"))
+
+(defvar zig-mode-types
+ '("Unreachable"
+ "bool"
+ "c_int"
+ "c_long"
+ "c_long_double"
+ "c_longlong"
+ "c_short"
+ "c_uint"
+ "c_ulong"
+ "c_ulonglong"
+ "c_ushort"
+ "error"
+ "f32"
+ "f64"
+ "i16"
+ "i32"
+ "i64"
+ "i8"
+ "isize"
+ "type"
+ "u16"
+ "u32"
+ "u64"
+ "u8"
+ "usize"
+ "void"
+ ))
+
+(defvar zig-mode-font-lock-keywords
+ `((,(regexp-opt zig-mode-keywords) . font-lock-keyword-face)
+ (,(regexp-opt zig-mode-builtins) . font-lock-builtin-face)
+ (,(regexp-opt zig-mode-constants) . font-lock-constant-face)
+ (,(regexp-opt zig-mode-types) . font-lock-type-face)))
+
+;;;###autoload
+(define-derived-mode zig-mode c-mode "Zig"
+ "A major mode for the Zig programming language."
+ :group 'zig-mode
+ (setq-local font-lock-defaults '(zig-mode-font-lock-keywords)))
+
+;;;###autoload
+(add-to-list 'auto-mode-alist '("\\.zig\\'" . zig-mode))
+
+(provide 'zig-mode)
+;;; zig-mode.el ends here
- [nongnu] elpa/zig-mode 3778fb5 030/104: Make indentation more nuanced (and add more tests for it), (continued)
- [nongnu] elpa/zig-mode 3778fb5 030/104: Make indentation more nuanced (and add more tests for it), ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode 9dc36e1 046/104: move defgroup and defcustom to the beginning of the code, ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode 4eafa60 050/104: colorize compilation buffer, ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode 107a67b 060/104: Runs `revert-buffer` after formatting on save., ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode b4ae21a 061/104: Merge pull request #26 from Saikyun/master, ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode 6309295 069/104: Hide the *zig-fmt* window when formatting succeeds again, ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode 1e75c04 100/104: Remove irrelevant comment, ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode 0babe7e 103/104: Merge pull request #59 from eric-p-hutchins/params-with-optionals-pointers-and-arrays-oh-my, ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode 2d0eb23 097/104: Merge pull request #55 from arqv/optim-mode, ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode 232bfff 010/104: Merge pull request #2 from syohex/fix-package, ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode fead48b 002/104: Initial revision.,
ELPA Syncer <=
- [nongnu] elpa/zig-mode c961a6d 005/104: noreturn., ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode 5b3b772 011/104: Removed hook., ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode fb8d52f 017/104: License., ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode 4f281e4 020/104: Changed repository location, ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode c5315ff 026/104: Apply font-lock-doc-face to doc comments (for issue #5), ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode c2deea8 037/104: Merge pull request #14 from mgxm/imenu, ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode 52e3e20 004/104: README., ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode bc1bed3 009/104: Fix package, ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode 1d26390 015/104: Merge pull request #3 from purcell/patch-1, ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode 0ed57d8 014/104: Minor fixes, ELPA Syncer, 2021/08/29