Skip to content

Commit 0f5eac0

Browse files
Fixed extra line of dashes in yesdebug mode for RuntimeError's
1 parent e817c79 commit 0f5eac0

1 file changed

Lines changed: 14 additions & 15 deletions

File tree

BarkScript.cpp

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include "interpreter/interpreter.h"
1010
#include "context/context.h"
1111

12-
const std::string bsversion = "0.1.6";
12+
const std::string bsversion = "0.1.6.1";
1313

1414
enum optionIndex { CLI_UNKNOWN, CLI_HELP, CLI_NODEBUG };
1515
const option::Descriptor usage[] =
@@ -74,22 +74,21 @@ int main(int argc, char* argv[]) {
7474
std::cout << abSyTree.error->to_string() << std::endl;
7575
std::cout << "--------------------------" << std::endl;
7676
continue;
77-
} else {
78-
if (printDebug) {
79-
std::cout << std::endl;
80-
std::cout << abSyTree.node->to_string() << std::endl;
81-
std::cout << std::endl;
82-
}
77+
}
78+
if (printDebug) {
79+
std::cout << std::endl;
80+
std::cout << abSyTree.node->to_string() << std::endl;
81+
std::cout << std::endl;
82+
}
8383

84-
Interpreter interpreter;
85-
RuntimeResult rt = interpreter.visit(abSyTree.node, context);
86-
if (rt.hasError()) {
87-
std::cout << rt.error->to_string() << std::endl;
88-
std::cout << "--------------------------" << std::endl;
89-
} else {
90-
std::cout << rt.object->to_string() << std::endl;
91-
}
84+
Interpreter interpreter;
85+
RuntimeResult rt = interpreter.visit(abSyTree.node, context);
86+
if (rt.hasError()) {
87+
std::cout << rt.error->to_string() << std::endl;
88+
std::cout << "--------------------------" << std::endl;
89+
continue;
9290
}
91+
std::cout << rt.object->to_string() << std::endl;
9392
}
9493
if (printDebug) std::cout << "--------------------------" << std::endl;
9594
}

0 commit comments

Comments
 (0)