From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from krisdoz.my.domain (schwarze@localhost [127.0.0.1]) by krisdoz.my.domain (8.14.5/8.14.5) with ESMTP id s67GCLcp009679 for ; Mon, 7 Jul 2014 12:12:21 -0400 (EDT) Received: (from schwarze@localhost) by krisdoz.my.domain (8.14.5/8.14.3/Submit) id s67GCL67025528; Mon, 7 Jul 2014 12:12:21 -0400 (EDT) Date: Mon, 7 Jul 2014 12:12:21 -0400 (EDT) Message-Id: <201407071612.s67GCL67025528@krisdoz.my.domain> X-Mailinglist: mdocml-source Reply-To: source@mdocml.bsd.lv MIME-Version: 1.0 From: schwarze@mdocml.bsd.lv To: source@mdocml.bsd.lv Subject: mdocml: no need to delete any content from .Rs blocks, and downgrade the X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Log Message: ----------- no need to delete any content from .Rs blocks, and downgrade the related message from ERROR to WARNING Modified Files: -------------- mdocml: mandoc.h mdoc_validate.c read.c Revision Data ------------- Index: mdoc_validate.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_validate.c,v retrieving revision 1.229 retrieving revision 1.230 diff -Lmdoc_validate.c -Lmdoc_validate.c -u -p -r1.229 -r1.230 --- mdoc_validate.c +++ mdoc_validate.c @@ -1768,42 +1768,9 @@ post_rs(POST_ARGS) } /* - * Make sure only certain types of nodes are allowed within the - * the `Rs' body. Delete offending nodes and raise a warning. - * Do this before re-ordering for the sake of clarity. - */ - - next = NULL; - for (nn = mdoc->last->child; nn; nn = next) { - for (i = 0; i < RSORD_MAX; i++) - if (nn->tok == rsord[i]) - break; - - if (i < RSORD_MAX) { - if (MDOC__J == rsord[i] || MDOC__B == rsord[i]) - mdoc->last->norm->Rs.quote_T++; - next = nn->next; - continue; - } - - next = nn->next; - mandoc_msg(MANDOCERR_RS_SKIP, mdoc->parse, - nn->line, nn->pos, mdoc_macronames[nn->tok]); - mdoc_node_delete(mdoc, nn); - } - - /* - * Nothing to sort if only invalid nodes were found - * inside the `Rs' body. - */ - - if (NULL == mdoc->last->child) - return(1); - - /* * The full `Rs' block needs special handling to order the * sub-elements according to `rsord'. Pick through each element - * and correctly order it. This is a insertion sort. + * and correctly order it. This is an insertion sort. */ next = NULL; @@ -1813,6 +1780,14 @@ post_rs(POST_ARGS) if (rsord[i] == nn->tok) break; + if (i == RSORD_MAX) { + mandoc_msg(MANDOCERR_RS_BAD, + mdoc->parse, nn->line, nn->pos, + mdoc_macronames[nn->tok]); + i = -1; + } else if (MDOC__J == nn->tok || MDOC__B == nn->tok) + mdoc->last->norm->Rs.quote_T++; + /* * Remove `nn' from the chain. This somewhat * repeats mdoc_node_unlink(), but since we're @@ -1838,6 +1813,8 @@ post_rs(POST_ARGS) for (j = 0; j < RSORD_MAX; j++) if (rsord[j] == prev->tok) break; + if (j == RSORD_MAX) + j = -1; if (j <= i) break; Index: mandoc.h =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mandoc.h,v retrieving revision 1.139 retrieving revision 1.140 diff -Lmandoc.h -Lmandoc.h -u -p -r1.139 -r1.140 --- mandoc.h +++ mandoc.h @@ -105,6 +105,7 @@ enum mandocerr { MANDOCERR_BD_REP, /* skipping duplicate display type: type */ MANDOCERR_BL_REP, /* skipping duplicate list type: type */ MANDOCERR_AT_BAD, /* unknown AT&T UNIX version: version */ + MANDOCERR_RS_BAD, /* invalid content in Rs block: macro */ MANDOCERR_SM_BAD, /* invalid Boolean argument: macro arg */ MANDOCERR_FT_BAD, /* unknown font, skipping request: request font */ @@ -141,7 +142,6 @@ enum mandocerr { MANDOCERR_NONAME, /* manual name not yet set */ MANDOCERR_MACRO, /* skipping unknown macro */ MANDOCERR_ARGCOUNT, /* argument count wrong */ - MANDOCERR_RS_SKIP, /* skipping invalid content in .Rs block: macro */ MANDOCERR_ST_BAD, /* unknown standard specifier: standard */ MANDOCERR_STRAYTA, /* skipping column outside column list */ MANDOCERR_NOSCOPE, /* skipping end of block that is not open */ Index: read.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/read.c,v retrieving revision 1.66 retrieving revision 1.67 diff -Lread.c -Lread.c -u -p -r1.66 -r1.67 --- read.c +++ read.c @@ -149,6 +149,7 @@ static const char * const mandocerrs[MAN "skipping duplicate display type", "skipping duplicate list type", "unknown AT&T UNIX version", + "invalid content in Rs block", "invalid Boolean argument", "unknown font, skipping request", @@ -185,7 +186,6 @@ static const char * const mandocerrs[MAN "manual name not yet set", "skipping unknown macro", "argument count wrong", - "skipping invalid content in .Rs block", "unknown standard specifier", "skipping column outside column list", "skipping end of block that is not open", -- To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv