Skip to content

Commit 79c33bb

Browse files
committed
scintillua: added all lua funcs, made theme more generic
1 parent 1f6d5d2 commit 79c33bb

File tree

2 files changed

+32
-10
lines changed

2 files changed

+32
-10
lines changed

extra/scintillua/lexers/moonscript.lua

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,36 @@ local keyword = token(l.KEYWORD, word_match {
4444
local special = token("special", word_match { "true", "false", "nil" })
4545

4646
-- Functions.
47-
local builtin = token(l.FUNCTION, word_match {
48-
'assert', 'collectgarbage', 'dofile', 'error', 'getfenv', 'getmetatable',
49-
'ipairs', 'load', 'loadfile', 'loadstring', 'module', 'next', 'pairs',
50-
'pcall', 'print', 'rawequal', 'rawget', 'rawset', 'require', 'setfenv',
51-
'setmetatable', 'tonumber', 'tostring', 'type', 'unpack', 'xpcall'
52-
})
47+
local builtin = token(l.FUNCTION, word_match({
48+
"_G","_VERSION","assert","collectgarbage","dofile","error","getfenv","getmetatable","ipairs","load",
49+
"loadfile","loadstring","module","next","pairs","pcall","print","rawequal","rawget","rawset","require",
50+
"select","setfenv","setmetatable","tonumber","tostring","type","unpack","xpcall",
51+
52+
"coroutine.create","coroutine.resume","coroutine.running","coroutine.status","coroutine.wrap","coroutine.yield",
53+
54+
"debug.debug","debug.getfenv","debug.gethook","debug.getinfo","debug.getlocal","debug.getmetatable",
55+
"debug.getregistry","debug.getupvalue","debug.setfenv","debug.sethook","debug.setlocal","debug.setmetatable",
56+
"debug.setupvalue","debug.traceback",
57+
58+
"io.close","io.flush","io.input","io.lines","io.open","io.output","io.popen","io.read","io.stderr","io.stdin",
59+
"io.stdout","io.tmpfile","io.type","io.write",
60+
61+
"math.abs","math.acos","math.asin","math.atan","math.atan2","math.ceil","math.cos","math.cosh","math.deg",
62+
"math.exp","math.floor","math.fmod","math.frexp","math.huge","math.ldexp","math.log","math.log10","math.max",
63+
"math.min","math.modf","math.pi","math.pow","math.rad","math.random","math.randomseed","math.sin","math.sinh",
64+
"math.sqrt","math.tan","math.tanh",
65+
66+
"os.clock","os.date","os.difftime","os.execute","os.exit","os.getenv","os.remove","os.rename","os.setlocale",
67+
"os.time","os.tmpname",
68+
69+
"package.cpath","package.loaded","package.loaders","package.loadlib","package.path","package.preload",
70+
"package.seeall",
71+
72+
"string.byte","string.char","string.dump","string.find","string.format","string.gmatch","string.gsub",
73+
"string.len","string.lower","string.match","string.rep","string.reverse","string.sub","string.upper",
74+
75+
"table.concat","table.insert","table.maxn","table.remove","table.sort"
76+
}, "%."))
5377

5478
-- Identifiers.
5579
local identifier = token(l.IDENTIFIER, l.word)
@@ -95,6 +119,4 @@ _tokenstyles = {
95119
{ 'symbol', style_fndef },
96120
{ 'special', style_special },
97121
{ 'tbl_key', { fore = l.colors.red } },
98-
{ l.OPERATOR, { fore = l.colors.red, bold = true } },
99-
{ l.FUNCTION, { fore = l.colors.orange } },
100122
}

extra/scintillua/lexers/themes/moon.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ style_comment = style { fore = colors.grey, }
2626
style_constant = style { fore = colors.teal, bold = true }
2727
style_definition = style { fore = colors.red, bold = true }
2828
style_error = style { fore = colors.white, back = colors.bright_red, bold = true}
29-
style_function = style { fore = colors.white, bold = true }
29+
style_function = style { fore = colors.orange, bold = true }
3030
style_keyword = style { fore = colors.purple, bold = true }
3131
style_number = style { fore = colors.blue }
32-
style_operator = style { fore = colors.white, bold = true }
32+
style_operator = style { fore = colors.red, bold = true }
3333
style_string = style { fore = colors.yellow, bold = true }
3434
style_preproc = style { fore = colors.light_blue }
3535
style_tag = style { fore = colors.teal, bold = true }

0 commit comments

Comments
 (0)