aboutsummaryrefslogtreecommitdiffstats
path: root/tuplr.hpp
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 /tuplr.hpp
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 'tuplr.hpp')
-rw-r--r--tuplr.hpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/tuplr.hpp b/tuplr.hpp
index 093f95c..a1bae51 100644
--- a/tuplr.hpp
+++ b/tuplr.hpp
@@ -151,7 +151,13 @@ struct ASTTuple : public AST, public vector<AST*> {
FOREACH(iterator, t, *this)
(*t)->lift(cenv);
}
- bool contains(AST* child) const;
+ bool contains(AST* child) const {
+ if (*this == *child) return true;
+ FOREACH(const_iterator, p, *this)
+ if (**p == *child || (*p)->contains(child))
+ return true;
+ return false;
+ }
void constrain(TEnv& tenv) const;
CValue compile(CEnv& cenv) { throw Error("tuple compiled"); }
};