From d0e1f3ad2fa3d76306a3de11642f5ff50e9e9ede Mon Sep 17 00:00:00 2001 From: Francesco La Camera Date: Thu, 13 Apr 2023 15:25:47 +0200 Subject: [PATCH] highlight: add support for lua (#242) --- highlight/langs.v | 1 + highlight/lua.v | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 highlight/lua.v diff --git a/highlight/langs.v b/highlight/langs.v index 17aadb7f..c8637fd0 100644 --- a/highlight/langs.v +++ b/highlight/langs.v @@ -41,6 +41,7 @@ fn init_langs() []Lang { langs_ << init_c() langs_ << init_v() langs_ << init_js() + langs_ << init_lua() langs_ << init_go() langs_ << init_cpp() langs_ << init_d() diff --git a/highlight/lua.v b/highlight/lua.v new file mode 100644 index 00000000..2eb9485f --- /dev/null +++ b/highlight/lua.v @@ -0,0 +1,36 @@ +module highlight + +fn init_lua() Lang { + return Lang{ + name: 'Lua' + lang_extensions: ['lua'] + line_comments: '--' + mline_comments: ['--[[', ']]'] + string_start: ['"', "'"] + color: '#00007d' + keywords: [ + 'and', + 'break', + 'do', + 'else', + 'elseif', + 'end', + 'false', + 'for', + 'function', + 'goto', + 'if', + 'in', + 'local', + 'nil', + 'not', + 'or', + 'repeat', + 'return', + 'then', + 'true', + 'until', + 'while', + ] + } +}