summaryrefslogtreecommitdiff
path: root/parse/stab.c
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-07-03 22:35:17 -0700
committerOri Bernstein <ori@eigenstate.org>2017-07-03 23:27:02 -0700
commit2a0ea983cd6365e3212abe5a5ce3cf74a554daf9 (patch)
tree76df3426545aeef596d3e6695875a3494c14251e /parse/stab.c
parentf45a27f1db8e7c29671b7793fd131334194df000 (diff)
downloadmc-2a0ea983cd6365e3212abe5a5ce3cf74a554daf9.tar.gz
Clean up formatting of error reporting.
Diffstat (limited to 'parse/stab.c')
-rw-r--r--parse/stab.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/parse/stab.c b/parse/stab.c
index 6017d47..605dab3 100644
--- a/parse/stab.c
+++ b/parse/stab.c
@@ -404,8 +404,8 @@ void putucon(Stab *st, Ucon *uc)
old = getucon(st, uc->name);
if (old)
- lfatal(old->loc, "`%s already defined on %s:%d", namestr(uc->name), fname(uc->loc),
- lnum(uc->loc));
+ lfatal(old->loc, "`%s already defined on %s:%d",
+ namestr(uc->name), fname(uc->loc), lnum(uc->loc));
setns(uc->name, st->name);
htput(st->uc, uc->name, uc);
}
@@ -430,12 +430,12 @@ void puttrait(Stab *st, Node *n, Trait *c)
st = findstab(st, n);
t = gettrait(st, n);
if (t && !mergetrait(t, c))
- fatal(n, "Trait %s already defined on %s:%d", namestr(n), fname(t->loc),
- lnum(t->loc));
+ fatal(n, "Trait %s already defined on %s:%d",
+ namestr(n), fname(t->loc), lnum(t->loc));
ty = gettype(st, n);
if (ty)
- fatal(n, "Trait %s defined as a type on %s:%d", namestr(n), fname(ty->loc),
- lnum(ty->loc));
+ fatal(n, "Trait %s defined as a type on %s:%d",
+ namestr(n), fname(ty->loc), lnum(ty->loc));
td = xalloc(sizeof(Traitdefn));
td->loc = n->loc;
td->name = n;
@@ -474,10 +474,12 @@ void putimpl(Stab *st, Node *n)
impl = getimpl(st, n);
if (impl && !mergeimpl(impl, n))
fatal(n, "Trait %s already implemented over %s at %s:%d",
- namestr(n->impl.traitname), tystr(n->impl.type), fname(n->loc), lnum(n->loc));
+ namestr(n->impl.traitname), tystr(n->impl.type),
+ fname(n->loc), lnum(n->loc));
/*
- * The impl is not defined in this file, so setting the trait name would be a bug here.
- */
+ The impl is not defined in this file, so setting the
+ trait name would be a bug here.
+ */
setns(n->impl.traitname, st->name);
htput(st->impl, n, n);
}