diff --git a/src/execute.cpp b/src/execute.cpp index dcb36a4..4da8db9 100644 --- a/src/execute.cpp +++ b/src/execute.cpp @@ -9,14 +9,15 @@ EvalResult execute(vector input, Memory& memory, int initial_line, ExecA vector tokens = tokenize(input, initial_line); if (args.print_tokens) { - cout << BOLD YELLOW " === TOKENS ===" RESET << endl; + cout << BOLD YELLOW " ======= TOKENS =======" RESET << endl; + _debug_print_tokens(tokens); } Node ast = parse(tokens); if (args.print_ast) { - cout << BOLD YELLOW " === AST ===" RESET << endl; + cout << BOLD YELLOW " ======= AST =======" RESET << endl; _debug_print_tree(ast, 0, ""); } @@ -24,14 +25,14 @@ EvalResult execute(vector input, Memory& memory, int initial_line, ExecA analyze(ast, type_mem); if (args.dump_type_mem) { - cout << BOLD YELLOW " === TYPE MEMORY ===" RESET << endl; + cout << BOLD YELLOW " ======= TYPE MEMORY =======" RESET << endl; type_mem._debug_print(); } EvalResult res = eval(ast, memory, input); if (args.dump_mem) { - cout << BOLD YELLOW " === MEMORY ===" RESET << endl; + cout << BOLD YELLOW " ======= MEMORY =======" RESET << endl; memory._debug_print(); } diff --git a/src/main.cpp b/src/main.cpp index c2c048e..2fe9719 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -96,7 +96,7 @@ int main(int argc, char* argv[]) { if ((print_tokens || print_ast || dump_type_mem || dump_mem) && (holds_alternative(res) || holds_alternative(res))) { - cout << BOLD BLUE " === RESULT ===" RESET << endl; + cout << BOLD BLUE " ======= RESULT =======" RESET << endl; } if (holds_alternative(res)) { diff --git a/src/memory.cpp b/src/memory.cpp index d47dd6e..90c4d03 100644 --- a/src/memory.cpp +++ b/src/memory.cpp @@ -181,13 +181,13 @@ void _debug_print_memory_var(MemoryVar var) { void _debug_print_scope(Scope scope) { for (auto it : scope.vars) { - if (it.first.length() > 6) { - cout << it.first.substr(0, 6) << ".."; + if (it.first.length() > 14) { + cout << it.first.substr(0, 14) << ".."; } else { - cout << setw (6) << it.first << " "; + cout << setw (14) << it.first << " "; } cout << "|"; - cout << setw (7) << _debug_get_type_type_name(it.second.type.type) << " |"; + cout << setw (9) << _debug_get_type_type_name(it.second.type.type) << " |"; _debug_print_memory_var(it.second); cout << endl; @@ -195,7 +195,7 @@ void _debug_print_scope(Scope scope) { } void Memory::_debug_print(void) { - cout << BOLD " Name | Type | Value" RESET << endl; + cout << BOLD " Name | Type | Value" RESET << endl; for (auto rit = scopes.rbegin(); rit != scopes.rend(); ++rit) { Scope& scope = *rit; if (rit != scopes.rbegin()) {