From e0f47829780791975b334bd1b5a971d087bc829d Mon Sep 17 00:00:00 2001 From: Amaan Qureshi Date: Sat, 12 Aug 2023 21:16:08 -0400 Subject: [PATCH] feat(c): mention how to highlight K&R functions --- queries/c/highlights.scm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/queries/c/highlights.scm b/queries/c/highlights.scm index 29fb5747c..4acdaed99 100644 --- a/queries/c/highlights.scm +++ b/queries/c/highlights.scm @@ -244,6 +244,29 @@ (parameter_declaration declarator: (pointer_declarator) @parameter) +; K&R functions +; To enable support for K&R functions, +; add the following lines to your own query config and uncomment them. +; They are commented out as they'll conflict with C++ +; Note that you'll need to have `; extends` at the top of your query file. +; +; (parameter_list (identifier) @parameter) +; +; (function_definition +; declarator: _ +; (declaration +; declarator: (identifier) @parameter)) +; +; (function_definition +; declarator: _ +; (declaration +; declarator: (array_declarator) @parameter)) +; +; (function_definition +; declarator: _ +; (declaration +; declarator: (pointer_declarator) @parameter)) + (preproc_params (identifier) @parameter) [