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 p3D9vgpG002112 for ; Wed, 13 Apr 2011 05:57:42 -0400 (EDT) Received: (from kristaps@localhost) by krisdoz.my.domain (8.14.3/8.14.3/Submit) id p3D9vf1j005339; Wed, 13 Apr 2011 05:57:41 -0400 (EDT) Date: Wed, 13 Apr 2011 05:57:41 -0400 (EDT) Message-Id: <201104130957.p3D9vf1j005339@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: Remove TODO from prior commit of lifting warnings from `Sh', X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Log Message: ----------- Remove TODO from prior commit of lifting warnings from `Sh', `Ss', `SH', and `SS' bodies. Modified Files: -------------- mdocml: TODO roff.c Revision Data ------------- Index: TODO =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/TODO,v retrieving revision 1.99 retrieving revision 1.100 diff -LTODO -LTODO -u -p -r1.99 -r1.100 --- TODO +++ TODO @@ -320,13 +320,6 @@ * error reporting issues ************************************************************************ -- In man(7), an empty subsection (.SS) should not be an error, probably - not even a warning. For example, in ExtUtils::CChecker(3p), this is - used in a way similar to empty .It -tag in mdoc(7), that is, explaining - two commands (both presented with .SS markup) in one paragraph of text. - Reported by Gleydson Soares - on ports@ Tue, 12 Apr 2011 15:39:26 -0300 - ************************************************************************ * performance issues ************************************************************************ Index: roff.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/roff.c,v retrieving revision 1.131 retrieving revision 1.132 diff -Lroff.c -Lroff.c -u -p -r1.131 -r1.132 --- roff.c +++ roff.c @@ -277,10 +277,6 @@ roffnode_pop(struct roff *r) assert(r->last); p = r->last; - if (ROFF_el == p->tok) - if (r->rstackpos > -1) - r->rstackpos--; - r->last = r->last->parent; free(p->name); free(p->end); @@ -976,29 +972,20 @@ roff_cond(ROFF_ARGS) int sv; enum roffrule rule; - /* Stack overflow! */ + /* + * An `.el' has no conditional body: it will consume the value + * of the current rstack entry set in prior `ie' calls or + * defaults to DENY. + * + * If we're not an `el', however, then evaluate the conditional. + */ - if (ROFF_ie == tok && r->rstackpos == RSTACK_MAX - 1) { - mandoc_msg(MANDOCERR_MEM, r->parse, ln, ppos, NULL); - return(ROFF_ERR); - } - - /* First, evaluate the conditional. */ - - if (ROFF_el == tok) { - /* - * An `.el' will get the value of the current rstack - * entry set in prior `ie' calls or defaults to DENY. - */ - if (r->rstackpos < 0) - rule = ROFFRULE_DENY; - else - rule = r->rstack[r->rstackpos]; - } else - rule = roff_evalcond(*bufp, &pos); + rule = ROFF_el == tok ? + (r->rstackpos < 0 ? + ROFFRULE_DENY : r->rstack[r->rstackpos--]) : + roff_evalcond(*bufp, &pos); sv = pos; - while (' ' == (*bufp)[pos]) pos++; @@ -1018,16 +1005,20 @@ roff_cond(ROFF_ARGS) r->last->rule = rule; + /* + * An if-else will put the NEGATION of the current evaluated + * conditional into the stack of rules. + */ + if (ROFF_ie == tok) { - /* - * An if-else will put the NEGATION of the current - * evaluated conditional into the stack. - */ - r->rstackpos++; - if (ROFFRULE_DENY == r->last->rule) - r->rstack[r->rstackpos] = ROFFRULE_ALLOW; - else - r->rstack[r->rstackpos] = ROFFRULE_DENY; + if (r->rstackpos == RSTACK_MAX - 1) { + mandoc_msg(MANDOCERR_MEM, + r->parse, ln, ppos, NULL); + return(ROFF_ERR); + } + r->rstack[++r->rstackpos] = + ROFFRULE_DENY == r->last->rule ? + ROFFRULE_ALLOW : ROFFRULE_DENY; } /* If the parent has false as its rule, then so do we. */ -- To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv