mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
feat(inko): add support for Inko
This commit is contained in:
parent
c0c32abc51
commit
7441b82fe5
8 changed files with 323 additions and 0 deletions
|
|
@ -280,6 +280,7 @@ We are looking for maintainers to add more parsers and to write query files for
|
|||
- [x] [hyprlang](https://github.com/luckasRanarison/tree-sitter-hyprlang) (maintained by @luckasRanarison)
|
||||
- [x] [idl](https://github.com/cathaysia/tree-sitter-idl) (maintained by @cathaysa)
|
||||
- [x] [ini](https://github.com/justinmk/tree-sitter-ini) (experimental, maintained by @theHamsta)
|
||||
- [x] [inko](https://github.com/inko-lang/tree-sitter-inko) (maintained by @yorickpeterse)
|
||||
- [x] [ispc](https://github.com/fab4100/tree-sitter-ispc) (maintained by @fab4100)
|
||||
- [x] [janet_simple](https://github.com/sogaiu/tree-sitter-janet-simple) (maintained by @sogaiu)
|
||||
- [x] [java](https://github.com/tree-sitter/tree-sitter-java) (maintained by @p00f)
|
||||
|
|
|
|||
|
|
@ -320,6 +320,9 @@
|
|||
"ini": {
|
||||
"revision": "bcb84a2d4bcd6f55b911c42deade75c8f90cb0c5"
|
||||
},
|
||||
"inko": {
|
||||
"revision": "6983354c13a14bc621d7a3619f1790149e901187"
|
||||
},
|
||||
"ispc": {
|
||||
"revision": "9b2f9aec2106b94b4e099fe75e73ebd8ae707c04"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -966,6 +966,14 @@ list.ini = {
|
|||
experimental = true,
|
||||
}
|
||||
|
||||
list.inko = {
|
||||
install_info = {
|
||||
url = "https://github.com/inko-lang/tree-sitter-inko",
|
||||
files = { "src/parser.c" },
|
||||
},
|
||||
maintainers = { "@yorickpeterse" },
|
||||
}
|
||||
|
||||
list.ispc = {
|
||||
install_info = {
|
||||
url = "https://github.com/fab4100/tree-sitter-ispc",
|
||||
|
|
|
|||
17
queries/inko/folds.scm
Normal file
17
queries/inko/folds.scm
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
[
|
||||
(call)
|
||||
(class)
|
||||
(closure)
|
||||
(define_case)
|
||||
(define_constant)
|
||||
(define_field)
|
||||
(define_variable)
|
||||
(external_function)
|
||||
(if)
|
||||
(import)+
|
||||
(loop)
|
||||
(match)
|
||||
(method)
|
||||
(trait)
|
||||
(while)
|
||||
] @fold
|
||||
195
queries/inko/highlights.scm
Normal file
195
queries/inko/highlights.scm
Normal file
|
|
@ -0,0 +1,195 @@
|
|||
; Brackets and operators
|
||||
[
|
||||
"("
|
||||
")"
|
||||
"["
|
||||
"]"
|
||||
"{"
|
||||
"}"
|
||||
] @punctuation.bracket
|
||||
|
||||
[
|
||||
","
|
||||
"->"
|
||||
"."
|
||||
":"
|
||||
] @punctuation.delimiter
|
||||
|
||||
[
|
||||
"!="
|
||||
"%"
|
||||
"%="
|
||||
"&"
|
||||
"&="
|
||||
"*"
|
||||
"**"
|
||||
"**="
|
||||
"*="
|
||||
"+"
|
||||
"+="
|
||||
"-"
|
||||
"-="
|
||||
"/"
|
||||
"/="
|
||||
"<"
|
||||
"<<"
|
||||
"<<="
|
||||
"<="
|
||||
"<="
|
||||
"=="
|
||||
">"
|
||||
">="
|
||||
">="
|
||||
">>"
|
||||
">>="
|
||||
">>>"
|
||||
">>>="
|
||||
"^"
|
||||
"^="
|
||||
"|"
|
||||
"|="
|
||||
] @operator
|
||||
|
||||
; Keywords
|
||||
[
|
||||
"as"
|
||||
"for"
|
||||
"impl"
|
||||
"let"
|
||||
"mut"
|
||||
"ref"
|
||||
"uni"
|
||||
"move"
|
||||
"recover"
|
||||
] @keyword
|
||||
|
||||
"fn" @keyword.function
|
||||
|
||||
"import" @keyword.import
|
||||
|
||||
[
|
||||
"and"
|
||||
"or"
|
||||
] @keyword.operator
|
||||
|
||||
[
|
||||
"class"
|
||||
"trait"
|
||||
] @keyword.type
|
||||
|
||||
[
|
||||
"extern"
|
||||
(modifier)
|
||||
(visibility)
|
||||
] @keyword.modifier
|
||||
|
||||
[
|
||||
"loop"
|
||||
"while"
|
||||
(break)
|
||||
(next)
|
||||
] @keyword.repeat
|
||||
|
||||
"return" @keyword.return
|
||||
|
||||
[
|
||||
"throw"
|
||||
"try"
|
||||
] @keyword.exception
|
||||
|
||||
[
|
||||
"case"
|
||||
"else"
|
||||
"if"
|
||||
"match"
|
||||
] @keyword.conditional
|
||||
|
||||
; Identifiers/variable references
|
||||
(identifier) @variable
|
||||
|
||||
; Comments
|
||||
(line_comment) @comment @spell
|
||||
|
||||
; Literals
|
||||
(self) @variable.builtin
|
||||
|
||||
(nil) @constant.builtin
|
||||
|
||||
[
|
||||
(true)
|
||||
(false)
|
||||
] @boolean
|
||||
|
||||
(integer) @number
|
||||
|
||||
(float) @number.float
|
||||
|
||||
(string) @string
|
||||
|
||||
(escape_sequence) @string.escape
|
||||
|
||||
(interpolation
|
||||
"${" @punctuation.special
|
||||
"}" @punctuation.special) @none
|
||||
|
||||
(constant) @constant
|
||||
|
||||
; Patterns
|
||||
(integer_pattern) @number
|
||||
|
||||
(string_pattern) @string
|
||||
|
||||
(constant_pattern) @constant
|
||||
|
||||
; Types
|
||||
(generic_type
|
||||
name: _ @type)
|
||||
|
||||
(type) @type
|
||||
|
||||
; Imports
|
||||
(extern_import
|
||||
path: _ @string)
|
||||
|
||||
(import
|
||||
(path
|
||||
(identifier) @module))
|
||||
|
||||
; Classes
|
||||
(class
|
||||
name: _ @type)
|
||||
|
||||
(define_field
|
||||
name: _ @variable.member)
|
||||
|
||||
; Traits
|
||||
(trait
|
||||
name: _ @type)
|
||||
|
||||
; Implementations
|
||||
(implement_trait
|
||||
class: _ @type)
|
||||
|
||||
(reopen_class
|
||||
name: _ @type)
|
||||
|
||||
(bound
|
||||
name: _ @type)
|
||||
|
||||
; Methods
|
||||
(method
|
||||
name: _ @function)
|
||||
|
||||
(external_function
|
||||
name: _ @function)
|
||||
|
||||
(argument
|
||||
name: _ @variable.parameter)
|
||||
|
||||
(named_argument
|
||||
name: _ @variable.parameter)
|
||||
|
||||
(call
|
||||
name: _ @function)
|
||||
|
||||
(field) @variable.member
|
||||
40
queries/inko/indents.scm
Normal file
40
queries/inko/indents.scm
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
[
|
||||
(arguments)
|
||||
(array)
|
||||
(assign_field)
|
||||
(assign_local)
|
||||
(assign_receiver_field)
|
||||
(binary)
|
||||
(block)
|
||||
(bounds)
|
||||
(cast)
|
||||
(class)
|
||||
(class_pattern)
|
||||
(compound_assign_field)
|
||||
(compound_assign_local)
|
||||
(compound_assign_receiver_field)
|
||||
(define_constant)
|
||||
(define_variable)
|
||||
(grouped_expression)
|
||||
(implement_trait)
|
||||
(match)
|
||||
(or_pattern)
|
||||
(reopen_class)
|
||||
(replace_field)
|
||||
(replace_local)
|
||||
(symbols)
|
||||
(trait)
|
||||
(tuple)
|
||||
(tuple_pattern)
|
||||
(type_arguments)
|
||||
] @indent.begin
|
||||
|
||||
[
|
||||
")"
|
||||
"]"
|
||||
"}"
|
||||
] @indent.end @indent.branch
|
||||
|
||||
(line_comment) @indent.auto
|
||||
|
||||
(string) @indent.auto
|
||||
2
queries/inko/injections.scm
Normal file
2
queries/inko/injections.scm
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
((line_comment) @injection.content
|
||||
(#set! injection.language "comment"))
|
||||
57
queries/inko/locals.scm
Normal file
57
queries/inko/locals.scm
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
[
|
||||
(method)
|
||||
(block)
|
||||
] @local.scope
|
||||
|
||||
(method
|
||||
name: _ @local.definition.method)
|
||||
|
||||
(external_function
|
||||
name: _ @local.definition.function)
|
||||
|
||||
(argument
|
||||
name: _ @local.definition.parameter)
|
||||
|
||||
(define_variable
|
||||
name: _ @local.definition.var)
|
||||
|
||||
(define_constant
|
||||
name: _ @local.definition.constant)
|
||||
|
||||
(define_field
|
||||
name: _ @local.definition.field)
|
||||
|
||||
(named_argument
|
||||
name: _ @local.definition.parameter)
|
||||
|
||||
(class
|
||||
modifier: (modifier
|
||||
"enum")
|
||||
name: _ @local.definition.enum)
|
||||
|
||||
(class
|
||||
modifier: (modifier
|
||||
"enum")
|
||||
body: (class_body
|
||||
(define_case
|
||||
name: _ @local.definition.field)))
|
||||
|
||||
(class
|
||||
name: _ @local.definition.type)
|
||||
|
||||
(trait
|
||||
name: _ @local.definition.type)
|
||||
|
||||
(import
|
||||
(symbols
|
||||
[
|
||||
(identifier)
|
||||
(constant)
|
||||
(self)
|
||||
] @local.definition.import))
|
||||
|
||||
(identifier) @local.reference
|
||||
|
||||
(field) @local.reference
|
||||
|
||||
(constant) @local.reference
|
||||
Loading…
Add table
Add a link
Reference in a new issue