vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
commit 4490be48af30bdf3c76dddbf4a4e5d92875b0ebb parent 2aa662ee44c2b89f9dca778dd860ca230609e4eb Author: Jörg Alberto <mail@evanesco.de> Date: Sat, 17 Jan 2015 09:20:15 +0100 Introduce basic PHP syntax highlighting support Diffstat:
| M | config.def.h | | | 43 | +++++++++++++++++++++++++++++++++++++++++++ |
1 file changed, 43 insertions(+), 0 deletions(-)
diff --git a/config.def.h b/config.def.h @@ -1106,6 +1106,49 @@ static Syntax syntaxes[] = {{ &colors[COLOR_SYNTAX2], }} },{ + .name = "php", + .file = "\\.php$", + .rules = { + SYNTAX_MULTILINE_COMMENT, + SYNTAX_SINGLE_LINE_COMMENT, + SYNTAX_BRACKET, + { + "(#.*$|#$)", + &colors[COLOR_COMMENT], + },{ + "(\"\"\".*\"\"\")", + &colors[COLOR_COMMENT], + true, /* multiline */ + },{ + B"(class|interface|extends|implements|new|__construct|__destruct|use|namespace|return)"B, + &colors[COLOR_KEYWORD2], + },{ + B"(public|private|protected|const|parent|function|->)"B, + &colors[COLOR_KEYWORD], + },{ + B"(if|else|while|do|for|foreach|in|try|catch|finally|switch|case|default|break|continue|as|=>)"B, + &colors[COLOR_CONTROL], + },{ + B"(array|true|false|null)", + &colors[COLOR_DATATYPE], + },{ + 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], + },{ + "\\$[a-zA-Z0-9_\\-]+", + &colors[COLOR_VARIABLE], + },{ + "(\"(\\\\.|[^\"])*\"|\'(\\\\.|[^\'])*\')", + &colors[COLOR_STRING], + false, /* multiline */ + },{ + "(php|echo|print|var_dump|print_r)", + &colors[COLOR_SYNTAX2], + }} +},{ .name = "haskell", .file = "\\.hs$", .rules = {{