diff options
author | David Robillard <d@drobilla.net> | 2009-03-06 20:12:35 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2009-03-06 20:12:35 +0000 |
commit | 8ee76375d7f19cd0723334e33050584ec83cfe12 (patch) | |
tree | 951a59d05bfd4529fb837b49082c40e083048769 /tuplr.hpp | |
parent | 64c901f7261dcd78840f728ed2206318a23fab95 (diff) | |
download | resp-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.hpp | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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"); } }; |