From 5e2292c6226920a659ff3fe798936d614138e236 Mon Sep 17 00:00:00 2001 From: Guldoman Date: Sun, 27 Oct 2024 16:20:44 +0100 Subject: refactor: cleaner solution to avoid `language_java` catastrophic backtracking (#463) --- plugins/language_java.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/language_java.lua') diff --git a/plugins/language_java.lua b/plugins/language_java.lua index d49472f..873d827 100644 --- a/plugins/language_java.lua +++ b/plugins/language_java.lua @@ -18,7 +18,7 @@ syntax.add { { 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 = "(?>\\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" }, }, -- cgit v1.2.3