diff options
| author | liquidev <liquidekgaming@gmail.com> | 2021-05-20 19:02:40 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-20 19:02:40 +0200 |
| commit | 78999cabe2212b66eb7e237698ef1dc3ec175ca8 (patch) | |
| tree | a4b39c5e6c977a75bfadc2e059eee1e72564da1e /data/plugins/language_lua.lua | |
| parent | b15914d6642a49c9f5fc0e3af6411e90dde8636e (diff) | |
| download | lite-xl-78999cabe2212b66eb7e237698ef1dc3ec175ca8.tar.gz lite-xl-78999cabe2212b66eb7e237698ef1dc3ec175ca8.zip | |
Improved Lua syntax (#201)
* improved Lua syntax
* added some missing cases with number literals
Diffstat (limited to 'data/plugins/language_lua.lua')
| -rw-r--r-- | data/plugins/language_lua.lua | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/data/plugins/language_lua.lua b/data/plugins/language_lua.lua index 168ea0ce..5df3d29f 100644 --- a/data/plugins/language_lua.lua +++ b/data/plugins/language_lua.lua @@ -6,21 +6,28 @@ syntax.add { headers = "^#!.*[ /]lua", comment = "--", patterns = { - { pattern = { '"', '"', '\\' }, type = "string" }, - { pattern = { "'", "'", '\\' }, type = "string" }, - { pattern = { "%[%[", "%]%]" }, type = "string" }, - { pattern = { "%-%-%[%[", "%]%]"}, type = "comment" }, - { pattern = "%-%-.-\n", type = "comment" }, - { pattern = "-?0x%x+", type = "number" }, - { pattern = "-?%d+[%d%.eE]*", type = "number" }, - { pattern = "-?%.?%d+", type = "number" }, - { pattern = "<%a+>", type = "keyword2" }, - { pattern = "%.%.%.?", type = "operator" }, - { pattern = "[<>~=]=", type = "operator" }, - { pattern = "[%+%-=/%*%^%%#<>]", type = "operator" }, - { pattern = "[%a_][%w_]*%s*%f[(\"{]", type = "function" }, - { pattern = "[%a_][%w_]*", type = "symbol" }, - { pattern = "::[%a_][%w_]*::", type = "function" }, + { pattern = { '"', '"', '\\' }, type = "string" }, + { pattern = { "'", "'", '\\' }, type = "string" }, + { pattern = { "%[%[", "%]%]" }, type = "string" }, + { pattern = { "%-%-%[%[", "%]%]"}, type = "comment" }, + { pattern = "%-%-.-\n", type = "comment" }, + { pattern = "0x%x+%.%x*[pP][-+]?%d+", type = "number" }, + { pattern = "0x%x+%.%x*", type = "number" }, + { pattern = "0x%.%x+[pP][-+]?%d+", type = "number" }, + { pattern = "0x%.%x+", type = "number" }, + { pattern = "0x%x+[pP][-+]?%d+", type = "number" }, + { pattern = "0x%x+", type = "number" }, + { pattern = "%d%.%d*[eE][-+]?%d+", type = "number" }, + { pattern = "%d%.%d*", type = "number" }, + { pattern = "%.?%d*[eE][-+]?%d+", type = "number" }, + { pattern = "%.?%d+", type = "number" }, + { pattern = "<%a+>", type = "keyword2" }, + { pattern = "%.%.%.?", type = "operator" }, + { pattern = "[<>~=]=", type = "operator" }, + { pattern = "[%+%-=/%*%^%%#<>]", type = "operator" }, + { pattern = "[%a_][%w_]*()%s*%f[(\"'{]", type = {"function", "normal"} }, + { pattern = "[%a_][%w_]*", type = "symbol" }, + { pattern = "::[%a_][%w_]*::", type = "function" }, }, symbols = { ["if"] = "keyword", |
