aboutsummaryrefslogtreecommitdiff
path: root/plugins/language_php.lua
diff options
context:
space:
mode:
authorjgmdev <jgmdev@gmail.com>2022-03-10 00:54:28 -0400
committerjgmdev <jgmdev@gmail.com>2022-03-10 00:56:08 -0400
commitf0d50a9854d0c05819667561d02426344d006ba9 (patch)
tree7aec3143c347fe67238b37685608a0cab6a9c9b2 /plugins/language_php.lua
parent6cafaf1257887c546fffef38ae5278dca03a09f3 (diff)
downloadlite-xl-plugins-f0d50a9854d0c05819667561d02426344d006ba9.tar.gz
lite-xl-plugins-f0d50a9854d0c05819667561d02426344d006ba9.zip
language_php: improved uppercase constants matching
Diffstat (limited to 'plugins/language_php.lua')
-rw-r--r--plugins/language_php.lua7
1 files changed, 5 insertions, 2 deletions
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