First Commit

This commit is contained in:
Fabian Stamm
2024-10-01 23:48:00 +02:00
commit 69a6f0444e
37 changed files with 5797 additions and 0 deletions

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

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

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

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