From 6f7fdba0d8787b84a88307a01446e8b2b91bbada Mon Sep 17 00:00:00 2001 From: Matias Linares Date: Sat, 3 Jan 2015 01:03:42 -0300 Subject: Add python syntax support --- config.def.h | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/config.def.h b/config.def.h index 05bfabd..aac28a8 100644 --- a/config.def.h +++ b/config.def.h @@ -1114,6 +1114,45 @@ static Syntax syntaxes[] = {{ "#\\{[^}]*\\}", &colors[COLOR_SYNTAX6], }} +},{ + .name = "python", + .file = "\\.py$", + .rules = {{ + "(#.*$|#$)", + &colors[COLOR_COMMENT], + },{ + "(\"\"\".*\"\"\")", + &colors[COLOR_COMMENT], + true, /* multiline */ + },{ + B"(and|class|def|not|or|return|yield|is)"B, + &colors[COLOR_KEYWORD2], + },{ + B"(from|import|as)"B, + &colors[COLOR_KEYWORD], + },{ + B"(if|elif|else|while|for|in|try|with|except|in|break|continue|finally)"B, + &colors[COLOR_CONTROL], + },{ + B"(int|str|float|unicode|int|bool|chr|type|list|dict|tuple)", + &colors[COLOR_DATATYPE], + },{ + "(True|False|None)", + &colors[COLOR_LITERAL], + },{ + B"[0-9]+\\.[0-9]+([eE][-+]?[0-9]+)?"B, + &colors[COLOR_LITERAL], + },{ + B"[0-9]+"B"|"B"0[xX][0-9a-fA-F]+"B"|"B"0[oO][0-7]+"B, + &colors[COLOR_LITERAL], + },{ + "(\"(\\\\.|[^\"])*\"|\'(\\\\.|[^\'])*\')", + &colors[COLOR_STRING], + false, /* multiline */ + },{ + "(__init__|__str__|__unicode__|__gt__|__lt__|__eq__|__enter__|__exit__|__next__|__getattr__|__getitem__|__setitem__|__call__|__contains__|__iter__|__bool__|__all__|__name__)", + &colors[COLOR_SYNTAX2], + }} },{ .name = "haskell", .file = "\\.hs$", -- cgit v1.2.3