From e0b0042619a0857c57b049dcc0d7e590a0fc0d2c Mon Sep 17 00:00:00 2001 From: Marcel Rodrigues Date: Sat, 4 Apr 2015 12:24:28 -0300 Subject: Add basic Lua syntax highlighting support --- config.def.h | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/config.def.h b/config.def.h index 48feb08..28153aa 100644 --- a/config.def.h +++ b/config.def.h @@ -1030,6 +1030,51 @@ static Syntax syntaxes[] = {{ B"(abstract|class|extends|final|implements|import|instanceof|interface|native|package|private|protected|public|static|strictfp|this|super|synchronized|throws|volatile)"B, &colors[COLOR_KEYWORD2], }} +},{ + .name = "lua", + .file = "\\.lua$", + .settings = (const char*[]){ + "set number", + "set autoindent", + NULL + }, + .rules = {{ + "--\\[(=*)\\[([^]]*)\\](=*)\\]", + &colors[COLOR_COMMENT], + true, + },{ + "--.*$", + &colors[COLOR_COMMENT], + },{ + "(\\[(=*)\\[([^]]*)\\](=*)\\]|^([^][]*)\\](=*)\\])", + &colors[COLOR_STRING], + true, + }, + SYNTAX_STRING, + { + B"([0-9]*\\.)?[0-9]+([eE]([\\+-])?[0-9]+)?"B, + &colors[COLOR_LITERAL], + },{ + B"0x[0-9a-fA-F]+"B, + &colors[COLOR_LITERAL], + },{ + B"(false|nil|true)"B, + &colors[COLOR_CONSTANT], + },{ + "(\\.\\.\\.)", + &colors[COLOR_CONSTANT], + },{ + B"(break|do|else|elseif|end|for|function|if|in|local|repeat|return|then|until|while)"B, + &colors[COLOR_KEYWORD], + },{ + B"(and|not|or)"B, + &colors[COLOR_OPERATOR], + },{ + "(\\+|-|\\*|/|%|\\^|#|[=~<>]=|<|>|\\.\\.)", + &colors[COLOR_OPERATOR], + }, + SYNTAX_BRACKET, + } },{ .name = "ruby", .file = "\\.rb$", -- cgit v1.2.3