Start work on lists w/ command line args
This commit is contained in:
@@ -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");
|
||||
|
Reference in New Issue
Block a user