aboutsummaryrefslogtreecommitdiff
path: root/bootstrap/util.c
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2022-08-07 15:26:53 +0200
committerlemon <lsof@mailbox.org>2022-08-07 15:29:04 +0200
commit92bbf45f333bbf9190befc52a6bc114dc2957e41 (patch)
tree87196fb07a02e1eb6cb5048da86dadd30a69ddc1 /bootstrap/util.c
parent0a4f81e86d21d056329a2b7b2186152e9b9c2375 (diff)
basic templates (generics)
Diffstat (limited to 'bootstrap/util.c')
-rw-r--r--bootstrap/util.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/bootstrap/util.c b/bootstrap/util.c
index 43aa1b4..20f1772 100644
--- a/bootstrap/util.c
+++ b/bootstrap/util.c
@@ -118,7 +118,7 @@ eprifileline(struct span span) {
}
// line begin
for (i = span.idx; i > 0 && src[i] != '\n'; --i) ;
- ++i;
+ if (i > 0) ++i;
// line end
for (j = span.idx; src[j] && src[j] != '\n'; ++j) ;
@@ -148,8 +148,8 @@ fatal(struct parser *P, struct span span, const char *fmt, ...) {
for (struct expan *ep = P->curexpan; ep; ep = ep->prev, ++i) {
if (ep->name && (i < 8 || !ep->prev || !ep->prev->prev)) {
span = ep->span;
- epri("* while expanding macro `%s' at %s:%d:%d\n",
- ep->name,
+ epri("* while expanding %s `%s' at %s:%d:%d\n",
+ ep->tepl ? "template" : "macro", ep->name,
fileid2path(ep->span.fileid), span.line, span.col);
eprifileline(span);
} else if (ep->name && i == 10) {