Comments, var access, start on objects
This commit is contained in:
@@ -84,18 +84,6 @@ Executor::Executor(ASTCodeBlock in, bool isInitCall, std::map<std::string, ASTVa
|
||||
std::cout << "Expected value after = sign" << std::endl;
|
||||
exit(1);
|
||||
}
|
||||
} else if (id == "==") {
|
||||
|
||||
} else if (id == "!=") {
|
||||
|
||||
} else if (id == ">") {
|
||||
|
||||
} else if (id == ">=") {
|
||||
|
||||
} else if (id == "<") {
|
||||
|
||||
} else if (id == "<=") {
|
||||
|
||||
}
|
||||
} else {
|
||||
std::cout << "Expected function or operator after identifier" << std::endl;
|
||||
@@ -112,7 +100,12 @@ Executor::Executor(ASTCodeBlock in, bool isInitCall, std::map<std::string, ASTVa
|
||||
for (auto &callArgNode : callArgNodes) {
|
||||
if (std::holds_alternative<std::shared_ptr<ASTValue>>(callArgNode)) {
|
||||
callArgs.push_back(*std::get<std::shared_ptr<ASTValue>>(callArgNode));
|
||||
} else if (std::holds_alternative<std::shared_ptr<ASTIdentifier>>(callArgNode)) {
|
||||
if (variables.find(std::get<std::shared_ptr<ASTIdentifier>>(callArgNode)->name) != variables.end()) {
|
||||
callArgs.push_back(variables[std::get<std::shared_ptr<ASTIdentifier>>(callArgNode)->name]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if (fnName == "import") {
|
||||
// work on importing modules later
|
||||
|
||||
@@ -13,6 +13,12 @@
|
||||
* context of execution. The class implements mechanisms for traversing AST nodes
|
||||
* and consuming or peeking at individual nodes.
|
||||
*/
|
||||
|
||||
class Object {
|
||||
public:
|
||||
std::vector<Object> children;
|
||||
};
|
||||
|
||||
class Executor {
|
||||
private:
|
||||
std::map<std::string, ASTFunction> functions;
|
||||
|
||||
Reference in New Issue
Block a user