From 36ee3b791e253a00877a7b25e2d94b1dfc90a174 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Wed, 12 Jun 2019 00:08:48 +0200 Subject: 2019-06-11 19:28:00 --- .../textadept/context/lexers/scite-context-lexer-lua.lua | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'context/data/textadept/context/lexers/scite-context-lexer-lua.lua') diff --git a/context/data/textadept/context/lexers/scite-context-lexer-lua.lua b/context/data/textadept/context/lexers/scite-context-lexer-lua.lua index ba14f5206..0e54d56ba 100644 --- a/context/data/textadept/context/lexers/scite-context-lexer-lua.lua +++ b/context/data/textadept/context/lexers/scite-context-lexer-lua.lua @@ -56,7 +56,9 @@ local constants = { "__le", "__lt", "__metatable", "__mode", "__mul", "__newindex", "__pow", "__sub", "__tostring", "__unm", "__len", "__pairs", "__ipairs", + "__close", "NaN", + "", "", } -- local tokenmappings = { } @@ -66,9 +68,11 @@ local constants = { -- for i=1,#constants do tokenmappings[constants[i]] = "constant" } local internals = { -- __ - "add", "call", "concat", "div", "eq", "gc", "index", + "add", "call", "concat", "div", "idiv", "eq", "gc", "index", "le", "lt", "metatable", "mode", "mul", "newindex", "pow", "sub", "tostring", "unm", "len", + "pairs", "ipairs", + "close", } local depricated = { @@ -80,8 +84,8 @@ local depricated = { local csnames = { -- todo: option "commands", "context", --- "ctxcmd", --- "ctx", + -- "ctxcmd", + -- "ctx", "metafun", "metapost", } @@ -224,10 +228,12 @@ local csname = token("user", p_csnames + p_ctnames) + ( token("special", S(".:")) * optionalspace * token("user", validword) )^1 )^-1 +-- we could also check S(".:") * p_keyword etc, could be faster + local identifier = token("default", validword) * ( optionalspace * token("special", S(".:")) * optionalspace * ( token("warning", p_keywords) + - token("data", p_internals) + + token("data", p_internals) + -- needs checking token("default", validword ) ) )^0 @@ -375,12 +381,14 @@ lualexer._rules_cld = { { "keyword", keyword }, { "function", builtin }, { "csname", csname }, + { "goto", gotokeyword }, { "constant", constant }, { "identifier", identifier }, { "string", string }, { "longcomment", longcomment }, { "shortcomment", shortcomment }, -- should not be used inline so best signal it as comment (otherwise complex state till end of inline) { "number", number }, + { "label", gotolabel }, { "operator", operator }, { "rest", rest }, } -- cgit v1.2.3