aboutsummaryrefslogtreecommitdiffstats
path: root/src/resp.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/resp.hpp')
-rw-r--r--src/resp.hpp27
1 files changed, 14 insertions, 13 deletions
diff --git a/src/resp.hpp b/src/resp.hpp
index a2b5cf8..439d00b 100644
--- a/src/resp.hpp
+++ b/src/resp.hpp
@@ -587,7 +587,10 @@ struct Subst : public list<Constraint> {
if (s && t) { assert(s != t); push_back(Constraint(s, t)); }
}
static Subst compose(const Subst& delta, const Subst& gamma);
- void add(const AType* from, const AType* to) { push_back(Constraint(from, to)); }
+ void add(const AType* from, const AType* to) {
+ assert(from && to);
+ push_back(Constraint(from, to));
+ }
const_iterator find(const AType* t) const {
for (const_iterator j = begin(); j != end(); ++j)
if (*j->first == *t)
@@ -723,18 +726,16 @@ struct Engine {
virtual void finishFn(CEnv& cenv, CFunc f, CVal ret) = 0;
virtual void eraseFn(CEnv& cenv, CFunc f) = 0;
- virtual CVal compileCall(CEnv& cenv, CFunc f, const AType* fT, CVals& args) = 0;
- virtual CVal compileCons(CEnv& cenv, const AType* t, CVal rtti, CVals& f) = 0;
- virtual CVal compileDot(CEnv& cenv, CVal tup, int32_t index) = 0;
- virtual CVal compileGlobalSet(CEnv& cenv, const string& s, CVal v, const AType* t) = 0;
- virtual CVal compileGlobalGet(CEnv& cenv, const string& s, CVal v) = 0;
- virtual IfState compileIfStart(CEnv& cenv) = 0;
- virtual void compileIfBranch(CEnv& cenv, IfState state, CVal condV, const AST* then) = 0;
- virtual CVal compileIfEnd(CEnv& cenv, IfState state, CVal elseV, const AType* type) = 0;
- virtual CVal compileIsA(CEnv& cenv, CVal rtti, const ASymbol* tag) = 0;
- virtual CVal compileLiteral(CEnv& cenv, const AST* lit) = 0;
- virtual CVal compilePrimitive(CEnv& cenv, const ATuple* prim) = 0;
- virtual CVal compileString(CEnv& cenv, const char* str) = 0;
+ virtual CVal compileCall(CEnv& cenv, CFunc f, const AType* fT, CVals& args) = 0;
+ virtual CVal compileCons(CEnv& cenv, const AType* t, CVal rtti, CVals& f) = 0;
+ virtual CVal compileDot(CEnv& cenv, CVal tup, int32_t index) = 0;
+ virtual CVal compileGlobalSet(CEnv& cenv, const string& s, CVal v, const AType* t) = 0;
+ virtual CVal compileGlobalGet(CEnv& cenv, const string& s, CVal v) = 0;
+ virtual CVal compileIf(CEnv& cenv, const AST* cond, const AST* then, const AST* aelse) = 0;
+ virtual CVal compileIsA(CEnv& cenv, CVal rtti, const ASymbol* tag) = 0;
+ virtual CVal compileLiteral(CEnv& cenv, const AST* lit) = 0;
+ virtual CVal compilePrimitive(CEnv& cenv, const ATuple* prim) = 0;
+ virtual CVal compileString(CEnv& cenv, const char* str) = 0;
virtual void writeModule(CEnv& cenv, std::ostream& os) = 0;