aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Williams <andy@andywilliams.me>2017-02-03 17:13:27 +0000
committerAndy Williams <andy@andywilliams.me>2017-02-03 17:13:27 +0000
commite8e72fb959bef90839b1c8c630c9929fda78870a (patch)
tree104733ddc8dc7a60621279497e339f1af499f311
parentcmake: sync EFL_EO_API_SUPPORT definition with autotools. (diff)
downloadefl-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.c6
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;