diff options
author | Guldoman <giulio.lettieri@gmail.com> | 2022-06-12 14:16:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-12 14:16:18 +0200 |
commit | 4efbf04628207a9c6fd9695bc276a8e706afc746 (patch) | |
tree | 4e05a176595da9e6db4f02441c18c85077fae603 | |
parent | 0c23eb3ef4bee68e79646f95a3a0f8fffd3955f6 (diff) | |
parent | 467cc88b67317d12300a8c52444f4626dfdec1d0 (diff) | |
download | lite-xl-plugins-4efbf04628207a9c6fd9695bc276a8e706afc746.tar.gz lite-xl-plugins-4efbf04628207a9c6fd9695bc276a8e706afc746.zip |
Merge pull request #99 from benwalksaway/go_generic_func_syntax
language_go: add syntax support for Go generic functions
-rw-r--r-- | plugins/language_go.lua | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/plugins/language_go.lua b/plugins/language_go.lua index e1c96b2..58c38c2 100644 --- a/plugins/language_go.lua +++ b/plugins/language_go.lua @@ -6,20 +6,21 @@ syntax.add { files = { "%.go$" }, comment = "//", patterns = { - { pattern = "//.-\n", type = "comment" }, - { pattern = { "/%*", "%*/" }, type = "comment" }, - { pattern = { '"', '"', '\\' }, type = "string" }, - { pattern = { "`", "`", '\\' }, type = "string" }, - { pattern = { "'", "'", '\\' }, type = "string" }, - { pattern = "0[oO_][0-7]+", type = "number" }, - { pattern = "-?0x[%x_]+", type = "number" }, - { pattern = "-?%d+_%d", type = "number" }, - { pattern = "-?%d+[%d%.eE]*f?", type = "number" }, - { pattern = "-?%.?%d+f?", type = "number" }, - { pattern = "[%+%-=/%*%^%%<>!~|&]", type = "operator" }, - { pattern = ":=", type = "operator" }, - { pattern = "[%a_][%w_]*%f[(]", type = "function" }, - { pattern = "[%a_][%w_]*", type = "symbol" }, + { pattern = "//.-\n", type = "comment" }, + { pattern = { "/%*", "%*/" }, type = "comment" }, + { pattern = { '"', '"', '\\' }, type = "string" }, + { pattern = { "`", "`", '\\' }, type = "string" }, + { pattern = { "'", "'", '\\' }, type = "string" }, + { pattern = "0[oO_][0-7]+", type = "number" }, + { pattern = "-?0x[%x_]+", type = "number" }, + { pattern = "-?%d+_%d", type = "number" }, + { pattern = "-?%d+[%d%.eE]*f?", type = "number" }, + { pattern = "-?%.?%d+f?", type = "number" }, + { pattern = "[%+%-=/%*%^%%<>!~|&]", type = "operator" }, + { pattern = ":=", type = "operator" }, + { pattern = "[%a_][%w_]*%f[(]", type = "function" }, -- function call + { pattern = "func()%s*[%a_][%w_]*()%f[%[(]", type = {"keyword", "function", "normal"} }, -- function statement + { pattern = "[%a_][%w_]*", type = "symbol" }, }, symbols = { ["if"] = "keyword", |