diff options
author | Andy Williams <andy@andywilliams.me> | 2017-02-03 17:13:27 +0000 |
---|---|---|
committer | Andy Williams <andy@andywilliams.me> | 2017-02-03 17:13:27 +0000 |
commit | e8e72fb959bef90839b1c8c630c9929fda78870a (patch) | |
tree | 104733ddc8dc7a60621279497e339f1af499f311 | |
parent | 3cc60ce5f388e7edfc2d07bbdf95d09a16b673b7 (diff) | |
download | efl-e8e72fb959bef90839b1c8c630c9929fda78870a.tar.gz |
elm_code: update syntax symbols for C
Also don't hard code preprocessing parse
-rw-r--r-- | src/lib/elementary/elm_code_syntax.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/elementary/elm_code_syntax.c b/src/lib/elementary/elm_code_syntax.c index cd8a66f2ea..6012169dc2 100644 --- a/src/lib/elementary/elm_code_syntax.c +++ b/src/lib/elementary/elm_code_syntax.c @@ -10,6 +10,7 @@ typedef struct _Elm_Code_Syntax { const char *symbols; + const char *preprocessor; const char *comment_single; const char *comment_start; const char *comment_end; @@ -18,7 +19,8 @@ typedef struct _Elm_Code_Syntax static Elm_Code_Syntax _elm_code_syntax_c = { - "{}()[]:;/*+&|!=<->,.", + "{}()[]:;%^/*+&|~!=<->,.", + "#", "//", "/*", "*/", @@ -161,7 +163,7 @@ elm_code_syntax_parse_line(Elm_Code_Syntax *syntax, Elm_Code_Line *line) continue; } - if (content[i] == '#') + if (syntax->preprocessor && _content_starts_with(content+i, syntax->preprocessor, strlen(syntax->preprocessor))) { elm_code_line_token_add(line, i, length - 1, 1, ELM_CODE_TOKEN_TYPE_PREPROCESSOR); return; |