summaryrefslogtreecommitdiffstatshomepage
path: root/main.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2010-05-15 21:53:11 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2010-05-15 21:53:11 +0000
commitce277aae4c35b6a2028b2b30de0798f2fb205923 (patch)
treebd73e5621cc3ec29d6cb71861103f0ead2fddd2c /main.c
parent41c0c172fa779a830e564f1257bee34c155ba2d0 (diff)
downloadmandoc-ce277aae4c35b6a2028b2b30de0798f2fb205923.tar.gz
mandoc-ce277aae4c35b6a2028b2b30de0798f2fb205923.tar.zst
mandoc-ce277aae4c35b6a2028b2b30de0798f2fb205923.zip
The `ig' now supports `ig end-macro'.
Initial warning/error messages in place (still experimental).
Diffstat (limited to 'main.c')
-rw-r--r--main.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/main.c b/main.c
index f9f2d51c..2b256d2c 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.72 2010/05/15 18:43:59 kristaps Exp $ */
+/* $Id: main.c,v 1.73 2010/05/15 21:53:11 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -773,6 +773,14 @@ mwarn(void *arg, int line, int col, const char *msg)
return(1);
}
+static const char * const mandocerrs[MANDOCERR_MAX] = {
+ "ok",
+ "multi-line scope open on exit",
+ "request for scope closure when no matching scope is open",
+ "line arguments will be lost",
+ "memory exhausted"
+};
+
/*
* XXX: this is experimental code that will eventually become the
* generic means of covering all warnings and errors!
@@ -785,7 +793,12 @@ mmsg(enum mandocerr t, void *arg, int ln, int col, const char *msg)
cp = (struct curparse *)arg;
- /*fprintf(stderr, "%s:%d:%d: %s\n", cp->file, ln, col + 1, msg);*/
+ fprintf(stderr, "%s:%d:%d: %s", cp->file,
+ ln, col + 1, mandocerrs[t]);
+
+ if (msg)
+ fprintf(stderr, ": %s", msg);
+ fputc('\n', stderr);
return(1);
}