For now, don't implement ts_tree_print_dot_graph on windows

This commit is contained in:
Max Brunsfeld 2023-02-13 23:18:35 -08:00
parent 0b817a609f
commit 450c67484b

View file

@ -1,4 +1,3 @@
#include <unistd.h>
#include "tree_sitter/api.h"
#include "./array.h"
#include "./get_changed_ranges.h"
@ -124,8 +123,21 @@ TSRange *ts_tree_get_changed_ranges(const TSTree *self, const TSTree *other, uin
return result;
}
#ifdef _WIN32
void ts_tree_print_dot_graph(const TSTree *self, int fd) {
(void)self;
(void)fd;
}
#else
#include <unistd.h>
void ts_tree_print_dot_graph(const TSTree *self, int fd) {
FILE *file = fdopen(dup(fd), "a");
ts_subtree_print_dot_graph(self->root, self->language, file);
fclose(file);
}
#endif