Skip to content

Commit

Permalink
Updated Zhivo main source file
Browse files Browse the repository at this point in the history
  • Loading branch information
nthnn committed Sep 13, 2024
1 parent fd57e6f commit ba2e99d
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/Zhivo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ auto interpreter() -> int {
);
auto funcDecl = std::make_unique<FunctionDeclarationExpression>(
std::move(myFunc),
std::vector<std::string>{},
std::vector<std::unique_ptr<Token>>{},
std::move(funcBody)
);

Expand Down Expand Up @@ -308,17 +308,16 @@ auto interpreter() -> int {
}

decltype(interpreter()) main() {
SymbolTable symbols;

Parser parser = Parser::fromFile("test.zhv");
parser.parse();
try {
SymbolTable symbols;
Parser parser = Parser::fromFile("test.zhv");
parser.parse();

for(const auto& statement : parser.getGlobalStatements()) {
DynamicObject object = statement->visit(symbols);
std::cout << "Result: " << object.toString() << std::endl;
}
for(const auto& statement : parser.getGlobalStatements()) {
DynamicObject object = statement->visit(symbols);
std::cout << "Result: " << object.toString() << std::endl;
}

try {
return interpreter();
}
catch (const std::exception& exc) {
Expand Down

0 comments on commit ba2e99d

Please sign in to comment.