aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--manifest.json2
-rw-r--r--plugins/language_java.lua32
2 files changed, 18 insertions, 16 deletions
diff --git a/manifest.json b/manifest.json
index dbabbcc..9006dc2 100644
--- a/manifest.json
+++ b/manifest.json
@@ -1138,7 +1138,7 @@
"tags": [
"language"
],
- "version": "0.1"
+ "version": "0.1.1"
},
{
"description": "Syntax for the [jiyu](https://github.com/machinamentum/jiyu) programming language",
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"
+ }
}