From da992b77ff243455f4fd322e1b1ba4c01e307c1a Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Sat, 15 Mar 2014 14:48:28 -0700 Subject: [PATCH] Rename 'parse_config' export -> 'parser' --- examples/parsers/arithmetic.c | 2 +- examples/parsers/json.c | 2 +- spec/runtime/arithmetic_spec.cc | 5 ++--- spec/runtime/json_spec.cc | 4 ++-- spec/runtime/parser_spec.cc | 4 ++-- src/compiler/generate_code/c_code.cc | 6 +++--- 6 files changed, 11 insertions(+), 12 deletions(-) diff --git a/examples/parsers/arithmetic.c b/examples/parsers/arithmetic.c index 88b430c9..6f31f29b 100644 --- a/examples/parsers/arithmetic.c +++ b/examples/parsers/arithmetic.c @@ -759,4 +759,4 @@ PARSE_FN() { FINISH_PARSER(); } -EXPORT_PARSER(ts_parse_config_arithmetic); +EXPORT_PARSER(ts_parser_arithmetic); diff --git a/examples/parsers/json.c b/examples/parsers/json.c index 23e2e38b..a93c81b3 100644 --- a/examples/parsers/json.c +++ b/examples/parsers/json.c @@ -916,4 +916,4 @@ PARSE_FN() { FINISH_PARSER(); } -EXPORT_PARSER(ts_parse_config_json); +EXPORT_PARSER(ts_parser_json); diff --git a/spec/runtime/arithmetic_spec.cc b/spec/runtime/arithmetic_spec.cc index 391c1a77..a6b202ea 100644 --- a/spec/runtime/arithmetic_spec.cc +++ b/spec/runtime/arithmetic_spec.cc @@ -1,6 +1,6 @@ #include "runtime_spec_helper.h" -extern "C" ts_parser ts_parse_config_arithmetic(); +extern "C" ts_parser ts_parser_arithmetic(); START_TEST @@ -9,8 +9,7 @@ describe("arithmetic", []() { before_each([&]() { doc = ts_document_make(); - ts_parser parser = ts_parse_config_arithmetic(); - ts_document_set_parser(doc, parser); + ts_document_set_parser(doc, ts_parser_arithmetic()); }); after_each([&]() { diff --git a/spec/runtime/json_spec.cc b/spec/runtime/json_spec.cc index 92a5a750..b271390f 100644 --- a/spec/runtime/json_spec.cc +++ b/spec/runtime/json_spec.cc @@ -1,6 +1,6 @@ #include "runtime_spec_helper.h" -extern "C" ts_parser ts_parse_config_json(); +extern "C" ts_parser ts_parser_json(); START_TEST @@ -9,7 +9,7 @@ describe("json", []() { before_each([&]() { doc = ts_document_make(); - ts_document_set_parser(doc, ts_parse_config_json()); + ts_document_set_parser(doc, ts_parser_json()); }); after_each([&]() { diff --git a/spec/runtime/parser_spec.cc b/spec/runtime/parser_spec.cc index d6dae4c7..32f2b09a 100644 --- a/spec/runtime/parser_spec.cc +++ b/spec/runtime/parser_spec.cc @@ -1,7 +1,7 @@ #include "runtime_spec_helper.h" #include "helpers/spy_reader.h" -extern "C" ts_parser ts_parse_config_json(); +extern "C" ts_parser ts_parser_json(); START_TEST @@ -11,7 +11,7 @@ describe("parsing", [&]() { before_each([&]() { doc = ts_document_make(); - ts_document_set_parser(doc, ts_parse_config_json()); + ts_document_set_parser(doc, ts_parser_json()); reader = new SpyReader("{ \"key\": [1, 2] }", 5); ts_document_set_input(doc, reader->input); diff --git a/src/compiler/generate_code/c_code.cc b/src/compiler/generate_code/c_code.cc index 62b70b17..7b73779d 100644 --- a/src/compiler/generate_code/c_code.cc +++ b/src/compiler/generate_code/c_code.cc @@ -279,8 +279,8 @@ namespace tree_sitter { }); } - string parse_config_struct() { - return "EXPORT_PARSER(ts_parse_config_" + name + ");"; + string parser_export() { + return "EXPORT_PARSER(ts_parser_" + name + ");"; } string code() { @@ -291,7 +291,7 @@ namespace tree_sitter { recover_function(), lex_function(), parse_function(), - parse_config_struct(), + parser_export(), }, "\n\n") + "\n"; } };