Rename ts_document_make -> ts_document_new
This commit is contained in:
parent
57c0170dd3
commit
64a6c9db0e
7 changed files with 11 additions and 11 deletions
|
|
@ -82,7 +82,7 @@ TSNode ts_node_prev_named_sibling(TSNode);
|
|||
TSNode ts_node_descendant_for_range(TSNode, size_t, size_t);
|
||||
TSNode ts_node_named_descendant_for_range(TSNode, size_t, size_t);
|
||||
|
||||
TSDocument *ts_document_make();
|
||||
TSDocument *ts_document_new();
|
||||
void ts_document_free(TSDocument *);
|
||||
const TSLanguage *ts_document_language(TSDocument *);
|
||||
void ts_document_set_language(TSDocument *, const TSLanguage *);
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ describe("compile_grammar", []() {
|
|||
TSDocument *document;
|
||||
|
||||
before_each([&]() {
|
||||
document = ts_document_make();
|
||||
document = ts_document_new();
|
||||
});
|
||||
|
||||
after_each([&]() {
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ describe("The Corpus", []() {
|
|||
|
||||
before_each([&]() {
|
||||
record_alloc::start();
|
||||
document = ts_document_make();
|
||||
document = ts_document_new();
|
||||
ts_document_set_language(document, get_test_language(language_name));
|
||||
|
||||
// ts_document_set_debugger(document, log_debugger_make(true));
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ describe("Document", [&]() {
|
|||
|
||||
before_each([&]() {
|
||||
record_alloc::start();
|
||||
doc = ts_document_make();
|
||||
doc = ts_document_new();
|
||||
});
|
||||
|
||||
after_each([&]() {
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ describe("Node", []() {
|
|||
before_each([&]() {
|
||||
record_alloc::start();
|
||||
|
||||
document = ts_document_make();
|
||||
document = ts_document_new();
|
||||
ts_document_set_language(document, get_test_language("json"));
|
||||
ts_document_set_input_string(document, input_string.c_str());
|
||||
ts_document_parse(document);
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ describe("Parser", [&]() {
|
|||
chunk_size = 3;
|
||||
input = nullptr;
|
||||
|
||||
doc = ts_document_make();
|
||||
doc = ts_document_new();
|
||||
});
|
||||
|
||||
after_each([&]() {
|
||||
|
|
@ -461,7 +461,7 @@ describe("Parser", [&]() {
|
|||
it("handles failures when allocating documents", [&]() {
|
||||
record_alloc::start();
|
||||
|
||||
TSDocument *document = ts_document_make();
|
||||
TSDocument *document = ts_document_new();
|
||||
ts_document_free(document);
|
||||
AssertThat(record_alloc::outstanding_allocation_indices(), IsEmpty());
|
||||
|
||||
|
|
@ -471,7 +471,7 @@ describe("Parser", [&]() {
|
|||
for (size_t i = 0; i < allocation_count; i++) {
|
||||
record_alloc::start();
|
||||
record_alloc::fail_at_allocation_index(i);
|
||||
AssertThat(ts_document_make(), Equals<TSDocument *>(nullptr));
|
||||
AssertThat(ts_document_new(), Equals<TSDocument *>(nullptr));
|
||||
AssertThat(record_alloc::outstanding_allocation_indices(), IsEmpty());
|
||||
}
|
||||
|
||||
|
|
@ -507,7 +507,7 @@ describe("Parser", [&]() {
|
|||
|
||||
for (size_t i = 0; i < allocation_count; i++) {
|
||||
record_alloc::stop();
|
||||
doc = ts_document_make();
|
||||
doc = ts_document_new();
|
||||
|
||||
record_alloc::start();
|
||||
record_alloc::fail_at_allocation_index(i);
|
||||
|
|
@ -522,7 +522,7 @@ describe("Parser", [&]() {
|
|||
}
|
||||
|
||||
record_alloc::stop();
|
||||
doc = ts_document_make();
|
||||
doc = ts_document_new();
|
||||
|
||||
record_alloc::start();
|
||||
record_alloc::fail_at_allocation_index(allocation_count + 1);
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
#include "runtime/string_input.h"
|
||||
#include "runtime/document.h"
|
||||
|
||||
TSDocument *ts_document_make() {
|
||||
TSDocument *ts_document_new() {
|
||||
TSDocument *self = ts_calloc(1, sizeof(TSDocument));
|
||||
if (!self)
|
||||
goto error;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue