aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuldoman <giulio.lettieri@gmail.com>2022-06-12 14:16:18 +0200
committerGitHub <noreply@github.com>2022-06-12 14:16:18 +0200
commit4efbf04628207a9c6fd9695bc276a8e706afc746 (patch)
tree4e05a176595da9e6db4f02441c18c85077fae603
parent0c23eb3ef4bee68e79646f95a3a0f8fffd3955f6 (diff)
parent467cc88b67317d12300a8c52444f4626dfdec1d0 (diff)
downloadlite-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.lua29
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",