aboutsummaryrefslogtreecommitdiffstats
path: root/typing.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-03-06 20:12:35 +0000
committerDavid Robillard <d@drobilla.net>2009-03-06 20:12:35 +0000
commit8ee76375d7f19cd0723334e33050584ec83cfe12 (patch)
tree951a59d05bfd4529fb837b49082c40e083048769 /typing.cpp
parent64c901f7261dcd78840f728ed2206318a23fab95 (diff)
downloadresp-8ee76375d7f19cd0723334e33050584ec83cfe12.tar.gz
resp-8ee76375d7f19cd0723334e33050584ec83cfe12.tar.bz2
resp-8ee76375d7f19cd0723334e33050584ec83cfe12.zip
Tidy.
git-svn-id: http://svn.drobilla.net/resp/tuplr@61 ad02d1e2-f140-0410-9f75-f8b11f17cedd
Diffstat (limited to 'typing.cpp')
-rw-r--r--typing.cpp22
1 files changed, 12 insertions, 10 deletions
diff --git a/typing.cpp b/typing.cpp
index eeba8dc..9dc94f6 100644
--- a/typing.cpp
+++ b/typing.cpp
@@ -16,6 +16,12 @@
*/
#include "tuplr.hpp"
+
+
+/***************************************************************************
+ * AST Type Contraints *
+ ***************************************************************************/
+
void
ASTTuple::constrain(TEnv& tenv) const
{
@@ -107,6 +113,11 @@ ASTCdrCall::constrain(TEnv& tenv) const
tenv.constrain(this, ct);
}
+
+/***************************************************************************
+ * Type Inferencing/Substitution *
+ ***************************************************************************/
+
static void
substitute(ASTTuple* tup, AST* from, AST* to)
{
@@ -118,16 +129,6 @@ substitute(ASTTuple* tup, AST* from, AST* to)
substitute(dynamic_cast<ASTTuple*>(tup->at(i)), from, to);
}
-bool
-ASTTuple::contains(AST* child) const
-{
- if (*this == *child) return true;
- FOREACH(const_iterator, p, *this)
- if (**p == *child || (*p)->contains(child))
- return true;
- return false;
-}
-
TSubst
compose(const TSubst& delta, const TSubst& gamma) // TAPL 22.1.1
{
@@ -196,3 +197,4 @@ TEnv::apply(const TSubst& substs)
else
substitute(t->second, s->first, s->second);
}
+