Add function tags
This commit is contained in:
parent
3e1068a336
commit
184d3b9953
2 changed files with 23 additions and 0 deletions
11
queries/tags.scm
Normal file
11
queries/tags.scm
Normal 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
12
test/tags/functions.tig
Normal 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
|
||||||
Loading…
Add table
Add a link
Reference in a new issue