aboutsummaryrefslogtreecommitdiffstats
path: root/src/repl.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-12-14 05:29:49 +0000
committerDavid Robillard <d@drobilla.net>2012-12-14 05:29:49 +0000
commit32c1b78fc9bdadd1dd40ed390941b2a6fea39435 (patch)
treec02e3da8138d29ee060bd5bf584812bd9ad4ca5f /src/repl.cpp
parent60cb2bb1a12a1393abdc0d82b40ea0feabe3a74d (diff)
downloadresp-32c1b78fc9bdadd1dd40ed390941b2a6fea39435.tar.gz
resp-32c1b78fc9bdadd1dd40ed390941b2a6fea39435.tar.bz2
resp-32c1b78fc9bdadd1dd40ed390941b2a6fea39435.zip
Real implementation of algebraic data types, and parametric types.
git-svn-id: http://svn.drobilla.net/resp/trunk@434 ad02d1e2-f140-0410-9f75-f8b11f17cedd
Diffstat (limited to 'src/repl.cpp')
-rw-r--r--src/repl.cpp11
1 files changed, 10 insertions, 1 deletions
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")))) {