aboutsummaryrefslogtreecommitdiffstats
path: root/var.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'var.hpp')
-rw-r--r--var.hpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/var.hpp b/var.hpp
index f61883f..1ffb8b8 100644
--- a/var.hpp
+++ b/var.hpp
@@ -21,14 +21,21 @@
#include <llvm/IR/Type.h>
#include <llvm/IR/DerivedTypes.h>
+#include <list>
+#include <map>
+#include <string>
+
struct Var {
llvm::Value *value;
- bool callable;
+ bool native;
+
+ Var(llvm::Value *v = nullptr, bool n = false):
+ value(v), native(n) {}
- Var(llvm::Value *v = nullptr, bool c = false):
- value(v), callable(c) {}
+ static std::list<std::map<std::string, Var>> vars;
static Var lookup(const std::string& name, int skip = 0);
+ static Var lookupLocal(const std::string& name);
static void pushScope();
static void popScope();
static Var& addGlobal(const std::string& name, Var var);