diff options
author | David Robillard <d@drobilla.net> | 2012-12-15 07:06:22 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-12-15 07:06:22 +0000 |
commit | 10174ffc7ea08b7845dbe409a11811e820536468 (patch) | |
tree | c74187d11b7f35c739045e7000d2fa505ac9499a /src/constrain.cpp | |
parent | 8148e755d3f587e6c212ba90efc151ea07de2703 (diff) | |
download | resp-10174ffc7ea08b7845dbe409a11811e820536468.tar.gz resp-10174ffc7ea08b7845dbe409a11811e820536468.tar.bz2 resp-10174ffc7ea08b7845dbe409a11811e820536468.zip |
Compile constructors as LLVM struct types.
Use LLVM type names instead of hyper verbose literal types in more places in general.
More work on quoting.
git-svn-id: http://svn.drobilla.net/resp/trunk@439 ad02d1e2-f140-0410-9f75-f8b11f17cedd
Diffstat (limited to 'src/constrain.cpp')
-rw-r--r-- | src/constrain.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/constrain.cpp b/src/constrain.cpp index 83a027a..e6e81a3 100644 --- a/src/constrain.cpp +++ b/src/constrain.cpp @@ -135,7 +135,7 @@ constrain_def_type(TEnv& tenv, Constraints& c, const ATuple* call) throw(Error) THROW_IF(!prot, (*i)->loc, "first argument of `def-type' is not a tuple"); const ASymbol* sym = (*prot->begin())->as_symbol(); THROW_IF(!sym, (*prot->begin())->loc, "type name is not a symbol"); - THROW_IF(tenv.ref(sym), call->loc, "type redefinition"); + //THROW_IF(tenv.ref(sym), call->loc, "type redefinition"); List type(call->loc, tenv.penv.sym("Lambda"), prot->rst(), NULL); for (ATuple::const_iterator i = call->iter_at(2); i != call->end(); ++i) { const ATuple* exp = (*i)->as_tuple(); @@ -306,11 +306,10 @@ resp_constrain_quoted(TEnv& tenv, Constraints& c, const AST* ast) throw(Error) if (ast->tag() == T_SYMBOL) { c.constrain(tenv, ast, tenv.named("Symbol")); } else if (ast->tag() == T_TUPLE) { - List tupT(new ATuple(tenv.List, NULL, ast->loc)); + List tupT(new ATuple(tenv.Expr, NULL, ast->loc)); const ATuple* tup = ast->as_tuple(); const AST* fstT = tenv.var(tup->fst()); - tupT.push_back(tenv.penv.sym("Expr")); c.constrain(tenv, ast, tupT); c.constrain(tenv, tup->fst(), fstT); FOREACHP(ATuple::const_iterator, i, ast->as_tuple()) { @@ -327,7 +326,8 @@ constrain_quote(TEnv& tenv, Constraints& c, const ATuple* call) throw(Error) { THROW_IF(call->list_len() != 2, call->loc, "`quote' requires exactly 1 argument"); resp_constrain_quoted(tenv, c, call->frst()); - c.constrain(tenv, call, tenv.var(call->frst())); + List type(call->loc, tenv.Expr, NULL); + c.constrain(tenv, call, type); } static void |