Initial commit
This commit is contained in:
21
src/repl/repl.cpp
Normal file
21
src/repl/repl.cpp
Normal file
@@ -0,0 +1,21 @@
|
||||
#include "repl.h"
|
||||
#include "../executor/executor.h"
|
||||
#include "../parser/parser.h"
|
||||
#include "../defs/defs.h"
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
void repl() {
|
||||
inReplMode = true;
|
||||
std::cout << "Kyn REPL v0.0.1" << std::endl;
|
||||
std::cout << "Type 'exit' to exit" << std::endl;
|
||||
std::string buf;
|
||||
while (true) {
|
||||
std::cout << "kyn> ";
|
||||
getline(std::cin, buf);
|
||||
std::vector<Instruction> parsed = parse(buf);
|
||||
for (Instruction inst : parsed) {
|
||||
execute(inst);
|
||||
}
|
||||
}
|
||||
}
|
||||
1
src/repl/repl.h
Normal file
1
src/repl/repl.h
Normal file
@@ -0,0 +1 @@
|
||||
void repl();
|
||||
Reference in New Issue
Block a user