aboutsummaryrefslogtreecommitdiffstats
path: root/tests/query/highlights/c
diff options
context:
space:
mode:
authorStephan Seitz <sseitz@nvidia.com>2021-12-20 14:50:59 +0100
committerStephan Seitz <stephan.seitz@fau.de>2022-01-29 13:11:56 +0100
commite4675bc410ebf7889e63a691f59d5760aec4e0e9 (patch)
tree1c42d2a0adb51a35014ec94ed721f7d7b86e63ac /tests/query/highlights/c
parenthighlights(c): highlight enum variants as `@constant` (diff)
downloadnvim-treesitter-e4675bc410ebf7889e63a691f59d5760aec4e0e9.tar
nvim-treesitter-e4675bc410ebf7889e63a691f59d5760aec4e0e9.tar.gz
nvim-treesitter-e4675bc410ebf7889e63a691f59d5760aec4e0e9.tar.bz2
nvim-treesitter-e4675bc410ebf7889e63a691f59d5760aec4e0e9.tar.lz
nvim-treesitter-e4675bc410ebf7889e63a691f59d5760aec4e0e9.tar.xz
nvim-treesitter-e4675bc410ebf7889e63a691f59d5760aec4e0e9.tar.zst
nvim-treesitter-e4675bc410ebf7889e63a691f59d5760aec4e0e9.zip
highlights(c/cpp): highlight case labels as constants
Diffstat (limited to 'tests/query/highlights/c')
-rw-r--r--tests/query/highlights/c/enums-as-constants.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/query/highlights/c/enums-as-constants.c b/tests/query/highlights/c/enums-as-constants.c
new file mode 100644
index 000000000..8e6474466
--- /dev/null
+++ b/tests/query/highlights/c/enums-as-constants.c
@@ -0,0 +1,21 @@
+enum Foo{
+ a,
+// ^ @constant
+ aa,
+// ^ @constant
+ C,
+};
+
+void foo(enum Foo f){
+ switch ( f ) {
+ case a:
+ // ^ @constant
+ break;
+ case aa:
+ // ^ @constant
+ break;
+ case C:
+ break;
+ default:
+ }
+}