tdtl: always recalc number of simple constructors.
GitOrigin-RevId: dcc2c48f29d8a8f039bb53ec69c8b3076b153608
This commit is contained in:
parent
b03e0a827e
commit
7b4afb7673
|
@ -483,7 +483,6 @@ void write_tl(const tl_config &config, tl_outputer &out, const TL_writer &w) {
|
||||||
std::size_t types_n = config.get_type_count();
|
std::size_t types_n = config.get_type_count();
|
||||||
std::size_t functions_n = config.get_function_count();
|
std::size_t functions_n = config.get_function_count();
|
||||||
|
|
||||||
bool found_complex = false;
|
|
||||||
for (std::size_t type = 0; type < types_n; type++) {
|
for (std::size_t type = 0; type < types_n; type++) {
|
||||||
tl_type *t = config.get_type_by_num(type);
|
tl_type *t = config.get_type_by_num(type);
|
||||||
assert(t->constructors_num == t->constructors.size());
|
assert(t->constructors_num == t->constructors.size());
|
||||||
|
@ -491,7 +490,6 @@ void write_tl(const tl_config &config, tl_outputer &out, const TL_writer &w) {
|
||||||
if (t->name == "Type") {
|
if (t->name == "Type") {
|
||||||
assert(t->id == ID_VAR_TYPE);
|
assert(t->id == ID_VAR_TYPE);
|
||||||
t->flags |= FLAG_COMPLEX;
|
t->flags |= FLAG_COMPLEX;
|
||||||
found_complex = true;
|
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -529,7 +527,6 @@ void write_tl(const tl_config &config, tl_outputer &out, const TL_writer &w) {
|
||||||
b.exist_var_num != -1) {
|
b.exist_var_num != -1) {
|
||||||
if (!w.is_built_in_complex_type(t->name)) {
|
if (!w.is_built_in_complex_type(t->name)) {
|
||||||
t->flags |= FLAG_COMPLEX;
|
t->flags |= FLAG_COMPLEX;
|
||||||
found_complex = true;
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
assert(b_arg_type == NODE_TYPE_TYPE);
|
assert(b_arg_type == NODE_TYPE_TYPE);
|
||||||
|
@ -549,14 +546,13 @@ void write_tl(const tl_config &config, tl_outputer &out, const TL_writer &w) {
|
||||||
if (main_type == NODE_TYPE_VAR_TYPE) {
|
if (main_type == NODE_TYPE_VAR_TYPE) {
|
||||||
if (!w.is_built_in_complex_type(t->name)) {
|
if (!w.is_built_in_complex_type(t->name)) {
|
||||||
t->flags |= FLAG_COMPLEX;
|
t->flags |= FLAG_COMPLEX;
|
||||||
found_complex = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
while (found_complex) {
|
while (true) {
|
||||||
found_complex = false;
|
bool found_complex = false;
|
||||||
for (std::size_t type = 0; type < types_n; type++) {
|
for (std::size_t type = 0; type < types_n; type++) {
|
||||||
tl_type *t = config.get_type_by_num(type);
|
tl_type *t = config.get_type_by_num(type);
|
||||||
if (t->constructors_num == 0 || w.is_built_in_complex_type(t->name)) { // built-in dummy or complex types
|
if (t->constructors_num == 0 || w.is_built_in_complex_type(t->name)) { // built-in dummy or complex types
|
||||||
|
@ -576,6 +572,9 @@ void write_tl(const tl_config &config, tl_outputer &out, const TL_writer &w) {
|
||||||
// std::fprintf(stderr, "Found complex %s\n", t->name.c_str());
|
// std::fprintf(stderr, "Found complex %s\n", t->name.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!found_complex) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::set<std::string> request_types;
|
std::set<std::string> request_types;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user