aboutsummaryrefslogtreecommitdiffstats
path: root/tuplr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tuplr.cpp')
-rw-r--r--tuplr.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/tuplr.cpp b/tuplr.cpp
index fbd3bd3..10233f9 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:
- THROW_IF(!stk.empty(), "unexpected end of file", cur)
+ THROW_IF(!stk.empty(), cur, "unexpected end of file")
return SExp(cur);
case ';':
while ((c = readChar(cur, in)) != '\n') {}
@@ -90,7 +90,7 @@ readExpression(Cursor& cur, istream& in)
case ')':
switch (stk.size()) {
case 0:
- throw Error("unexpected `)'", cur);
+ throw Error(cur, "unexpected `)'");
case 1:
PUSH(stk, tok);
return stk.top();
@@ -114,7 +114,7 @@ readExpression(Cursor& cur, istream& in)
switch (stk.size()) {
case 0: return SExp(loc, tok);
case 1: return stk.top();
- default: throw Error("missing `)'", cur);
+ default: throw Error(cur, "missing `)'");
}
return SExp(cur);
}
@@ -127,7 +127,7 @@ readExpression(Cursor& cur, istream& in)
inline SExp
macDef(PEnv& penv, const SExp& exp)
{
- THROW_IF(exp.size() != 3, "[MAC] `def' requires exactly 2 arguments", exp.loc)
+ THROW_IF(exp.size() != 3, exp.loc, "[MAC] `def' requires exactly 2 arguments")
if (exp.at(1).type == SExp::ATOM) {
return exp;
} else {
@@ -170,9 +170,9 @@ inline AST*
parseFn(PEnv& penv, const SExp& exp, void* arg)
{
if (exp.size() < 2)
- throw Error("Missing function parameters and body", exp.loc);
+ throw Error(exp.loc, "Missing function parameters and body");
else if (exp.size() < 3)
- throw Error("Missing function body", exp.loc);
+ throw Error(exp.loc, "Missing function body");
SExp::const_iterator a = exp.begin(); ++a;
AClosure* ret = new AClosure(exp.loc, penv.sym("fn"), new ATuple(penv.parseTuple(*a++)));
while (a != exp.end())