From d8c876402bb348abc7d1fb539f245e7ba8c4ce27 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 18 Jun 2009 20:40:31 +0000 Subject: THROW_IF macro. git-svn-id: http://svn.drobilla.net/resp/tuplr@120 ad02d1e2-f140-0410-9f75-f8b11f17cedd --- tuplr.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tuplr.cpp') diff --git a/tuplr.cpp b/tuplr.cpp index c13b9bc..fbd3bd3 100644 --- a/tuplr.cpp +++ b/tuplr.cpp @@ -72,7 +72,7 @@ readExpression(Cursor& cur, istream& in) while (int c = readChar(cur, in)) { switch (c) { case EOF: - if (!stk.empty()) throw Error("unexpected end of file", cur); + THROW_IF(!stk.empty(), "unexpected end of file", cur) return SExp(cur); case ';': while ((c = readChar(cur, in)) != '\n') {} @@ -127,7 +127,7 @@ readExpression(Cursor& cur, istream& in) inline SExp macDef(PEnv& penv, const SExp& exp) { - if (exp.size() != 3) throw Error("`def' requires exactly 2 arguments", exp.loc); + THROW_IF(exp.size() != 3, "[MAC] `def' requires exactly 2 arguments", exp.loc) if (exp.at(1).type == SExp::ATOM) { return exp; } else { -- cgit v1.2.1