mirror of
https://github.com/elladunbar/tree-sitter-hy.git
synced 2025-11-05 14:59:55 -06:00
Initial commit
This commit is contained in:
commit
a0e03ddd73
31 changed files with 948 additions and 0 deletions
15
bindings/go/binding.go
generated
Normal file
15
bindings/go/binding.go
generated
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
package tree_sitter_hy
|
||||
|
||||
// #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_hy())
|
||||
}
|
||||
15
bindings/go/binding_test.go
generated
Normal file
15
bindings/go/binding_test.go
generated
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
package tree_sitter_hy_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
tree_sitter "github.com/tree-sitter/go-tree-sitter"
|
||||
tree_sitter_hy "github.com/evdunbar/tree-sitter-hy/bindings/go"
|
||||
)
|
||||
|
||||
func TestCanLoadGrammar(t *testing.T) {
|
||||
language := tree_sitter.NewLanguage(tree_sitter_hy.Language())
|
||||
if language == nil {
|
||||
t.Errorf("Error loading Hy grammar")
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue