Rename generated language functions to e.g. tree_sitter_python

They used to be called e.g. `ts_language_python`. Now that there
are APIs that deal with the `TSLanguage` objects themselves, such
as `ts_language_symbol_count`, the old names were a little confusing.
This commit is contained in:
Max Brunsfeld 2017-01-31 10:29:25 -08:00
parent d853b6504d
commit 60f6998485
5 changed files with 22 additions and 21 deletions

View file

@ -355,7 +355,8 @@ class CCodeGenerator {
}
void add_parser_export() {
string external_scanner_name = "ts_language_" + name + "_external_scanner";
string language_function_name = "tree_sitter_" + name;
string external_scanner_name = language_function_name + "_external_scanner";
if (!syntax_grammar.external_tokens.empty()) {
line("void *" + external_scanner_name + "_create();");
@ -367,7 +368,7 @@ class CCodeGenerator {
line();
}
line("const TSLanguage *ts_language_" + name + "() {");
line("const TSLanguage *" + language_function_name + "() {");
indent([&]() {
line("GET_LANGUAGE(");
if (syntax_grammar.external_tokens.empty()) {