* mdocml: Add a FATAL error for when no manual type was assigned (you can
@ 2011-03-22 10:35 kristaps
0 siblings, 0 replies; only message in thread
From: kristaps @ 2011-03-22 10:35 UTC (permalink / raw)
To: source
Log Message:
-----------
Add a FATAL error for when no manual type was assigned (you can repeat
this for yourself by having a file consisting only of comments).
Modified Files:
--------------
mdocml:
main.c
mandoc.h
read.c
Revision Data
-------------
Index: mandoc.h
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mandoc.h,v
retrieving revision 1.65
retrieving revision 1.66
diff -Lmandoc.h -Lmandoc.h -u -p -r1.65 -r1.66
--- mandoc.h
+++ mandoc.h
@@ -137,6 +137,7 @@ enum mandocerr {
MANDOCERR_FATAL, /* ===== start of fatal errors ===== */
+ MANDOCERR_NOTMANUAL, /* manual isn't really a manual */
MANDOCERR_COLUMNS, /* column syntax is inconsistent */
MANDOCERR_BADDISP, /* NOT IMPLEMENTED: .Bd -file */
MANDOCERR_SYNTLINESCOPE, /* line scope broken, syntax violated */
Index: read.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/read.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -Lread.c -Lread.c -u -p -r1.5 -r1.6
--- read.c
+++ read.c
@@ -496,16 +496,11 @@ mparse_end(struct mparse *curp)
return;
}
-#if 0
- /* FIXME: NOTE a parser may not have been assigned, yet. */
-
if ( ! (curp->man || curp->mdoc)) {
- /* FIXME: make into an mandoc.h error. */
- fprintf(stderr, "%s: Not a manual\n", curp->file);
+ mandoc_msg(MANDOCERR_NOTMANUAL, curp, 1, 0, NULL);
curp->file_status = MANDOCLEVEL_FATAL;
- goto cleanup;
+ return;
}
-#endif
roff_endparse(curp->roff);
}
Index: main.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/main.c,v
retrieving revision 1.157
retrieving revision 1.158
diff -Lmain.c -Lmain.c -u -p -r1.157 -r1.158
--- main.c
+++ main.c
@@ -168,6 +168,7 @@ static const char * const mandocerrs[MAN
"generic fatal error",
+ "not a manual",
"column syntax is inconsistent",
"NOT IMPLEMENTED: .Bd -file",
"line scope broken, syntax violated",
--
To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2011-03-22 10:35 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-22 10:35 mdocml: Add a FATAL error for when no manual type was assigned (you can kristaps
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).