summaryrefslogtreecommitdiff
path: root/src/lib/elementary
diff options
context:
space:
mode:
authorAndy Williams <andy@andywilliams.me>2017-03-04 15:39:24 +0000
committerAndy Williams <andy@andywilliams.me>2017-03-04 15:42:33 +0000
commitc19d3b402a163910bb4b69fc5e3da1a517247529 (patch)
tree174e2a19f12273fbd4e4370e9864a8adc6e56f00 /src/lib/elementary
parent3c3808acc5c9c31e10648c7eb79033f5f17f2676 (diff)
elm_code: Fix missing syntax for .eo files
This was accidentally removed in the transition from edi. using text/x-eolian which is not well reported by the FS yet. @fix
Diffstat (limited to 'src/lib/elementary')
-rw-r--r--src/lib/elementary/elm_code_syntax.c25
-rw-r--r--src/lib/elementary/elm_code_widget.c3
2 files changed, 28 insertions, 0 deletions
diff --git a/src/lib/elementary/elm_code_syntax.c b/src/lib/elementary/elm_code_syntax.c
index 80adead56c..5fbb415ada 100644
--- a/src/lib/elementary/elm_code_syntax.c
+++ b/src/lib/elementary/elm_code_syntax.c
@@ -42,13 +42,38 @@ static Elm_Code_Syntax _elm_code_syntax_py =
42 "or", "pass", "raise", "return", "try", "while", "with", "yield"} 42 "or", "pass", "raise", "return", "try", "while", "with", "yield"}
43}; 43};
44 44
45static Elm_Code_Syntax _elm_code_syntax_eo =
46{
47 "{}():;*,.",
48 NULL,
49 "//",
50 "[[",
51 "]]",
52 {"byte", "ubyte", "char", "short", "ushort", "int", "uint", "long", "ulong", \
53 "llong", "ullong", "int8", "uint8", "int16", "uint16", "int32", "uint32", \
54 "int64", "uint64", "int128", "uint128", "size", "ssize", "intptr", "uintptr", \
55 "ptrdiff", "time", "float", "double", "bool", "void", "void_ptr", \
56 "string", "stringshare", "generic_value", \
57 "abstract", "class", "data", "mixin", "import", "interface", "type", "const", "var", \
58 "own", "free", "struct", "enum", "@extern", "@free", "@auto", "@empty", \
59 "@private", "@protected", "@beta", "@hot", "@const", "@class", "@virtual_pure", \
60 "@property", "@nonull", "@nullable", "@optional", "@in", "@out", "@inout", "@warn_unused", \
61 "eo_prefix", "legacy_prefix", "methods", "events", "params", "return", "legacy", \
62 "implements", "constructors", "get", "set", "keys", "values", "true", "false", "null"}
63};
64
65
45EAPI Elm_Code_Syntax * 66EAPI Elm_Code_Syntax *
46elm_code_syntax_for_mime_get(const char *mime) 67elm_code_syntax_for_mime_get(const char *mime)
47{ 68{
69 if (!mime) return NULL;
70
48 if (!strcmp("text/x-chdr", mime) || !strcmp("text/x-csrc", mime)) 71 if (!strcmp("text/x-chdr", mime) || !strcmp("text/x-csrc", mime))
49 return &_elm_code_syntax_c; 72 return &_elm_code_syntax_c;
50 if (!strcmp("text/x-python", mime)) 73 if (!strcmp("text/x-python", mime))
51 return &_elm_code_syntax_py; 74 return &_elm_code_syntax_py;
75 if (!strcmp("text/x-eolian", mime))
76 return &_elm_code_syntax_eo;
52 77
53 return NULL; 78 return NULL;
54} 79}
diff --git a/src/lib/elementary/elm_code_widget.c b/src/lib/elementary/elm_code_widget.c
index 62ff893465..4d0ea3a2ab 100644
--- a/src/lib/elementary/elm_code_widget.c
+++ b/src/lib/elementary/elm_code_widget.c
@@ -2132,6 +2132,9 @@ _elm_code_widget_syntax_enabled_set(Eo *obj, Elm_Code_Widget_Data *pd EINA_UNUSE
2132 elm_code_parser_standard_add(code, ELM_CODE_PARSER_STANDARD_SYNTAX); 2132 elm_code_parser_standard_add(code, ELM_CODE_PARSER_STANDARD_SYNTAX);
2133 else 2133 else
2134 code->parsers = eina_list_remove(code->parsers, ELM_CODE_PARSER_STANDARD_SYNTAX); 2134 code->parsers = eina_list_remove(code->parsers, ELM_CODE_PARSER_STANDARD_SYNTAX);
2135
2136 _elm_code_parse_reset_file(code, code->file);
2137 _elm_code_widget_fill(obj);
2135} 2138}
2136 2139
2137EOLIAN static Eina_Bool 2140EOLIAN static Eina_Bool