qemacs-commit
[Top][All Lists]
Advanced

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

[Qemacs-commit] qemacs clang.c


From: Charlie Gordon
Subject: [Qemacs-commit] qemacs clang.c
Date: Sun, 05 Apr 2015 15:45:54 +0000

CVSROOT:        /sources/qemacs
Module name:    qemacs
Changes by:     Charlie Gordon <chqrlie>        15/04/05 15:45:54

Modified files:
        .              : clang.c 

Log message:
        added colorizer for metro-man Alloy language

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemacs/clang.c?cvsroot=qemacs&r1=1.80&r2=1.81

Patches:
Index: clang.c
===================================================================
RCS file: /sources/qemacs/qemacs/clang.c,v
retrieving revision 1.80
retrieving revision 1.81
diff -u -b -r1.80 -r1.81
--- clang.c     5 Apr 2015 15:10:02 -0000       1.80
+++ clang.c     5 Apr 2015 15:45:54 -0000       1.81
@@ -54,6 +54,7 @@
     CLANG_NEKO,
     CLANG_NML,
     CLANG_SWIFT,
+    CLANG_ALLOY,
     CLANG_FLAVOR = 0x3F,
 };
 
@@ -464,6 +465,17 @@
     "var|int|float|string|bool|char|void|"
 };
 
+static const char alloy_keywords[] = {
+    "if|else|do|for|loop|while|break|continue|match|return|use|"
+    "mut|_|true|false|"
+    "struct|enum|fn|func|self|impl"
+};
+
+static const char alloy_types[] = {
+    "void|bool|char|int|float|double|usize|string|"
+    "u8|u16|u32|u64|i8|i16|i32|i64|f64|f32|"
+};
+
 static const char c_extensions[] = {
     "c|h|i|C|H|I|"      /* C language */
     /* Other C flavors */
@@ -1910,6 +1922,19 @@
     .fallback = &c_mode,
 };
 
+ModeDef alloy_mode = {
+    .name = "Alloy",
+    .extensions = "ay",
+    .shell_handlers = NULL,
+    .colorize_func = c_colorize_line,
+    .colorize_flags = CLANG_ALLOY,
+    .keywords = alloy_keywords,
+    .types = alloy_types,
+    .indent_func = c_indent_line,
+    .auto_indent = 1,
+    .fallback = &c_mode,
+};
+
 #include "swift.c"
 
 static int c_init(void)
@@ -1954,6 +1979,7 @@
     qe_register_mode(&csl_mode, MODEF_SYNTAX);
     qe_register_mode(&neko_mode, MODEF_SYNTAX);
     qe_register_mode(&nml_mode, MODEF_SYNTAX);
+    qe_register_mode(&alloy_mode, MODEF_SYNTAX);
     swift_init();
 
     return 0;



reply via email to

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