Add function tags

This commit is contained in:
Bruno BELANYI 2022-06-03 22:09:53 +02:00
parent 3e1068a336
commit 184d3b9953
2 changed files with 23 additions and 0 deletions

11
queries/tags.scm Normal file
View file

@ -0,0 +1,11 @@
; Functions {{{
(function_declaration
name: (identifier) @name) @definition.function
(primitive_declaration
name: (identifier) @name) @definition.function
(function_call
function: (identifier) @name) @reference.call
; }}}
; vim: sw=2 foldmethod=marker

12
test/tags/functions.tig Normal file
View file

@ -0,0 +1,12 @@
let
primitive print(s: string)
/* ^ definition.function */
function func(a: int) : int = (print("Hello World!"); a)
/* ^ definition.function */
in
print("Hello World!\n");
/* <- reference.call */
func(42)
/* <- reference.call */
end