elm_code: Add syntax highlighting for python

This commit is contained in:
Andy Williams 2017-02-03 17:16:12 +00:00
parent e8e72fb959
commit c9d7b00aac
1 changed files with 15 additions and 0 deletions

View File

@ -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;
}