diff options
| author | Amaan Qureshi <amaanq12@gmail.com> | 2023-08-10 15:43:25 -0400 |
|---|---|---|
| committer | Amaan Qureshi <amaanq12@gmail.com> | 2023-08-11 14:38:50 -0400 |
| commit | acd9d2115dbdf26d39dbd9614f4d0592a226604e (patch) | |
| tree | 7bf564746634a64e9b92ad92dcd9320e0c49ca7a | |
| parent | Update parsers: arduino, ispc (#5229) (diff) | |
| download | nvim-treesitter-acd9d2115dbdf26d39dbd9614f4d0592a226604e.tar nvim-treesitter-acd9d2115dbdf26d39dbd9614f4d0592a226604e.tar.gz nvim-treesitter-acd9d2115dbdf26d39dbd9614f4d0592a226604e.tar.bz2 nvim-treesitter-acd9d2115dbdf26d39dbd9614f4d0592a226604e.tar.lz nvim-treesitter-acd9d2115dbdf26d39dbd9614f4d0592a226604e.tar.xz nvim-treesitter-acd9d2115dbdf26d39dbd9614f4d0592a226604e.tar.zst nvim-treesitter-acd9d2115dbdf26d39dbd9614f4d0592a226604e.zip | |
feat(c): update highlights
| -rw-r--r-- | queries/c/highlights.scm | 43 |
1 files changed, 40 insertions, 3 deletions
diff --git a/queries/c/highlights.scm b/queries/c/highlights.scm index 83fe8b061..29fb5747c 100644 --- a/queries/c/highlights.scm +++ b/queries/c/highlights.scm @@ -17,6 +17,7 @@ "sizeof" "offsetof" ] @keyword.operator +(alignof_expression . _ @keyword.operator) "return" @keyword.return @@ -142,8 +143,9 @@ (storage_class_specifier) @storageclass [ - (type_qualifier) + (type_qualifier) (gnu_asm_qualifier) + "__extension__" ] @type.qualifier (linkage_specification @@ -166,9 +168,44 @@ value: (identifier) @constant) ((identifier) @constant.builtin - (#any-of? @constant.builtin "stderr" "stdin" "stdout")) + (#any-of? @constant.builtin + "stderr" "stdin" "stdout" + "__FILE__" "__LINE__" "__DATE__" "__TIME__" + "__STDC__" "__STDC_VERSION__" "__STDC_HOSTED__" + "__cplusplus" "__OBJC__" "__ASSEMBLER__" + "__BASE_FILE__" "__FILE_NAME__" "__INCLUDE_LEVEL__" + "__TIMESTAMP__" "__clang__" "__clang_major__" + "__clang_minor__" "__clang_patchlevel__" + "__clang_version__" "__clang_literal_encoding__" + "__clang_wide_literal_encoding__" + "__FUNCTION__" "__func__" "__PRETTY_FUNCTION__" + "__VA_ARGS__" "__VA_OPT__")) (preproc_def (preproc_arg) @constant.builtin - (#any-of? @constant.builtin "stderr" "stdin" "stdout")) + (#any-of? @constant.builtin + "stderr" "stdin" "stdout" + "__FILE__" "__LINE__" "__DATE__" "__TIME__" + "__STDC__" "__STDC_VERSION__" "__STDC_HOSTED__" + "__cplusplus" "__OBJC__" "__ASSEMBLER__" + "__BASE_FILE__" "__FILE_NAME__" "__INCLUDE_LEVEL__" + "__TIMESTAMP__" "__clang__" "__clang_major__" + "__clang_minor__" "__clang_patchlevel__" + "__clang_version__" "__clang_literal_encoding__" + "__clang_wide_literal_encoding__" + "__FUNCTION__" "__func__" "__PRETTY_FUNCTION__" + "__VA_ARGS__" "__VA_OPT__")) + +(attribute_specifier + (argument_list (identifier) @variable.builtin)) +((attribute_specifier + (argument_list (call_expression + function: (identifier) @variable.builtin)))) + +((call_expression + function: (identifier) @function.builtin) + (#lua-match? @function.builtin "^__builtin_")) +((call_expression + function: (identifier) @function.builtin) + (#has-ancestor? @function.builtin attribute_specifier)) ;; Preproc def / undef (preproc_def |
