summaryrefslogtreecommitdiff
path: root/context/data/scite/lexers/scite-context-lexer-lua.lua
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2011-11-29 20:00:15 +0200
committerMarius <mariausol@gmail.com>2011-11-29 20:00:15 +0200
commit5ee86a080221db05e1dc12c361959e7d2fc5366b (patch)
treec19ab10ec956f94864bcc83fccb994af85023969 /context/data/scite/lexers/scite-context-lexer-lua.lua
parent4984427ad3ca77364951873833d80487d8d4a897 (diff)
downloadcontext-5ee86a080221db05e1dc12c361959e7d2fc5366b.tar.gz
beta 2011.11.29 18:47
Diffstat (limited to 'context/data/scite/lexers/scite-context-lexer-lua.lua')
-rw-r--r--context/data/scite/lexers/scite-context-lexer-lua.lua11
1 files changed, 10 insertions, 1 deletions
diff --git a/context/data/scite/lexers/scite-context-lexer-lua.lua b/context/data/scite/lexers/scite-context-lexer-lua.lua
index bb1a6c1d9..278c6d72f 100644
--- a/context/data/scite/lexers/scite-context-lexer-lua.lua
+++ b/context/data/scite/lexers/scite-context-lexer-lua.lua
@@ -24,7 +24,7 @@ _directives = { } -- communication channel
-- this will be eextended
local keywords = {
- 'and', 'break', 'do', 'else', 'elseif', 'end', 'false', 'for', 'function',
+ 'and', 'break', 'do', 'else', 'elseif', 'end', 'false', 'for', 'function', -- 'goto',
'if', 'in', 'local', 'nil', 'not', 'or', 'repeat', 'return', 'then', 'true',
'until', 'while',
}
@@ -144,6 +144,13 @@ local operator = token("special", P('..') + P('~=') + S('+-*/%^#=<>;:,.{}[]
local optionalspace = spacing^0
local hasargument = #S("{(")
+local gotokeyword = token("keyword", P("goto"))
+ * spacing
+ * token("grouping",validword)
+local gotolabel = token("keyword", P("::"))
+ * token("grouping",validword)
+ * token("keyword", P("::"))
+
local keyword = token("keyword", exact_match(keywords ))
local builtin = token("plain", exact_match(functions))
local constant = token("data", exact_match(constants))
@@ -159,12 +166,14 @@ _rules = {
{ 'function', builtin },
{ 'csname', csname },
{ 'constant', constant },
+ { 'goto', gotokeyword },
{ 'identifier', identifier },
{ 'string', string },
{ 'number', number },
{ 'longcomment', longcomment },
{ 'shortcomment', shortcomment },
-- { 'number', number },
+ { 'label', gotolabel },
{ 'operator', operator },
{ 'rest', rest },
}