From 32c1b78fc9bdadd1dd40ed390941b2a6fea39435 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 14 Dec 2012 05:29:49 +0000 Subject: Real implementation of algebraic data types, and parametric types. git-svn-id: http://svn.drobilla.net/resp/trunk@434 ad02d1e2-f140-0410-9f75-f8b11f17cedd --- src/repl.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/repl.cpp') diff --git a/src/repl.cpp b/src/repl.cpp index 4e9c44c..1169b3d 100644 --- a/src/repl.cpp +++ b/src/repl.cpp @@ -109,10 +109,19 @@ compile(CEnv& cenv, const Code& parsed, Code& defs, bool& hasMain, const char* m if (cenv.args.find("-L") != cenv.args.end()) return dump(cenv, lifted); + // Depoly all expressions + Code concrete; + for (Code::const_iterator i = lifted.begin(); i != lifted.end(); ++i) + if ((exp = resp_depoly(cenv, concrete, *i))) + concrete.push_back(exp); + if (cenv.args.find("-D") != cenv.args.end()) { + return dump(cenv, concrete); + } + // Flatten expressions const AST* retT = NULL; Code exprs; - for (Code::const_iterator i = lifted.begin(); i != lifted.end(); ++i) { + for (Code::const_iterator i = concrete.begin(); i != concrete.end(); ++i) { const ATuple* call = (*i)->to_tuple(); if (call && (is_form(*i, "def-type") || (is_form(*i, "def") && is_form(call->frrst(), "fn")))) { -- cgit v1.2.1