shithub: mc

Download patch

ref: 2a0ea983cd6365e3212abe5a5ce3cf74a554daf9
parent: f45a27f1db8e7c29671b7793fd131334194df000
author: Ori Bernstein <ori@eigenstate.org>
date: Mon Jul 3 18:35:17 EDT 2017

Clean up formatting of error reporting.

--- a/parse/stab.c
+++ b/parse/stab.c
@@ -404,8 +404,8 @@
 
 	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 @@
 	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 @@
 	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);
 }