Lua.hpp: Only output indentation when newLines is set to true

Signed-off-by: Username404 <w.iron.zombie@gmail.com>
This commit is contained in:
Username404 2022-05-07 09:30:21 +02:00
parent de658bd032
commit 4097b1c59a
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
1 changed files with 4 additions and 2 deletions

View File

@ -19,8 +19,10 @@ struct LuaTarget: Target {
output << "function " << parseComponent.name << '('; output << "function " << parseComponent.name << '(';
separate_transpileTree(parseComponent.parameters, ", "); separate_transpileTree(parseComponent.parameters, ", ");
output << ')'; output << ')';
if (not parseComponent.empty()) output << separator << indentation; if (not parseComponent.empty()) {
else output << ' '; output << separator;
if (newLines) output << indentation;
} else output << ' ';
separate_transpileTree(parseComponent, 1); separate_transpileTree(parseComponent, 1);
if (not parseComponent.empty()) output << separator; if (not parseComponent.empty()) output << separator;
output << "end"; output << "end";