From 269f28df980f34895c3c7181140963b4a86a1afc Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Thu, 9 Feb 2017 22:20:56 +0100 Subject: Split the Scope types, and generic ref/unref --- evaluate.h | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'evaluate.h') diff --git a/evaluate.h b/evaluate.h index 09d0c81..9c50b24 100644 --- a/evaluate.h +++ b/evaluate.h @@ -1,11 +1,14 @@ #pragma once #include +#include #include "ast.h" using namespace std; +class ScopeVal; + class Value{ public: enum class Type{ @@ -17,21 +20,26 @@ public: Type type; double numval; string strval; - Scope scope; + ScopeVal *scope; Value(double numval); Value(const string &strval); - Value(const Scope &scope); + Value(ScopeVal *scope); +}; + +class ScopeVal{ +public: + unordered_map values; }; namespace A { - template - Value* ref_create(Args... args); + template + T* ref(T *value); - Value* ref(Value *value); - void unref(Value *value); + template + void unref(T *value); } -- cgit v1.2.3-70-g09d2