mirror of
https://github.com/nvim-treesitter/nvim-treesitter-context
synced 2024-09-16 14:14:03 +02:00
Add support for Odin
This commit is contained in:
parent
5dd8c21211
commit
14856c9ee6
3 changed files with 86 additions and 0 deletions
|
@ -47,6 +47,7 @@ Note: if you need support for Neovim 0.6.x please use the tag `compat/0.6`.
|
|||
- [x] `norg`
|
||||
- [x] `ocaml_interface`
|
||||
- [x] `ocaml`
|
||||
- [x] `odin`
|
||||
- [x] `php`
|
||||
- [x] `prisma`
|
||||
- [x] `python`
|
||||
|
|
8
queries/odin/context.scm
Normal file
8
queries/odin/context.scm
Normal file
|
@ -0,0 +1,8 @@
|
|||
([
|
||||
(struct_declaration)
|
||||
(if_statement)
|
||||
(for_statement)
|
||||
(procedure_declaration)
|
||||
(switch_statement)
|
||||
(switch_case)
|
||||
] @context)
|
77
test/test.odin
Normal file
77
test/test.odin
Normal file
|
@ -0,0 +1,77 @@
|
|||
package main
|
||||
|
||||
import "core:fmt"
|
||||
|
||||
demo_struct :: struct($T: typeid) {
|
||||
name: string,
|
||||
payload: T,
|
||||
// comment
|
||||
// comment
|
||||
// comment
|
||||
// comment
|
||||
// comment
|
||||
// comment
|
||||
// comment
|
||||
// comment
|
||||
// comment
|
||||
// comment
|
||||
// comment
|
||||
// comment
|
||||
// comment
|
||||
|
||||
}
|
||||
|
||||
|
||||
main :: proc() {
|
||||
|
||||
a := 1
|
||||
|
||||
if a > 0 {
|
||||
a = do_stuff(a)
|
||||
|
||||
}
|
||||
|
||||
|
||||
//comment
|
||||
//comment
|
||||
//comment
|
||||
//comment
|
||||
//comment
|
||||
//comment
|
||||
//comment
|
||||
//commen
|
||||
for x:=0; x<100; x+=1 {
|
||||
//comment
|
||||
//comment
|
||||
//comment
|
||||
//comment
|
||||
//comment
|
||||
//comment
|
||||
//comment
|
||||
//comment
|
||||
fmt.printf("{0}\n", x)
|
||||
}
|
||||
//comment
|
||||
fmt.printf("{0}\n", a)
|
||||
}
|
||||
|
||||
do_stuff :: proc(x: int) -> int {
|
||||
switch x {
|
||||
case 1:
|
||||
return 42
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
case 0:
|
||||
return 420
|
||||
}
|
||||
return 0
|
||||
}
|
Loading…
Reference in a new issue