fix(bindings): update zig template files (#4637)
This commit is contained in:
parent
f7838748df
commit
d87921bb9c
5 changed files with 99 additions and 59 deletions
|
|
@ -1,19 +1,5 @@
|
|||
const testing = @import("std").testing;
|
||||
extern fn tree_sitter_PARSER_NAME() callconv(.c) *const anyopaque;
|
||||
|
||||
const ts = @import("tree-sitter");
|
||||
const Language = ts.Language;
|
||||
const Parser = ts.Parser;
|
||||
|
||||
pub extern fn tree_sitter_PARSER_NAME() callconv(.C) *const Language;
|
||||
|
||||
pub export fn language() *const Language {
|
||||
pub fn language() *const anyopaque {
|
||||
return tree_sitter_PARSER_NAME();
|
||||
}
|
||||
|
||||
test "can load grammar" {
|
||||
const parser = Parser.create();
|
||||
defer parser.destroy();
|
||||
try testing.expectEqual(parser.setLanguage(language()), void{});
|
||||
try testing.expectEqual(parser.getLanguage(), tree_sitter_PARSER_NAME());
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue