diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/language_perl.lua | 37 |
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" } } |