aboutsummaryrefslogtreecommitdiffstats
path: root/queries/php
diff options
context:
space:
mode:
authorMichael Härtl <haertl.mike@gmail.com>2022-01-19 17:41:42 +0100
committerStephan Seitz <stephan.seitz@fau.de>2022-01-19 19:17:01 +0100
commit983c46d55cb796fd623d43e3510bce7b21d0d1a6 (patch)
tree07ec3ad5b6b105352b2191d6ede414f372b9d3e4 /queries/php
parentdocs(CONTRIBUTING.md): mention Neovim's tree-sitter Matrix channel (#2294) (diff)
downloadnvim-treesitter-983c46d55cb796fd623d43e3510bce7b21d0d1a6.tar
nvim-treesitter-983c46d55cb796fd623d43e3510bce7b21d0d1a6.tar.gz
nvim-treesitter-983c46d55cb796fd623d43e3510bce7b21d0d1a6.tar.bz2
nvim-treesitter-983c46d55cb796fd623d43e3510bce7b21d0d1a6.tar.lz
nvim-treesitter-983c46d55cb796fd623d43e3510bce7b21d0d1a6.tar.xz
nvim-treesitter-983c46d55cb796fd623d43e3510bce7b21d0d1a6.tar.zst
nvim-treesitter-983c46d55cb796fd623d43e3510bce7b21d0d1a6.zip
fix(php) match magic and single letter constants
Diffstat (limited to 'queries/php')
-rw-r--r--queries/php/highlights.scm4
1 files changed, 3 insertions, 1 deletions
diff --git a/queries/php/highlights.scm b/queries/php/highlights.scm
index 1d8f01584..4188a35ec 100644
--- a/queries/php/highlights.scm
+++ b/queries/php/highlights.scm
@@ -82,7 +82,9 @@
(relative_scope) @variable.builtin
((name) @constant
- (#vim-match? @constant "^_?[A-Z][A-Z\d_]+$"))
+ (#vim-match? @constant "^_?[A-Z][A-Z\d_]*$"))
+((name) @constant.builtin
+ (#vim-match? @constant.builtin "^__[A-Z][A-Z\d_]+__$"))
(const_declaration (const_element (name) @constant))