diff options
author | David Robillard <d@drobilla.net> | 2010-04-08 20:53:09 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2010-04-08 20:53:09 +0000 |
commit | 1f988f420ba3827941886962680f3e2ad6f01740 (patch) | |
tree | 9e89d69b1b1796491b144ba2253fda9f5226d3df /src/constrain.cpp | |
parent | 55b6a3f313670d2cb13847d1f1b04fe3e4b21d63 (diff) | |
download | resp-1f988f420ba3827941886962680f3e2ad6f01740.tar.gz resp-1f988f420ba3827941886962680f3e2ad6f01740.tar.bz2 resp-1f988f420ba3827941886962680f3e2ad6f01740.zip |
Exception specifiers.
More efficient constraints construction (c') in unify().
git-svn-id: http://svn.drobilla.net/resp/resp@253 ad02d1e2-f140-0410-9f75-f8b11f17cedd
Diffstat (limited to 'src/constrain.cpp')
-rw-r--r-- | src/constrain.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/constrain.cpp b/src/constrain.cpp index 4ab3924..c815bac 100644 --- a/src/constrain.cpp +++ b/src/constrain.cpp @@ -24,7 +24,7 @@ #define CONSTRAIN_LITERAL(CT, NAME) \ template<> void \ -ALiteral<CT>::constrain(TEnv& tenv, Constraints& c) const { \ +ALiteral<CT>::constrain(TEnv& tenv, Constraints& c) const throw(Error) { \ c.constrain(tenv, this, tenv.named(NAME)); \ } @@ -34,13 +34,13 @@ CONSTRAIN_LITERAL(float, "Float") CONSTRAIN_LITERAL(bool, "Bool") void -AString::constrain(TEnv& tenv, Constraints& c) const +AString::constrain(TEnv& tenv, Constraints& c) const throw(Error) { c.constrain(tenv, this, tenv.named("String")); } void -ASymbol::constrain(TEnv& tenv, Constraints& c) const +ASymbol::constrain(TEnv& tenv, Constraints& c) const throw(Error) { AType** ref = tenv.ref(this); THROW_IF(!ref, loc, (format("undefined symbol `%1%'") % cppstr).str()); @@ -48,7 +48,7 @@ ASymbol::constrain(TEnv& tenv, Constraints& c) const } void -ATuple::constrain(TEnv& tenv, Constraints& c) const +ATuple::constrain(TEnv& tenv, Constraints& c) const throw(Error) { AType* t = tup<AType>(loc, NULL); FOREACHP(const_iterator, p, this) { @@ -59,7 +59,7 @@ ATuple::constrain(TEnv& tenv, Constraints& c) const } void -AFn::constrain(TEnv& tenv, Constraints& c) const +AFn::constrain(TEnv& tenv, Constraints& c) const throw(Error) { set<const ASymbol*> defs; TEnv::Frame frame; @@ -110,7 +110,7 @@ AFn::constrain(TEnv& tenv, Constraints& c) const } void -ACall::constrain(TEnv& tenv, Constraints& c) const +ACall::constrain(TEnv& tenv, Constraints& c) const throw(Error) { for (const_iterator i = begin(); i != end(); ++i) (*i)->constrain(tenv, c); @@ -137,7 +137,7 @@ ACall::constrain(TEnv& tenv, Constraints& c) const } void -ADef::constrain(TEnv& tenv, Constraints& c) const +ADef::constrain(TEnv& tenv, Constraints& c) const throw(Error) { THROW_IF(size() != 3, loc, "`def' requires exactly 2 arguments"); const ASymbol* sym = this->sym(); @@ -151,7 +151,7 @@ ADef::constrain(TEnv& tenv, Constraints& c) const } void -AIf::constrain(TEnv& tenv, Constraints& c) const +AIf::constrain(TEnv& tenv, Constraints& c) const throw(Error) { THROW_IF(size() < 4, loc, "`if' requires at least 3 arguments"); THROW_IF(size() % 2 != 0, loc, "`if' missing final else clause") @@ -173,7 +173,7 @@ AIf::constrain(TEnv& tenv, Constraints& c) const } void -ACons::constrain(TEnv& tenv, Constraints& c) const +ACons::constrain(TEnv& tenv, Constraints& c) const throw(Error) { AType* type = tup<AType>(loc, tenv.Tup, 0); for (const_iterator i = begin() + 1; i != end(); ++i) { @@ -185,7 +185,7 @@ ACons::constrain(TEnv& tenv, Constraints& c) const } void -ADot::constrain(TEnv& tenv, Constraints& c) const +ADot::constrain(TEnv& tenv, Constraints& c) const throw(Error) { THROW_IF(size() != 3, loc, "`.' requires exactly 2 arguments"); const_iterator i = begin(); @@ -206,7 +206,7 @@ ADot::constrain(TEnv& tenv, Constraints& c) const } void -APrimitive::constrain(TEnv& tenv, Constraints& c) const +APrimitive::constrain(TEnv& tenv, Constraints& c) const throw(Error) { const string n = head()->to<const ASymbol*>()->str(); enum { ARITHMETIC, BINARY, LOGICAL, COMPARISON } type; |