First commit

This commit is contained in:
Ella Dunbar 2025-10-18 16:58:19 -05:00
commit 9392139a9c
47 changed files with 9107 additions and 0 deletions

13
bindings/go/binding.go generated Normal file
View file

@ -0,0 +1,13 @@
package tree_sitter_your_language_name
// #cgo CFLAGS: -std=c11 -fPIC
// #include "../../src/parser.c"
// // NOTE: if your language has an external scanner, add it here.
import "C"
import "unsafe"
// Get the tree-sitter Language for this grammar.
func Language() unsafe.Pointer {
return unsafe.Pointer(C.tree_sitter_your_language_name())
}

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

@ -0,0 +1,15 @@
package tree_sitter_your_language_name_test
import (
"testing"
tree_sitter "github.com/tree-sitter/go-tree-sitter"
tree_sitter_your_language_name "github.com/tree-sitter/tree-sitter-YOUR_LANGUAGE_NAME/bindings/go"
)
func TestCanLoadGrammar(t *testing.T) {
language := tree_sitter.NewLanguage(tree_sitter_your_language_name.Language())
if language == nil {
t.Errorf("Error loading YourLanguageName grammar")
}
}