1

Interpret program given in argv

This commit is contained in:
2024-01-19 00:22:38 +01:00
parent a8c5660460
commit 6428a39791
2 changed files with 9 additions and 2 deletions

View File

@ -10,6 +10,7 @@ include_directories(include)
add_executable(bfuck
src/main.cpp
src/lex.cpp
src/interpret.cpp
)
# target_link_libraries(lasm Boost::program_options)

View File

@ -1,4 +1,5 @@
#include "lex.hpp"
#include "interpret.hpp"
#include <iostream>
@ -9,7 +10,12 @@ int main(int argc, char **argv) {
std::cout << "Running " << argv[1] << "...\n" << std::endl;
std::string tokens;
lex_brainfuck_file(argv[1], tokens);
if (!lex_brainfuck_file(argv[1], tokens)) {
return 1;
}
Interpreter interpreter(tokens);
interpreter.run();
return 0;
}