|
|
|
|
@ -15,128 +15,3 @@ Index: tcap.h
|
|
|
|
|
|
|
|
|
|
#ifdef NEED_CURSES_H
|
|
|
|
|
# ifdef HAVE_NCURSESW_NCURSES_H
|
|
|
|
|
Index: filters/dcl-filt.l
|
|
|
|
|
--- filters/dcl-filt.l.orig 2004-11-01 09:42:08 +0100
|
|
|
|
|
+++ filters/dcl-filt.l 2004-11-01 09:42:47 +0100
|
|
|
|
|
@@ -37,59 +37,9 @@
|
|
|
|
|
|
|
|
|
|
static char *look_for = 0;
|
|
|
|
|
|
|
|
|
|
-static void
|
|
|
|
|
-handle_ident(char *text, int length)
|
|
|
|
|
-{
|
|
|
|
|
- char *attr = ci_keyword_attr(text);
|
|
|
|
|
- char *temp = lowercase_of(text);
|
|
|
|
|
- flt_puts(text, length, attr);
|
|
|
|
|
- if (!strcmp(temp, "deck")) {
|
|
|
|
|
- /* FIXME: "DECK" can also have an option /dollars whose value would
|
|
|
|
|
- * be the actual string to search for.
|
|
|
|
|
- */
|
|
|
|
|
- look_for = "eod";
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-static void
|
|
|
|
|
-handle_newline(void)
|
|
|
|
|
-{
|
|
|
|
|
- flt_putc('\n');
|
|
|
|
|
- if (look_for != 0) {
|
|
|
|
|
- BEGIN(LITERAL);
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-static void
|
|
|
|
|
-handle_literal(char *text, int length)
|
|
|
|
|
-{
|
|
|
|
|
- int dollars = 0;
|
|
|
|
|
-
|
|
|
|
|
- if (*text == '$') {
|
|
|
|
|
- flt_puts(text, 1, Comment_attr);
|
|
|
|
|
- ++text;
|
|
|
|
|
- --length;
|
|
|
|
|
- dollars = 1;
|
|
|
|
|
- }
|
|
|
|
|
- while (length > 0 && isspace(CharOf(*text))) {
|
|
|
|
|
- flt_putc(*text);
|
|
|
|
|
- ++text;
|
|
|
|
|
- --length;
|
|
|
|
|
- }
|
|
|
|
|
- if (length > 0) {
|
|
|
|
|
- char *attr = String_attr;
|
|
|
|
|
-
|
|
|
|
|
- if (dollars) {
|
|
|
|
|
- char *temp = lowercase_of(text);
|
|
|
|
|
- if (!strcmp(temp, look_for)) {
|
|
|
|
|
- look_for = 0;
|
|
|
|
|
- attr = ci_keyword_attr(temp);
|
|
|
|
|
- BEGIN(NORMAL);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- flt_puts(text, length, attr);
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
+static void handle_ident(char *text, int length);
|
|
|
|
|
+static void handle_newline(void);
|
|
|
|
|
+static void handle_literal(char *text, int length);
|
|
|
|
|
|
|
|
|
|
%}
|
|
|
|
|
|
|
|
|
|
@@ -160,3 +110,58 @@
|
|
|
|
|
while (yylex() > 0) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+static void
|
|
|
|
|
+handle_ident(char *text, int length)
|
|
|
|
|
+{
|
|
|
|
|
+ char *attr = ci_keyword_attr(text);
|
|
|
|
|
+ char *temp = lowercase_of(text);
|
|
|
|
|
+ flt_puts(text, length, attr);
|
|
|
|
|
+ if (!strcmp(temp, "deck")) {
|
|
|
|
|
+ /* FIXME: "DECK" can also have an option /dollars whose value would
|
|
|
|
|
+ * be the actual string to search for.
|
|
|
|
|
+ */
|
|
|
|
|
+ look_for = "eod";
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+static void
|
|
|
|
|
+handle_newline(void)
|
|
|
|
|
+{
|
|
|
|
|
+ flt_putc('\n');
|
|
|
|
|
+ if (look_for != 0) {
|
|
|
|
|
+ BEGIN(LITERAL);
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+static void
|
|
|
|
|
+handle_literal(char *text, int length)
|
|
|
|
|
+{
|
|
|
|
|
+ int dollars = 0;
|
|
|
|
|
+
|
|
|
|
|
+ if (*text == '$') {
|
|
|
|
|
+ flt_puts(text, 1, Comment_attr);
|
|
|
|
|
+ ++text;
|
|
|
|
|
+ --length;
|
|
|
|
|
+ dollars = 1;
|
|
|
|
|
+ }
|
|
|
|
|
+ while (length > 0 && isspace(CharOf(*text))) {
|
|
|
|
|
+ flt_putc(*text);
|
|
|
|
|
+ ++text;
|
|
|
|
|
+ --length;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (length > 0) {
|
|
|
|
|
+ char *attr = String_attr;
|
|
|
|
|
+
|
|
|
|
|
+ if (dollars) {
|
|
|
|
|
+ char *temp = lowercase_of(text);
|
|
|
|
|
+ if (!strcmp(temp, look_for)) {
|
|
|
|
|
+ look_for = 0;
|
|
|
|
|
+ attr = ci_keyword_attr(temp);
|
|
|
|
|
+ BEGIN(NORMAL);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ flt_puts(text, length, attr);
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
|