From f0d50a9854d0c05819667561d02426344d006ba9 Mon Sep 17 00:00:00 2001 From: jgmdev Date: Thu, 10 Mar 2022 00:54:28 -0400 Subject: language_php: improved uppercase constants matching --- plugins/language_php.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'plugins/language_php.lua') diff --git a/plugins/language_php.lua b/plugins/language_php.lua index fa1992a..81cf49e 100644 --- a/plugins/language_php.lua +++ b/plugins/language_php.lua @@ -51,8 +51,11 @@ syntax.add { { pattern = "array", type = "literal" }, -- Match static or namespace container on sub element access { pattern = "[%a_][%w_]*[%s]*%f[:]", type = "literal" }, - -- Uppercase constants of at least 3 characters in len - { pattern = "%u[%u_][%u%d_]+", type = "number" }, + -- Uppercase constants of at least 2 chars in len + { + pattern = "%u[%u_][%u%d_]*%f[%s%+%*%-%.%(%)%?%^%%=/<>~|&;:,!]", + type = "number" + }, -- Magic constants { pattern = "__[%u]+__", type = "number" }, -- Everything else -- cgit v1.2.3