Skip to content

Commit d0e1f3a

Browse files
authored
highlight: add support for lua (vlang#242)
1 parent 1a1eb58 commit d0e1f3a

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

highlight/langs.v

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ fn init_langs() []Lang {
4141
langs_ << init_c()
4242
langs_ << init_v()
4343
langs_ << init_js()
44+
langs_ << init_lua()
4445
langs_ << init_go()
4546
langs_ << init_cpp()
4647
langs_ << init_d()

highlight/lua.v

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
module highlight
2+
3+
fn init_lua() Lang {
4+
return Lang{
5+
name: 'Lua'
6+
lang_extensions: ['lua']
7+
line_comments: '--'
8+
mline_comments: ['--[[', ']]']
9+
string_start: ['"', "'"]
10+
color: '#00007d'
11+
keywords: [
12+
'and',
13+
'break',
14+
'do',
15+
'else',
16+
'elseif',
17+
'end',
18+
'false',
19+
'for',
20+
'function',
21+
'goto',
22+
'if',
23+
'in',
24+
'local',
25+
'nil',
26+
'not',
27+
'or',
28+
'repeat',
29+
'return',
30+
'then',
31+
'true',
32+
'until',
33+
'while',
34+
]
35+
}
36+
}

0 commit comments

Comments
 (0)