aboutsummaryrefslogtreecommitdiffstats
path: root/queries/cpp/highlights.scm
diff options
context:
space:
mode:
authorStephan Seitz <stephan.seitz@fau.de>2021-04-23 17:33:00 +0200
committerStephan Seitz <stephan.lauf@yahoo.de>2021-04-26 01:18:28 +0200
commit19efc3d8f31523148bf460d339cc524bf58bfef2 (patch)
tree541bb64aeac1c016242d18536f1f02e3aff9ed78 /queries/cpp/highlights.scm
parenthighlights(cpp): avoid overwriting C CONSTANTS (diff)
downloadnvim-treesitter-19efc3d8f31523148bf460d339cc524bf58bfef2.tar
nvim-treesitter-19efc3d8f31523148bf460d339cc524bf58bfef2.tar.gz
nvim-treesitter-19efc3d8f31523148bf460d339cc524bf58bfef2.tar.bz2
nvim-treesitter-19efc3d8f31523148bf460d339cc524bf58bfef2.tar.lz
nvim-treesitter-19efc3d8f31523148bf460d339cc524bf58bfef2.tar.xz
nvim-treesitter-19efc3d8f31523148bf460d339cc524bf58bfef2.tar.zst
nvim-treesitter-19efc3d8f31523148bf460d339cc524bf58bfef2.zip
highlights(cpp): reduce number of regexes
Diffstat (limited to 'queries/cpp/highlights.scm')
-rw-r--r--queries/cpp/highlights.scm12
1 files changed, 3 insertions, 9 deletions
diff --git a/queries/cpp/highlights.scm b/queries/cpp/highlights.scm
index 1efdf759a..36d8531df 100644
--- a/queries/cpp/highlights.scm
+++ b/queries/cpp/highlights.scm
@@ -1,13 +1,7 @@
; inherits: c
((identifier) @field
- (#match? @field "^_"))
-
-((identifier) @field
- (#match? @field "^m_"))
-
-((identifier) @field
- (#match? @field "_$"))
+ (#match? @field "(^_|^m_|_$)"))
(parameter_declaration
declarator: (reference_declarator) @parameter)
@@ -39,12 +33,12 @@
((identifier) @type
- (#match? @type "^[A-Z][a-z]")
+ (#match? @type "^[A-Z].*[a-z]")
(#not-has-parent? @type function_declarator))
(namespace_identifier) @namespace
((namespace_identifier) @type
- (#match? @type "^[A-Z].*[a-z]"))
+ (#match? @type "^[A-Z]"))
((namespace_identifier) @constant
(#match? @constant "^[A-Z][A-Z_0-9]*$"))
(namespace_definition