aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/language_java.lua32
1 files changed, 17 insertions, 15 deletions
diff --git a/plugins/language_java.lua b/plugins/language_java.lua
index 30c1249..9fc5b7d 100644
--- a/plugins/language_java.lua
+++ b/plugins/language_java.lua
@@ -6,19 +6,21 @@ syntax.add {
files = { "%.java$" },
comment = "//",
patterns = {
- { pattern = "//.-\n", type = "comment" },
- { pattern = { "/%*", "%*/" }, type = "comment" },
- { pattern = { '"', '"', '\\' }, type = "string" },
- { pattern = { "'", "'", '\\' }, type = "string" },
- { pattern = "'\\x%x?%x?%x?%x'", type = "string" }, -- character hexadecimal escape sequence
- { pattern = "'\\u%x%x%x%x'", type = "string" }, -- character unicode escape sequence
- { pattern = "'\\?.'", type = "string" }, -- character literal
- { pattern = "-?0x%x+", type = "number" },
- { pattern = "-?%d+[%d%.eE]*f?", type = "number" },
- { pattern = "-?%.?%d+f?", type = "number" },
- { pattern = "[%+%-=/%*%^%%<>!~|&]", type = "operator" },
- { pattern = "[%a_][%w_]*%f[(]", type = "function" },
- { pattern = "[%a_][%w_]*", type = "symbol" },
+ { pattern = "//.*", type = "comment" },
+ { pattern = { "/%*", "%*/" }, type = "comment" },
+ { pattern = { '"', '"', '\\' }, type = "string" },
+ { pattern = { "'", "'", '\\' }, type = "string" },
+ { pattern = "'\\x%x?%x?%x?%x'", type = "string" }, -- character hexadecimal escape sequence
+ { pattern = "'\\u%x%x%x%x'", type = "string" }, -- character unicode escape sequence
+ { pattern = "'\\?.'", type = "string" }, -- character literal
+ { pattern = "-?0x%x+", type = "number" },
+ { pattern = "-?%d+[%d%.eE]*f?", type = "number" },
+ { pattern = "-?%.?%d+f?", type = "number" },
+ { pattern = "[%+%-=/%*%^%%<>!~|&]", type = "operator" },
+ { pattern = "[%a_][%w_]*%f[(]", type = "function" },
+ { regex = "(?:\\w+\\.?)+(?=\\s+\\w++\\s*\\=\\s*)", type = "function" }, -- Class name when creating an object
+ { regex = "[A-Z][A-Z_]+", type = "keyword2" }, -- Constants
+ { pattern = "[%a_][%w_]*", type = "symbol" },
},
symbols = {
["abstract"] = "keyword",
@@ -80,6 +82,6 @@ syntax.add {
["true"] = "literal",
["false"] = "literal",
- ["null"] = "literal",
- },
+ ["null"] = "literal"
+ }
}