xarbon/language/xofya.h

33 lines
1.8 KiB
C

static void highlight_xofya (void) {
char * separators = ".,:;<=>+-*/%!&~^?|(){}'\" \t\r\n";
char * keywords [] = {
"character", "natural", "integer", "logical", "address", "pointer", "union", "enter",
"array", "iterate", "enumerate", "include", "exclude", "execute", "if", "else",
"match", "for", "break", "cycle", "and", "or", "not", "true",
"false", "nil", "range", "then", "terminate", "procedure", "program", "package"
};
int word;
syntax_define (false, false, "!", "\n", '\0', (int) 0xff775555, 0);
syntax_define (false, false, "---", "\n", '\0', (int) 0xff777777, 0);
syntax_define (false, false, "--!", "!--", '\0', (int) 0xff777777, 0);
syntax_define (false, false, "@", "\n", '\0', (int) 0xffcc7755, 0);
syntax_define (false, false, "<!>", "\n", '\0', (int) 0xff5555cc, 0);
syntax_define (false, false, "\"", "\"", '\\', (int) 0xff7733cc, 0);
syntax_define (false, false, "'", "'", '\\', (int) 0xffcc3377, 0);
for (word = 0; word != (int) (sizeof (keywords) / sizeof (keywords [0])); ++word) {
syntax_define (false, true, keywords [word], separators, '\0', (int) 0xff33ccee, 0);
}
syntax_define (true, false, "(){}", "", '\0', (int) 0xffee5533, 0);
syntax_define (true, false, ".,:;<=>+*-/%!&~^?|", "", '\0', (int) 0xffeeaa33, 0);
syntax_define (true, true, "0123456789", separators, '\0', (int) 0xffee33aa, 0);
syntax_define (true, true, "abcdefghijklmnopqrstuvwxyz", separators, '\0', (int) 0xffcccccc, 0);
syntax_define (true, true, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", separators, '\0', (int) 0xffeeeeee, 0);
syntax_define (true, true, "_", separators, '\0', (int) 0xffaaaaaa, 0);
}