feat: add basic tree-sitter

This commit is contained in:
2025-07-25 22:44:54 +02:00
commit 8a25af390d
38 changed files with 8090 additions and 0 deletions

15
bindings/go/binding.go generated Normal file
View File

@@ -0,0 +1,15 @@
package tree_sitter_noil
// #cgo CFLAGS: -std=c11 -fPIC
// #include "../../src/parser.c"
// #if __has_include("../../src/scanner.c")
// #include "../../src/scanner.c"
// #endif
import "C"
import "unsafe"
// Get the tree-sitter Language for this grammar.
func Language() unsafe.Pointer {
return unsafe.Pointer(C.tree_sitter_noil())
}

15
bindings/go/binding_test.go generated Normal file
View File

@@ -0,0 +1,15 @@
package tree_sitter_noil_test
import (
"testing"
tree_sitter "github.com/tree-sitter/go-tree-sitter"
tree_sitter_noil "git.front.kjuulh.io/kjuulh/tree-sitter-noil/bindings/go"
)
func TestCanLoadGrammar(t *testing.T) {
language := tree_sitter.NewLanguage(tree_sitter_noil.Language())
if language == nil {
t.Errorf("Error loading Noil grammar")
}
}