diff --git a/src/scanner.c b/src/scanner.c index d628a31..7e76322 100644 --- a/src/scanner.c +++ b/src/scanner.c @@ -1,4 +1,5 @@ #include "tag.h" +#include "tree_sitter/parser.h" #include #include @@ -413,7 +414,7 @@ static bool scan(Scanner *scanner, TSLexer *lexer, const bool *valid_symbols) { } void *tree_sitter_svelte_external_scanner_create() { - Scanner *scanner = (Scanner *)calloc(1, sizeof(Scanner)); + Scanner *scanner = (Scanner *)ts_calloc(1, sizeof(Scanner)); return scanner; } @@ -438,5 +439,5 @@ void tree_sitter_svelte_external_scanner_destroy(void *payload) { tag_free(array_get(&scanner->tags, i)); } array_delete(&scanner->tags); - free(scanner); + ts_free(scanner); } diff --git a/src/tag.h b/src/tag.h index 357f3eb..839e531 100644 --- a/src/tag.h +++ b/src/tag.h @@ -1,7 +1,5 @@ #include "tree_sitter/array.h" -#include "tree_sitter/parser.h" -#include #include typedef enum {