summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Williams <andy@andywilliams.me>2017-02-03 17:16:12 +0000
committerAndy Williams <andy@andywilliams.me>2017-02-03 17:16:12 +0000
commitc9d7b00aacd1bf3512fd33316e161cfca7643fba (patch)
treea127038f7dc18caede14637472e99b25d9909791
parente8e72fb959bef90839b1c8c630c9929fda78870a (diff)
downloadefl-c9d7b00aacd1bf3512fd33316e161cfca7643fba.tar.gz
elm_code: Add syntax highlighting for python
-rw-r--r--src/lib/elementary/elm_code_syntax.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/lib/elementary/elm_code_syntax.c b/src/lib/elementary/elm_code_syntax.c
index 6012169dc2..3d32e474f8 100644
--- a/src/lib/elementary/elm_code_syntax.c
+++ b/src/lib/elementary/elm_code_syntax.c
@@ -29,11 +29,26 @@ static Elm_Code_Syntax _elm_code_syntax_c =
"struct", "switch", "typedef", "union", "unsigned", "void", "volatile", "while", NULL}
};
+static Elm_Code_Syntax _elm_code_syntax_py =
+{
+ "{}()[]:;%/*+!=<->,.",
+ NULL,
+ "#",
+ "\"\"\"",
+ "\"\"\"",
+ {"False", "None", "True", "and", "as", "assert", "break", "class", \
+ "continue", "def", "del", "elif", "else", "except", "finally", "for", \
+ "from", "global", "if", "import", "in", "is", "lambda", "nonlocal", "not", \
+ "or", "pass", "raise", "return", "try", "while", "with", "yield"}
+};
+
EAPI Elm_Code_Syntax *
elm_code_syntax_for_mime_get(const char *mime)
{
if (!strcmp("text/x-chdr", mime) || !strcmp("text/x-csrc", mime))
return &_elm_code_syntax_c;
+ if (!strcmp("text/x-python", mime))
+ return &_elm_code_syntax_py;
return NULL;
}