aboutsummaryrefslogtreecommitdiffstats
path: root/var.h
diff options
context:
space:
mode:
Diffstat (limited to 'var.h')
-rw-r--r--var.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/var.h b/var.h
index 5fc09fa..75653de 100644
--- a/var.h
+++ b/var.h
@@ -56,8 +56,14 @@ class Var : public Evaluable {
virtual string DebugString() const = 0;
+ bool ReadOnly() const { return readonly_; }
+ void SetReadOnly() { readonly_ = true; }
+
protected:
Var();
+
+ private:
+ bool readonly_;
};
class SimpleVar : public Var {
@@ -177,7 +183,7 @@ class Vars : public unordered_map<Symbol, Var*> {
Var* Lookup(Symbol name) const;
- void Assign(Symbol name, Var* v);
+ void Assign(Symbol name, Var* v, bool* readonly);
static void add_used_env_vars(Symbol v);