mirror of
https://github.com/open-goal/jak-project
synced 2026-08-22 07:04:29 -04:00
add support for non virtual states (#764)
* add support for non virtual states * typecheck go * start on virtual states * more support for virtual states * offline passes * fix tests * use behavior shortcut instead of lambda * final cleanup of virtual go * unused var warnings and fix inconsistent enum decompile order on win vs linux * fix thread safety bug with goal symbol table and vif1 interrupt handler * fix type mistake
This commit is contained in:
@@ -62,6 +62,16 @@ goos::Object final_output_lambda(const Function& func) {
|
||||
}
|
||||
}
|
||||
|
||||
goos::Object final_output_defstate_anonymous_behavior(const Function& func) {
|
||||
std::vector<goos::Object> inline_body;
|
||||
func.ir2.top_form->inline_forms(inline_body, func.ir2.env);
|
||||
auto var_dec = func.ir2.env.local_var_type_list(func.ir2.top_form, func.type.arg_count() - 1);
|
||||
|
||||
auto result = pretty_print::build_list("behavior", get_arg_list_for_function(func, func.ir2.env));
|
||||
append_body_to_function_definition(&result, inline_body, var_dec, func.type);
|
||||
return result;
|
||||
}
|
||||
|
||||
std::string final_defun_out(const Function& func,
|
||||
const Env& env,
|
||||
const DecompilerTypeSystem& dts,
|
||||
@@ -144,6 +154,21 @@ std::string final_defun_out(const Function& func,
|
||||
append_body_to_function_definition(&top_form, inline_body, var_dec, func.type);
|
||||
return pretty_print::to_string(top_form);
|
||||
}
|
||||
|
||||
if (func.guessed_name.kind == FunctionName::FunctionKind::NV_STATE ||
|
||||
func.guessed_name.kind == FunctionName::FunctionKind::V_STATE) {
|
||||
std::vector<goos::Object> top;
|
||||
top.push_back(pretty_print::to_symbol("state-handler"));
|
||||
|
||||
top.push_back(pretty_print::to_symbol(func.guessed_name.to_string()));
|
||||
|
||||
top.push_back(arguments);
|
||||
auto top_form = pretty_print::build_list(top);
|
||||
|
||||
append_body_to_function_definition(&top_form, inline_body, var_dec, func.type);
|
||||
return pretty_print::to_string(top_form);
|
||||
}
|
||||
|
||||
return "nyi";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user