From 64a6c9db0e29f8901351b48308db11d91c570e86 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Tue, 6 Sep 2016 17:26:18 -0700 Subject: [PATCH] Rename ts_document_make -> ts_document_new --- include/tree_sitter/runtime.h | 2 +- spec/integration/compile_grammar_spec.cc | 2 +- spec/integration/corpus_specs.cc | 2 +- spec/runtime/document_spec.cc | 2 +- spec/runtime/node_spec.cc | 2 +- spec/runtime/parser_spec.cc | 10 +++++----- src/runtime/document.c | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/tree_sitter/runtime.h b/include/tree_sitter/runtime.h index d57e60d9..d3d5d878 100644 --- a/include/tree_sitter/runtime.h +++ b/include/tree_sitter/runtime.h @@ -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 *); diff --git a/spec/integration/compile_grammar_spec.cc b/spec/integration/compile_grammar_spec.cc index 06891c8b..a8f8988d 100644 --- a/spec/integration/compile_grammar_spec.cc +++ b/spec/integration/compile_grammar_spec.cc @@ -8,7 +8,7 @@ describe("compile_grammar", []() { TSDocument *document; before_each([&]() { - document = ts_document_make(); + document = ts_document_new(); }); after_each([&]() { diff --git a/spec/integration/corpus_specs.cc b/spec/integration/corpus_specs.cc index 485aef79..dc50eedf 100644 --- a/spec/integration/corpus_specs.cc +++ b/spec/integration/corpus_specs.cc @@ -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)); diff --git a/spec/runtime/document_spec.cc b/spec/runtime/document_spec.cc index 05ded944..ff3305d6 100644 --- a/spec/runtime/document_spec.cc +++ b/spec/runtime/document_spec.cc @@ -17,7 +17,7 @@ describe("Document", [&]() { before_each([&]() { record_alloc::start(); - doc = ts_document_make(); + doc = ts_document_new(); }); after_each([&]() { diff --git a/spec/runtime/node_spec.cc b/spec/runtime/node_spec.cc index 11e473a8..6c31fe5b 100644 --- a/spec/runtime/node_spec.cc +++ b/spec/runtime/node_spec.cc @@ -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); diff --git a/spec/runtime/parser_spec.cc b/spec/runtime/parser_spec.cc index 837f3f4e..4498f0a0 100644 --- a/spec/runtime/parser_spec.cc +++ b/spec/runtime/parser_spec.cc @@ -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(nullptr)); + AssertThat(ts_document_new(), Equals(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); diff --git a/src/runtime/document.c b/src/runtime/document.c index 384246a1..503976ac 100644 --- a/src/runtime/document.c +++ b/src/runtime/document.c @@ -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;