Skip to content

Commit 083b379

Browse files
committed
Prettyprint Spacing fixes
1 parent 74cdbef commit 083b379

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

src/EiObjects/FunctionObject.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,20 @@
33
namespace EigerC {
44

55
BytecodeFunctionObject::BytecodeFunctionObject(
6-
int line, CompilerContext& ctx, std::string name,
6+
int line, CompilerContext &ctx, std::string name,
77
std::vector<std::string> argNames, std::vector<Instruction> code,
88
bool isInline)
99
: ctx(ctx), code(code), isInline(isInline), FunctionObject(name, argNames) {
1010
this->line = line;
11-
if (ctx.cmdOpts.verbose)
12-
for (const Instruction& c : code) c.PrettyPrint();
11+
12+
if (ctx.cmdOpts.verbose) {
13+
Instruction::PrettyPrintHeader();
14+
for (const Instruction &c : code) c.PrettyPrint();
15+
}
1316
}
1417

1518
void BytecodeFunctionObject::StartExecute(
16-
const std::vector<std::shared_ptr<EiObject>>& values, BytecodeVM* vm,
19+
const std::vector<std::shared_ptr<EiObject>> &values, BytecodeVM *vm,
1720
bool pushRetVal) {
1821
auto fScope = std::make_shared<Scope>(ctx, closure);
1922

src/Instruction.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ struct Instruction {
2525
flag(flag) {}
2626

2727
void PrettyPrint() const {
28-
std::cout << std::format("{:05} {:<12} {:<10} {:<5}\n", address,
28+
std::cout << std::format("{:05} {:<24} {:<10} {:<5}\n", address,
2929
Util::OpcodeToString(opcode), operand, flag);
3030
}
3131

3232
static void PrettyPrintHeader() {
33-
std::cout << std::format("{:<5} {:<12} {:<10} {:<5}\n", "Addr",
33+
std::cout << std::format("{:<5} {:<24} {:<10} {:<5}\n", "Addr",
3434
"Opcode", "Operand", "Flag");
3535
}
3636
};

0 commit comments

Comments
 (0)