From 5faf51234f0279c057c58a6c26cf35f4266bedaf Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 7 Mar 2009 05:16:30 +0000 Subject: Remove redundant/useless ASTCall::exp git-svn-id: http://svn.drobilla.net/resp/tuplr@77 ad02d1e2-f140-0410-9f75-f8b11f17cedd --- typing.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'typing.cpp') diff --git a/typing.cpp b/typing.cpp index 837b1c3..759a418 100644 --- a/typing.cpp +++ b/typing.cpp @@ -57,9 +57,9 @@ ASTCall::constrain(TEnv& tenv) const void ASTDefinition::constrain(TEnv& tenv) const { - if (size() != 3) throw Error("`def' requires exactly 2 arguments", exp.loc); + if (size() != 3) throw Error("`def' requires exactly 2 arguments", loc); if (!dynamic_cast(at(1))) - throw Error("`def' name is not a symbol", exp.loc); + throw Error("`def' name is not a symbol", loc); FOREACH(const_iterator, p, *this) (*p)->constrain(tenv); AType* tvar = tenv.type(this); @@ -70,8 +70,8 @@ ASTDefinition::constrain(TEnv& tenv) const void ASTIf::constrain(TEnv& tenv) const { - if (size() < 3) throw Error("`if' requires exactly 3 arguments", exp.loc); - if (size() % 2 != 0) throw Error("`if' missing final else clause", exp.loc); + if (size() < 3) throw Error("`if' requires exactly 3 arguments", loc); + if (size() % 2 != 0) throw Error("`if' missing final else clause", loc); FOREACH(const_iterator, p, *this) (*p)->constrain(tenv); AType* retT = tenv.type(this); @@ -99,7 +99,7 @@ ASTPrimitive::constrain(TEnv& tenv) const else if (n == "=" || n == "!=" || n == ">" || n == ">=" || n == "<" || n == "<=") type = COMPARISON; else - throw Error((format("unknown primitive `%1%'") % n).str(), exp.loc); + throw Error((format("unknown primitive `%1%'") % n).str(), loc); FOREACH(const_iterator, p, *this) (*p)->constrain(tenv); @@ -107,31 +107,31 @@ ASTPrimitive::constrain(TEnv& tenv) const switch (type) { case ARITHMETIC: if (size() < 3) - throw Error((format("`%1%' requires at least 2 arguments") % n).str(), exp.loc); + throw Error((format("`%1%' requires at least 2 arguments") % n).str(), loc); for (size_t i = 1; i < size(); ++i) tenv.constrain(at(i), tenv.type(this)); break; case BINARY: if (size() != 3) - throw Error((format("`%1%' requires exactly 2 arguments") % n).str(), exp.loc); + throw Error((format("`%1%' requires exactly 2 arguments") % n).str(), loc); tenv.constrain(at(1), tenv.type(this)); tenv.constrain(at(2), tenv.type(this)); break; case BITWISE: if (size() != 3) - throw Error((format("`%1%' requires exactly 2 arguments") % n).str(), exp.loc); + throw Error((format("`%1%' requires exactly 2 arguments") % n).str(), loc); tenv.constrain(this, tenv.named("Bool")); tenv.constrain(at(1), tenv.named("Bool")); tenv.constrain(at(2), tenv.named("Bool")); break; case COMPARISON: if (size() != 3) - throw Error((format("`%1%' requires exactly 2 arguments") % n).str(), exp.loc); + throw Error((format("`%1%' requires exactly 2 arguments") % n).str(), loc); tenv.constrain(this, tenv.named("Bool")); tenv.constrain(at(1), tenv.type(at(2))); break; default: - throw Error((format("unknown primitive `%1%'") % n).str(), exp.loc); + throw Error((format("unknown primitive `%1%'") % n).str(), loc); } } -- cgit v1.2.1