From 181af94598d63034056d509d79f0c82cf0cb55f4 Mon Sep 17 00:00:00 2001 From: NoneSince Date: Sat, 27 Jan 2024 08:41:00 +0200 Subject: [PATCH] \n was put before each line and not after --- src/reconstruct.cpp | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/reconstruct.cpp b/src/reconstruct.cpp index 03a7054..fed73c4 100644 --- a/src/reconstruct.cpp +++ b/src/reconstruct.cpp @@ -404,8 +404,11 @@ std::string tokens_to_nasm(std::vector& tokens) || tokens[i]->tok_type == FUNCALL) { continue; } - output += "\n"; - if (tokens[i]->tok_type == CMD) { + if (tokens[i]->tok_type == SECTION) { + output += "section " + tokens[i]->tok_section->name + "\n"; + } else if (tokens[i]->tok_type == TAG) { + output += tokens[i]->tok_tag->name + ":" + "\n"; + } else if (tokens[i]->tok_type == CMD) { output += tokens[i]->tok_cmd->command; if (!tokens[i]->tok_cmd->arg1.empty()) { output += " " + tokens[i]->tok_cmd->arg1; @@ -413,16 +416,8 @@ std::string tokens_to_nasm(std::vector& tokens) if (!tokens[i]->tok_cmd->arg2.empty()) { output += ", " + tokens[i]->tok_cmd->arg2; } - continue; - } - if (tokens[i]->tok_type == TAG) { - output += tokens[i]->tok_tag->name + ":"; - continue; - } - if (tokens[i]->tok_type == SECTION) { - output += "section " + tokens[i]->tok_section->name; - continue; } + output += "\n"; } return output; }