mirror of
https://github.com/open-goal/jak-project
synced 2026-09-02 18:12:50 -04:00
[decomp] Small fixes (#541)
* fix a few bugs * fix local vars missing in top level * more small fixes * support missing inline array access case * one more fix
This commit is contained in:
@@ -173,6 +173,15 @@ std::string write_from_top_level(const Function& top_level,
|
||||
}
|
||||
|
||||
std::string result;
|
||||
// local vars:
|
||||
int var_count = 0;
|
||||
auto var_dec = env.local_var_type_list(top_level.ir2.top_form, 0, &var_count);
|
||||
if (var_count > 0) {
|
||||
result += pretty_print::to_string(var_dec);
|
||||
result += '\n';
|
||||
result += '\n';
|
||||
}
|
||||
|
||||
// look for the whole thing being in a (when *debug-segment* ....)
|
||||
bool in_debug_only_file = false;
|
||||
if (forms.size() == 1) {
|
||||
@@ -341,6 +350,15 @@ std::string write_from_top_level(const Function& top_level,
|
||||
}
|
||||
}
|
||||
|
||||
if (!something_matched) {
|
||||
auto empty = dynamic_cast<EmptyElement*>(x);
|
||||
if (empty) {
|
||||
something_matched = true;
|
||||
} else if (!x->active()) {
|
||||
something_matched = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!something_matched) {
|
||||
result += ";; failed to figure out what this is:\n";
|
||||
result += pretty_print::to_string(x->to_form(env));
|
||||
|
||||
Reference in New Issue
Block a user