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:
parent
d853b6504d
commit
60f6998485
5 changed files with 22 additions and 21 deletions
|
|
@ -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()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue