src/codegens.h

changeset 47
c39ecbbca7c0
parent 46
534a4ef4143d
child 48
b2724c711203
equal deleted inserted replaced
46:534a4ef4143d 47:c39ecbbca7c0
29 29
30 #ifndef CODEGENS_H 30 #ifndef CODEGENS_H
31 #define CODEGENS_H 31 #define CODEGENS_H
32 32
33 #include <stdio.h> 33 #include <stdio.h>
34 #include "ucx/string.h"
34 #include "ucx/buffer.h" 35 #include "ucx/buffer.h"
35 36
36 #ifdef __cplusplus 37 #ifdef __cplusplus
37 extern "C" { 38 extern "C" {
38 #endif 39 #endif
39 40
40 #define WORDBUF_SIZE 64 41 #define WORDBUF_SIZE 256
41 42
42 typedef struct { 43 typedef void(*highlighter_func)(char*,UcxBuffer*,int*);
43 int iscommentml;
44 char word[WORDBUF_SIZE];
45 char includefile[FILENAME_MAX];
46 } HighlighterData;
47
48 typedef void(*highlighter_func)(char*,UcxBuffer*,HighlighterData*);
49 44
50 #define iswordcharacter(c) (isalnum(c) || c=='_' || c=='#' || c=='@') 45 #define iswordcharacter(c) (isalnum(c) || c=='_' || c=='#' || c=='@')
51 size_t writeescapedchar(char *dest, size_t dp, char c); 46 size_t writeescapedchar(char *dest, size_t dp, char c);
52 int check_keyword(char *word, const char** keywords); 47 int check_keyword(sstr_t word, const char** keywords);
53 int check_capsonly(char *word, size_t wp); 48 int check_capsonly(sstr_t word);
54 49
55 50
56 #ifdef __cplusplus 51 #ifdef __cplusplus
57 } 52 }
58 #endif 53 #endif

mercurial