1
1
mirror of https://github.com/github/semantic.git synced 2024-11-24 08:54:07 +03:00

Assert that the data ptr is non-null.

This commit is contained in:
Rob Rix 2015-11-25 17:02:06 -05:00
parent e98fcf3098
commit 81559526ac

View File

@ -10,6 +10,7 @@ void ts_document_root_node_p(TSDocument *document, TSNode *outNode) {
const char *ts_node_p_name(const TSNode *node, const TSDocument *document) {
assert(node != NULL);
assert(node->data != NULL);
assert(document != NULL);
return ts_node_name(*node, document);
}
@ -17,11 +18,13 @@ const char *ts_node_p_name(const TSNode *node, const TSDocument *document) {
size_t ts_node_p_named_child_count(const TSNode *node) {
assert(node != NULL);
assert(node->data != NULL);
return ts_node_named_child_count(*node);
}
void ts_node_p_named_child(const TSNode *node, size_t index, TSNode *outNode) {
assert(node != NULL);
assert(node->data != NULL);
assert(outNode != NULL);
*outNode = ts_node_named_child(*node, index);
}
@ -29,10 +32,12 @@ void ts_node_p_named_child(const TSNode *node, size_t index, TSNode *outNode) {
size_t ts_node_p_pos_chars(const TSNode *node) {
assert(node != NULL);
assert(node->data != NULL);
return ts_node_pos(*node).chars;
}
size_t ts_node_p_size_chars(const TSNode *node) {
assert(node != NULL);
assert(node->data != NULL);
return ts_node_size(*node).chars;
}