From f30485f9f489f1e3280ceb8d710337a8d575f0f0 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Fri, 29 Mar 2019 23:05:02 -0700 Subject: [PATCH] Fix accidentally-removed functions in api.h --- lib/include/tree_sitter/api.h | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/lib/include/tree_sitter/api.h b/lib/include/tree_sitter/api.h index 7533153f..d8189930 100644 --- a/lib/include/tree_sitter/api.h +++ b/lib/include/tree_sitter/api.h @@ -350,6 +350,16 @@ void ts_tree_print_dot_graph(const TSTree *, FILE *); /* Section - Node */ /******************/ +/** + * Get the node's type as a null-terminated string. + */ +const char *ts_node_type(TSNode); + +/** + * Get the node's type as a numerical id. + */ +TSSymbol ts_node_symbol(TSNode); + /** * Get the node's start byte. */ @@ -371,10 +381,10 @@ uint32_t ts_node_end_byte(TSNode); TSPoint ts_node_end_point(TSNode); /** - * Get the node's type as a null-terminated string. + * Get an S-expression representing the node as a string. * - * This string is owned by the language and does *not* need to be freed by the - * caller. + * This string is allocated with `malloc` and the caller is responsible for + * freeing it using `free`. */ char *ts_node_string(TSNode);