diff options
author | jgmdev <jgmdev@gmail.com> | 2022-03-10 00:54:28 -0400 |
---|---|---|
committer | jgmdev <jgmdev@gmail.com> | 2022-03-10 00:56:08 -0400 |
commit | f0d50a9854d0c05819667561d02426344d006ba9 (patch) | |
tree | 7aec3143c347fe67238b37685608a0cab6a9c9b2 | |
parent | 6cafaf1257887c546fffef38ae5278dca03a09f3 (diff) | |
download | lite-xl-plugins-f0d50a9854d0c05819667561d02426344d006ba9.tar.gz lite-xl-plugins-f0d50a9854d0c05819667561d02426344d006ba9.zip |
language_php: improved uppercase constants matching
-rw-r--r-- | plugins/language_php.lua | 7 |
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 |