qemacs-commit
[Top][All Lists]
Advanced

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

[Qemacs-commit] qemacs Makefile clang.c markdown.c qe.h


From: Charlie Gordon
Subject: [Qemacs-commit] qemacs Makefile clang.c markdown.c qe.h
Date: Wed, 04 Jun 2014 23:59:10 +0000

CVSROOT:        /sources/qemacs
Module name:    qemacs
Changes by:     Charlie Gordon <chqrlie>        14/06/04 23:59:10

Modified files:
        .              : Makefile clang.c markdown.c qe.h 

Log message:
        add mode for Apple Swift language

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemacs/Makefile?cvsroot=qemacs&r1=1.69&r2=1.70
http://cvs.savannah.gnu.org/viewcvs/qemacs/clang.c?cvsroot=qemacs&r1=1.76&r2=1.77
http://cvs.savannah.gnu.org/viewcvs/qemacs/markdown.c?cvsroot=qemacs&r1=1.17&r2=1.18
http://cvs.savannah.gnu.org/viewcvs/qemacs/qe.h?cvsroot=qemacs&r1=1.181&r2=1.182

Patches:
Index: Makefile
===================================================================
RCS file: /sources/qemacs/qemacs/Makefile,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -b -r1.69 -r1.70
--- Makefile    1 Jun 2014 17:34:39 -0000       1.69
+++ Makefile    4 Jun 2014 23:59:09 -0000       1.70
@@ -236,12 +236,14 @@
 $(OBJS_DIR)/fbfrender.o: fbfrender.c fbfrender.h libfbf.h
 $(OBJS_DIR)/qe.o: qe.c parser.c qeconfig.h qfribidi.h variables.h
 $(OBJS_DIR)/qfribidi.o: qfribidi.c qfribidi.h
+$(OBJS_DIR)/clang.o: clang.c swift.c
 
 $(TOBJS_DIR)/cfb.o: cfb.c cfb.h fbfrender.h
 $(TOBJS_DIR)/charsetjis.o: charsetjis.c charsetjis.def
 $(TOBJS_DIR)/fbfrender.o: fbfrender.c fbfrender.h libfbf.h
 $(TOBJS_DIR)/qe.o: qe.c parser.c qeconfig.h qfribidi.h variables.h
 $(TOBJS_DIR)/qfribidi.o: qfribidi.c qfribidi.h
+$(TOBJS_DIR)/clang.o: clang.c swift.c
 
 $(OBJS_DIR)/%.o: %.c $(DEPENDS) Makefile
        $(echo) CC -c $<

Index: clang.c
===================================================================
RCS file: /sources/qemacs/qemacs/clang.c,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -b -r1.76 -r1.77
--- clang.c     1 Jun 2014 18:03:54 -0000       1.76
+++ clang.c     4 Jun 2014 23:59:09 -0000       1.77
@@ -49,6 +49,7 @@
     CLANG_QSCRIPT,
     CLANG_ELASTIC,
     CLANG_JED,
+    CLANG_SWIFT,
     CLANG_FLAVOR = 0x1F,
 };
 
@@ -510,7 +511,7 @@
     if (i >= n)
         goto the_end;
 
-    c = 0;      /* turn off stupid egcs-2.91.66 warning */
+    c = 0;
     style0 = style = C_STYLE_DEFAULT;
 
     if (state) {
@@ -623,7 +624,7 @@
                         i += 2;
                         level--;
                         if (level == 0) {
-                            state &= ~IN_C_COMMENT;
+                            state &= ~IN_C_COMMENT_D;
                             style = style0;
                             break;
                         }
@@ -870,7 +871,8 @@
         SET_COLOR1(str, start, style);
     }
  the_end:
