From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from krisdoz.my.domain (kristaps@localhost [127.0.0.1]) by krisdoz.my.domain (8.14.3/8.14.3) with ESMTP id p2MAZQI8029072 for ; Tue, 22 Mar 2011 06:35:27 -0400 (EDT) Received: (from kristaps@localhost) by krisdoz.my.domain (8.14.3/8.14.3/Submit) id p2MAZQtt003064; Tue, 22 Mar 2011 06:35:26 -0400 (EDT) Date: Tue, 22 Mar 2011 06:35:26 -0400 (EDT) Message-Id: <201103221035.p2MAZQtt003064@krisdoz.my.domain> X-Mailinglist: mdocml-source Reply-To: source@mdocml.bsd.lv MIME-Version: 1.0 From: kristaps@mdocml.bsd.lv To: source@mdocml.bsd.lv Subject: mdocml: Add a FATAL error for when no manual type was assigned (you can X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 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