aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorAdam <adamdharrison@gmail.com>2023-07-12 11:00:44 -0400
committerGitHub <noreply@github.com>2023-07-12 11:00:44 -0400
commit303b162601172b48653af7ff01422489ed318e37 (patch)
tree2fcc7a488bffdf5ccbaa7343e0c565c0c967408f /plugins
parentce5a6b72f679afef230696e707efa0bbb9a031bc (diff)
downloadlite-xl-plugins-303b162601172b48653af7ff01422489ed318e37.tar.gz
lite-xl-plugins-303b162601172b48653af7ff01422489ed318e37.zip
Updated perl to improve syntax highlighting. (#265)
* Updated perl to improve syntax highlighting. * Added in more perl stuff.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/language_perl.lua37
1 files changed, 34 insertions, 3 deletions
diff --git a/plugins/language_perl.lua b/plugins/language_perl.lua
index 0e057e2..cc1547f 100644
--- a/plugins/language_perl.lua
+++ b/plugins/language_perl.lua
@@ -10,13 +10,23 @@ syntax.add {
{ pattern = "%#.-\n", type = "comment" },
{ pattern = { '"', '"', '\\' }, type = "string" },
{ pattern = { "'", "'", '\\' }, type = "string" },
+ { pattern = { "qw%(", "%)", '\\' }, type = "string" },
+ { pattern = { "qw%[", "%]", '\\' }, type = "string" },
+ { pattern = { "qw%/", "%/", '\\' }, type = "string" },
+ { pattern = { "qq?%(", "%)", '\\' }, type = "string" },
+ { pattern = { "qq?%[", "%]", '\\' }, type = "string" },
+ { pattern = { "qq?%/", "%/", '\\' }, type = "string" },
+ { pattern = { "^=%w+", "=cut" }, type = "comment" },
-- until we can get this workign with s///, just don't do any of them.
-- { pattern = { '/', '/', '\\' }, type = "string" },
{ pattern = "-?%d+[%d%.eE]*", type = "number" },
{ pattern = "-?%.?%d+", type = "number" },
{ pattern = "[%a_][%w_]*%f[(]", type = "function" },
- { pattern = "[%@%$%*]+[%a_][%w_]*", type = "keyword2" },
- { pattern = "%--[%a_][%w_]*", type = "symbol" },
+ { pattern = "[%@%$%*%%]+[%a_][%w_]*", type = "keyword2" },
+ { pattern = "[%a_][%w_]*%s+()=>", type = { "string", "operator" } },
+ { pattern = "sub%s+()[%w_]+", type = { "keyword", "operator" } },
+ { pattern = "[<=>%+%-%*%/:%&%|%!%?%~]+", type = "operator" },
+ { pattern = "%--[%a_][%w_]*", type = "symbol" },
},
symbols = {
["-A"] = "keyword",
@@ -255,6 +265,27 @@ syntax.add {
["write"] = "keyword",
["each"] = "keyword",
["lcfirst"] = "keyword",
- ["setnetent"] = "keyword"
+ ["setnetent"] = "keyword",
+ ["while"] = "keyword",
+ ["for"] = "keyword",
+ ["if"] = "keyword",
+ ["else"] = "keyword",
+ ["elsif"] = "keyword",
+ ["unless"] = "keyword",
+ ["no"] = "keyword",
+ ["new"] = "keyword",
+ ["do"] = "keyword",
+ ["__PACKAGE__"] = "keyword",
+ ["warnings"] = "keyword2",
+ ["strict"] = "keyword2",
+ ["eq"] = "operator",
+ ["ne"] = "operator",
+ ["lt"] = "operator",
+ ["gt"] = "operator",
+ ["le"] = "operator",
+ ["ge"] = "operator",
+ ["cmp"] = "operator",
+ ["STDERR"] = "keyword2",
+ ["STDOUT"] = "keyword2"
}
}