Start work on lists w/ command line args

This commit is contained in:
2025-05-12 11:28:06 +10:00
parent ae858894b9
commit 7f4e87f768
6 changed files with 26 additions and 4 deletions

View File

@@ -31,7 +31,21 @@ optional<Token> Interpreter::peek(int offset) {
return {};
}
void Interpreter::convertToTokens(vector<Token> tokenList) {
void Interpreter::initInterpreter(vector<string> args) {
List arguments;
for (int i = 0; i < args.size(); i++) {
Value buf;
buf.type = valtype::STR;
buf.value = args[i];
arguments.value.push_back(buf);
}
Value buf;
buf.type = valtype::LIST;
buf.value = arguments;
variables["args"] = buf;
}
void Interpreter::interpret(vector<Token> tokenList) {
if (debugMode) log.toggleDebugPrint();
tokens = tokenList;
log.debug("Alright we got " + to_string(tokens.size()) + " tokens");