Skip to content

Commit

Permalink
decompiler: Apply docstring indentation fix to all game versions (#3614)
Browse files Browse the repository at this point in the history
Previously was only applying to game versions above Jak 2, Fixes #3342
  • Loading branch information
xTVaser authored Jul 30, 2024
1 parent 4419521 commit e975eab
Show file tree
Hide file tree
Showing 237 changed files with 2,598 additions and 2,617 deletions.
8 changes: 2 additions & 6 deletions decompiler/analysis/final_output.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,8 @@ void append_body_to_function_definition(goos::Object* top_form,
body_elements.insert(body_elements.end(), inline_body.begin(), inline_body.end());
// If the first element in the body is a docstring, add it first
if (body_elements.size() > 0 && body_elements.at(0).is_string()) {
if (version > GameVersion::Jak2) {
initial_top_level_forms.push_back(
goos::StringObject::make_new(fix_docstring_indent(inline_body.at(0).as_string()->data)));
} else {
initial_top_level_forms.push_back(inline_body.at(0));
}
initial_top_level_forms.push_back(
goos::StringObject::make_new(fix_docstring_indent(inline_body.at(0).as_string()->data)));
body_elements.erase(body_elements.begin());
}

Expand Down
52 changes: 26 additions & 26 deletions test/decompiler/reference/jak2/engine/ai/enemy_REF.gc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions test/decompiler/reference/jak2/engine/anim/aligner_REF.gc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 18 additions & 18 deletions test/decompiler/reference/jak2/engine/common_objs/base-plat_REF.gc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e975eab

Please sign in to comment.