-    if (state & (IN_C_COMMENT | IN_C_COMMENT1 | IN_C_PREPROCESS | 
+    if (state & (IN_C_COMMENT | IN_C_COMMENT1 | IN_C_COMMENT_D |
+                 IN_C_PREPROCESS | 
                  IN_C_STRING | IN_C_STRING_Q | IN_C_STRING_BQ)) {
         /* set style on eol char */
         SET_COLOR1(str, n, style);
@@ -1783,6 +1785,8 @@
     .fallback = &c_mode,
 };
 
+#include "swift.c"
+
 static int c_init(void)
 {
     const char *p;
@@ -1821,6 +1825,7 @@
     qe_register_mode(&qscript_mode, MODEF_SYNTAX);
     qe_register_mode(&ec_mode, MODEF_SYNTAX);
     qe_register_mode(&sl_mode, MODEF_SYNTAX);
+    swift_init();
 
     return 0;
 }

Index: markdown.c
===================================================================
RCS file: /sources/qemacs/qemacs/markdown.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -b -r1.17 -r1.18
--- markdown.c  1 Jun 2014 13:54:59 -0000       1.17
+++ markdown.c  4 Jun 2014 23:59:09 -0000       1.18
@@ -47,10 +47,12 @@
     IN_MKD_BLOCK      = 0x4000,
     IN_MKD_LANG       = 0x3800,
     IN_MKD_C          = 0x0800,
-    IN_MKD_PYTHON     = 0x1000,
-    IN_MKD_RUBY       = 0x1800,
-    IN_MKD_HASKELL    = 0x2000,
-    IN_MKD_LUA        = 0x2800,
+    IN_MKD_JAVA       = 0x1000,
+    IN_MKD_PYTHON     = 0x1800,
+    IN_MKD_RUBY       = 0x2000,
+    IN_MKD_HASKELL    = 0x2800,
+    IN_MKD_LUA        = 0x3000,
+    IN_MKD_SWIFT      = 0x3800,
     IN_MKD_LEVEL      = 0x0700,
 };
 
@@ -131,6 +133,9 @@
             case IN_MKD_C:
                 c_mode.colorize_func(cp, str, n, &c_mode);
                 break;
+            case IN_MKD_JAVA:
+                java_mode.colorize_func(cp, str, n, &java_mode);
+                break;
             case IN_MKD_PYTHON:
                 python_mode.colorize_func(cp, str, n, &python_mode);
                 break;
@@ -143,6 +148,9 @@
             case IN_MKD_LUA:
                 lua_mode.colorize_func(cp, str, n, &lua_mode);
                 break;
+            case IN_MKD_SWIFT:
+                swift_mode.colorize_func(cp, str, n, &swift_mode);
+                break;
             default:
                 SET_COLOR(str, i, n, MKD_STYLE_CODE);
                 break;
@@ -180,10 +188,12 @@
     ||  ustrstart(str + i, "```", NULL)) {
         /* verbatim block */
         colstate |= IN_MKD_BLOCK;
-        if (ustrstr(str + i + 3, "c")
-        ||  ustrstr(str + i + 3, "java")) {
+        if (ustrstr(str + i + 3, "c")) {
             colstate |= IN_MKD_C;
         } else
+        if (ustrstr(str + i + 3, "java")) {
+            colstate |= IN_MKD_JAVA;
+        } else
         if (ustrstr(str + i + 3, "haskell")) {
             colstate |= IN_MKD_HASKELL;
         } else
@@ -195,6 +205,9 @@
         } else
         if (ustrstr(str + i + 3, "ruby")) {
             colstate |= IN_MKD_RUBY;
+        } else
+        if (ustrstr(str + i + 3, "swift")) {
+            colstate |= IN_MKD_SWIFT;
         }
         i = n;
         SET_COLOR(str, start, i, MKD_STYLE_TILDE);

Index: qe.h
===================================================================
RCS file: /sources/qemacs/qemacs/qe.h,v
retrieving revision 1.181
retrieving revision 1.182
diff -u -b -r1.181 -r1.182
--- qe.h        1 Jun 2014 14:18:17 -0000       1.181
+++ qe.h        4 Jun 2014 23:59:10 -0000       1.182
@@ -1979,9 +1979,11 @@
 extern ModeDef c_mode;
 extern ModeDef cpp_mode;
 extern ModeDef js_mode;
+extern ModeDef java_mode;
 extern ModeDef php_mode;
 extern ModeDef csharp_mode;
 extern ModeDef css_mode;
+extern ModeDef swift_mode;
 extern ModeDef xml_mode;
 extern ModeDef htmlsrc_mode;
 extern ModeDef lua_mode;



reply via email to

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