mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-21 04:40:08 -04:00
feat: add func
This commit is contained in:
parent
69867ffe7e
commit
660a070af7
4 changed files with 207 additions and 0 deletions
|
|
@ -211,6 +211,7 @@ We are looking for maintainers to add more parsers and to write query files for
|
||||||
- [x] [foam](https://github.com/FoamScience/tree-sitter-foam) (experimental, maintained by @FoamScience)
|
- [x] [foam](https://github.com/FoamScience/tree-sitter-foam) (experimental, maintained by @FoamScience)
|
||||||
- [ ] [fortran](https://github.com/stadelmanma/tree-sitter-fortran)
|
- [ ] [fortran](https://github.com/stadelmanma/tree-sitter-fortran)
|
||||||
- [x] [fsh](https://github.com/mgramigna/tree-sitter-fsh) (maintained by @mgramigna)
|
- [x] [fsh](https://github.com/mgramigna/tree-sitter-fsh) (maintained by @mgramigna)
|
||||||
|
- [x] [func](https://github.com/amaanq/tree-sitter-func) (maintained by @amaanq)
|
||||||
- [x] [fusion](https://gitlab.com/jirgn/tree-sitter-fusion.git) (maintained by @jirgn)
|
- [x] [fusion](https://gitlab.com/jirgn/tree-sitter-fusion.git) (maintained by @jirgn)
|
||||||
- [x] [Godot (gdscript)](https://github.com/PrestonKnopp/tree-sitter-gdscript) (maintained by @Shatur)
|
- [x] [Godot (gdscript)](https://github.com/PrestonKnopp/tree-sitter-gdscript) (maintained by @Shatur)
|
||||||
- [x] [git_rebase](https://github.com/the-mikedavis/tree-sitter-git-rebase) (maintained by @gbprod)
|
- [x] [git_rebase](https://github.com/the-mikedavis/tree-sitter-git-rebase) (maintained by @gbprod)
|
||||||
|
|
|
||||||
|
|
@ -116,6 +116,9 @@
|
||||||
"fsh": {
|
"fsh": {
|
||||||
"revision": "fa3347712f7a59ed02ccf508284554689c6cde28"
|
"revision": "fa3347712f7a59ed02ccf508284554689c6cde28"
|
||||||
},
|
},
|
||||||
|
"func": {
|
||||||
|
"revision": "ea161a03f738872426c9bcc207ec0f4763f9672c"
|
||||||
|
},
|
||||||
"fusion": {
|
"fusion": {
|
||||||
"revision": "19db2f47ba4c3a0f6238d4ae0e2abfca16e61dd6"
|
"revision": "19db2f47ba4c3a0f6238d4ae0e2abfca16e61dd6"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -262,6 +262,15 @@ list.fsh = {
|
||||||
maintainers = { "@mgramigna" },
|
maintainers = { "@mgramigna" },
|
||||||
}
|
}
|
||||||
|
|
||||||
|
list.func = {
|
||||||
|
install_info = {
|
||||||
|
url = "https://github.com/amaanq/tree-sitter-func",
|
||||||
|
files = { "src/parser.c" },
|
||||||
|
branch = "master",
|
||||||
|
},
|
||||||
|
maintainers = { "@amaanq" },
|
||||||
|
}
|
||||||
|
|
||||||
list.fusion = {
|
list.fusion = {
|
||||||
install_info = {
|
install_info = {
|
||||||
url = "https://gitlab.com/jirgn/tree-sitter-fusion.git",
|
url = "https://gitlab.com/jirgn/tree-sitter-fusion.git",
|
||||||
|
|
|
||||||
194
queries/func/highlights.scm
Normal file
194
queries/func/highlights.scm
Normal file
|
|
@ -0,0 +1,194 @@
|
||||||
|
; Include
|
||||||
|
|
||||||
|
"#include" @include
|
||||||
|
(include_path) @string
|
||||||
|
|
||||||
|
; Preproc
|
||||||
|
|
||||||
|
[
|
||||||
|
"#pragma"
|
||||||
|
] @preproc
|
||||||
|
|
||||||
|
(pragma_directive
|
||||||
|
[
|
||||||
|
"version"
|
||||||
|
"not-version"
|
||||||
|
"test-version-set"
|
||||||
|
] @preproc)
|
||||||
|
|
||||||
|
; Functions/Methods
|
||||||
|
|
||||||
|
(function_definition
|
||||||
|
name: (function_name) @function)
|
||||||
|
|
||||||
|
(function_application
|
||||||
|
function: (identifier) @function)
|
||||||
|
|
||||||
|
(method_call
|
||||||
|
method_name: (identifier) @method.call)
|
||||||
|
|
||||||
|
; Parameters
|
||||||
|
|
||||||
|
(parameter) @parameter
|
||||||
|
|
||||||
|
(function_application
|
||||||
|
arguments: [(identifier) (underscore)] @parameter)
|
||||||
|
(function_application
|
||||||
|
arguments: (tensor_expression
|
||||||
|
(identifier) @parameter))
|
||||||
|
(function_application
|
||||||
|
arguments: (parenthesized_expression
|
||||||
|
(identifier) @parameter))
|
||||||
|
|
||||||
|
(method_call
|
||||||
|
arguments: [(identifier) (underscore)] @parameter)
|
||||||
|
(method_call
|
||||||
|
arguments: (tensor_expression
|
||||||
|
(identifier) @parameter))
|
||||||
|
(method_call
|
||||||
|
arguments: (parenthesized_expression
|
||||||
|
(identifier) @parameter))
|
||||||
|
|
||||||
|
; Constants
|
||||||
|
|
||||||
|
(const_var_declarations
|
||||||
|
name: (identifier) @constant)
|
||||||
|
(unit_literal) @constant.builtin
|
||||||
|
|
||||||
|
; Variables
|
||||||
|
|
||||||
|
(identifier) @variable
|
||||||
|
|
||||||
|
; Types
|
||||||
|
|
||||||
|
(type_identifier) @type
|
||||||
|
(primitive_type) @type.builtin
|
||||||
|
(unit_type) @type.builtin
|
||||||
|
|
||||||
|
; Operators
|
||||||
|
|
||||||
|
[
|
||||||
|
"="
|
||||||
|
"+="
|
||||||
|
"-="
|
||||||
|
"*="
|
||||||
|
"/="
|
||||||
|
"~/="
|
||||||
|
"^/="
|
||||||
|
"%="
|
||||||
|
"~%="
|
||||||
|
"^%="
|
||||||
|
"<<="
|
||||||
|
">>="
|
||||||
|
"~>>="
|
||||||
|
"^>>="
|
||||||
|
"&="
|
||||||
|
"|="
|
||||||
|
"^="
|
||||||
|
"=="
|
||||||
|
"<"
|
||||||
|
">"
|
||||||
|
"<="
|
||||||
|
">="
|
||||||
|
"!="
|
||||||
|
"<=>"
|
||||||
|
"<<"
|
||||||
|
">>"
|
||||||
|
"~>>"
|
||||||
|
"^>>"
|
||||||
|
"-"
|
||||||
|
"+"
|
||||||
|
"|"
|
||||||
|
"^"
|
||||||
|
"*"
|
||||||
|
"/"
|
||||||
|
"%"
|
||||||
|
"~/"
|
||||||
|
"^/"
|
||||||
|
"~%"
|
||||||
|
"^%"
|
||||||
|
"/%"
|
||||||
|
"&"
|
||||||
|
"~"
|
||||||
|
] @operator
|
||||||
|
|
||||||
|
; Keywords
|
||||||
|
|
||||||
|
[
|
||||||
|
"asm"
|
||||||
|
"impure"
|
||||||
|
"inline"
|
||||||
|
"inline_ref"
|
||||||
|
"method_id"
|
||||||
|
"try"
|
||||||
|
"type"
|
||||||
|
] @keyword
|
||||||
|
|
||||||
|
[
|
||||||
|
"return"
|
||||||
|
] @keyword.return
|
||||||
|
|
||||||
|
; Conditionals
|
||||||
|
|
||||||
|
[
|
||||||
|
"if"
|
||||||
|
"ifnot"
|
||||||
|
"else"
|
||||||
|
"elseif"
|
||||||
|
"elseifnot"
|
||||||
|
"until"
|
||||||
|
] @conditional
|
||||||
|
|
||||||
|
; Exceptions
|
||||||
|
|
||||||
|
[
|
||||||
|
"catch"
|
||||||
|
] @exception
|
||||||
|
|
||||||
|
; Repeats
|
||||||
|
|
||||||
|
[
|
||||||
|
"do"
|
||||||
|
"forall"
|
||||||
|
"repeat"
|
||||||
|
"while"
|
||||||
|
] @repeat
|
||||||
|
|
||||||
|
; Qualifiers
|
||||||
|
[
|
||||||
|
"const"
|
||||||
|
"global"
|
||||||
|
(var)
|
||||||
|
] @type.qualifier
|
||||||
|
|
||||||
|
; Literals
|
||||||
|
|
||||||
|
[
|
||||||
|
(string)
|
||||||
|
(asm_instruction)
|
||||||
|
] @string
|
||||||
|
|
||||||
|
[
|
||||||
|
(string_type)
|
||||||
|
(underscore)
|
||||||
|
] @character.special
|
||||||
|
|
||||||
|
(number) @number
|
||||||
|
|
||||||
|
; Punctuation
|
||||||
|
|
||||||
|
["{" "}"] @punctuation.bracket
|
||||||
|
|
||||||
|
["(" ")"] @punctuation.bracket
|
||||||
|
|
||||||
|
["[" "]"] @punctuation.bracket
|
||||||
|
|
||||||
|
[
|
||||||
|
";"
|
||||||
|
","
|
||||||
|
"->"
|
||||||
|
] @punctuation.delimiter
|
||||||
|
|
||||||
|
; Comments
|
||||||
|
|
||||||
|
(comment) @comment @spell
|
||||||
Loading…
Add table
Add a link
Reference in a new issue