mirror of
https://github.com/github/semantic.git
synced 2024-12-26 08:25:19 +03:00
None of these may be NULL.
This commit is contained in:
parent
855a8bc51b
commit
0b735a697d
10
app/bridge.c
10
app/bridge.c
@ -1,28 +1,38 @@
|
|||||||
#include "bridge.h"
|
#include "bridge.h"
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
void ts_document_root_node_p(TSDocument *document, TSNode *outNode) {
|
void ts_document_root_node_p(TSDocument *document, TSNode *outNode) {
|
||||||
|
assert(document != NULL);
|
||||||
|
assert(outNode != NULL);
|
||||||
*outNode = ts_document_root_node(document);
|
*outNode = ts_document_root_node(document);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const char *ts_node_p_name(const TSNode *node, const TSDocument *document) {
|
const char *ts_node_p_name(const TSNode *node, const TSDocument *document) {
|
||||||
|
assert(node != NULL);
|
||||||
|
assert(document != NULL);
|
||||||
return ts_node_name(*node, document);
|
return ts_node_name(*node, document);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
size_t ts_node_p_named_child_count(const TSNode *node) {
|
size_t ts_node_p_named_child_count(const TSNode *node) {
|
||||||
|
assert(node != NULL);
|
||||||
return ts_node_named_child_count(*node);
|
return ts_node_named_child_count(*node);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ts_node_p_named_child(const TSNode *node, size_t index, TSNode *outNode) {
|
void ts_node_p_named_child(const TSNode *node, size_t index, TSNode *outNode) {
|
||||||
|
assert(node != NULL);
|
||||||
|
assert(outNode != NULL);
|
||||||
*outNode = ts_node_named_child(*node, index);
|
*outNode = ts_node_named_child(*node, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
size_t ts_node_p_pos_chars(const TSNode *node) {
|
size_t ts_node_p_pos_chars(const TSNode *node) {
|
||||||
|
assert(node != NULL);
|
||||||
return ts_node_pos(*node).chars;
|
return ts_node_pos(*node).chars;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t ts_node_p_size_chars(const TSNode *node) {
|
size_t ts_node_p_size_chars(const TSNode *node) {
|
||||||
|
assert(node != NULL);
|
||||||
return ts_node_size(*node).chars;
|
return ts_node_size(*node).chars;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user