[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemacs-commit] qemacs qe.h lisp.c
From: |
Charlie Gordon |
Subject: |
[Qemacs-commit] qemacs qe.h lisp.c |
Date: |
Fri, 10 Jan 2014 01:09:26 +0000 |
CVSROOT: /sources/qemacs
Module name: qemacs
Changes by: Charlie Gordon <chqrlie> 14/01/10 01:09:26
Modified files:
. : qe.h lisp.c
Log message:
improve and publish lisp mode for recursive coloring
* publish lisp_mode for recursive coloring
* fix multi-line string coloring
* accept \" to escape quotes in strings
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemacs/qe.h?cvsroot=qemacs&r1=1.112&r2=1.113
http://cvs.savannah.gnu.org/viewcvs/qemacs/lisp.c?cvsroot=qemacs&r1=1.3&r2=1.4
Patches:
Index: qe.h
===================================================================
RCS file: /sources/qemacs/qemacs/qe.h,v
retrieving revision 1.112
retrieving revision 1.113
diff -u -b -r1.112 -r1.113
--- qe.h 8 Jan 2014 16:27:12 -0000 1.112
+++ qe.h 10 Jan 2014 01:09:26 -0000 1.113
@@ -1766,6 +1766,10 @@
void hex_write_char(EditState *s, int key);
+/* lisp.c */
+
+extern ModeDef lisp_mode;
+
/* list.c */
extern ModeDef list_mode;
Index: lisp.c
===================================================================
RCS file: /sources/qemacs/qemacs/lisp.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- lisp.c 5 Jan 2014 23:42:55 -0000 1.3
+++ lisp.c 10 Jan 2014 01:09:26 -0000 1.4
@@ -37,15 +37,24 @@
int colstate = *statep;
int i = 0, j = 0;
- if (colstate & IN_STRING)
- goto instring;
-
+ if (colstate & IN_STRING) {
+ for (j = i; j < n;) {
+ if (str[j] == '\\') {
+ j += 2;
+ } else
+ if (str[j++] == '"') {
+ colstate &= ~IN_STRING;
+ break;
+ }
+ }
+ set_color(str + i, str + j, LISP_STRING);
+ i = j;
+ }
if (colstate & IN_COMMENT) {
for (j = i; j < n; j++) {
- if (str[j] == '|'
- && str[j + 1] == '#') {
+ if (str[j] == '|' && str[j + 1] == '#') {
j += 2;
- colstate = 0;
+ colstate &= ~IN_COMMENT;
break;
}
}
@@ -61,12 +70,11 @@
case '#':
/* check for block comment */
if (str[i + 1] == '|') {
- colstate = IN_COMMENT;
+ colstate |= IN_COMMENT;
for (j = i + 2; j < n; j++) {
- if (str[j] == '|'
- && str[j + 1] == '#') {
+ if (str[j] == '|' && str[j + 1] == '#') {
j += 2;
- colstate = 0;
+ colstate &= ~IN_COMMENT;
break;
}
}
@@ -77,9 +85,8 @@
break;
case '"':
/* parse string const */
- for (j = i + 1; j < n;) {
- instring:
colstate |= IN_STRING;
+ for (j = i + 1; j < n;) {
if (str[j++] == '"') {
colstate &= ~IN_STRING;
break;
@@ -118,7 +125,7 @@
CMD_DEF_END,
};
-static ModeDef lisp_mode;
+ModeDef lisp_mode;
static int lisp_init(void)
{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Qemacs-commit] qemacs qe.h lisp.c,
Charlie Gordon <=