tree sitter update

This commit is contained in:
ProgramSnail 2024-09-19 20:46:15 +03:00
parent c0377d1a1b
commit aaabbb5d6a
22 changed files with 505 additions and 45 deletions

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

@ -0,0 +1,13 @@
package tree_sitter_lang
// #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_lang())
}

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

@ -0,0 +1,15 @@
package tree_sitter_lang_test
import (
"testing"
tree_sitter "github.com/smacker/go-tree-sitter"
"github.com/tree-sitter/tree-sitter-lang"
)
func TestCanLoadGrammar(t *testing.T) {
language := tree_sitter.NewLanguage(tree_sitter_lang.Language())
if language == nil {
t.Errorf("Error loading Lang grammar")
}
}

5
bindings/go/go.mod generated Normal file
View file

@ -0,0 +1,5 @@
module github.com/tree-sitter/tree-sitter-lang
go 1.22
require github.com/smacker/go-tree-sitter v0.0.0-20230720070738-0d0a9f78d8f8