version 1.317, 2017/06/25 11:42:02 |
version 1.318, 2017/07/04 22:52:00 |
Line 1926 roff_cond_sub(ROFF_ARGS) |
|
Line 1926 roff_cond_sub(ROFF_ARGS) |
|
|
|
rr = r->last->rule; |
rr = r->last->rule; |
roffnode_cleanscope(r); |
roffnode_cleanscope(r); |
t = roff_parse(r, buf->buf, &pos, ln, ppos); |
|
|
|
/* |
/* |
* Fully handle known macros when they are structurally |
|
* required or when the conditional evaluated to true. |
|
*/ |
|
|
|
if (t != TOKEN_NONE && (rr || roffs[t].flags & ROFFMAC_STRUCT)) |
|
return (*roffs[t].proc)(r, t, buf, ln, ppos, pos, offs); |
|
|
|
/* |
|
* If `\}' occurs on a macro line without a preceding macro, |
* If `\}' occurs on a macro line without a preceding macro, |
* drop the line completely. |
* drop the line completely. |
*/ |
*/ |
Line 1948 roff_cond_sub(ROFF_ARGS) |
|
Line 1939 roff_cond_sub(ROFF_ARGS) |
|
/* Always check for the closing delimiter `\}'. */ |
/* Always check for the closing delimiter `\}'. */ |
|
|
while ((ep = strchr(ep, '\\')) != NULL) { |
while ((ep = strchr(ep, '\\')) != NULL) { |
if (*(++ep) == '}') { |
switch (ep[1]) { |
*ep = '&'; |
case '}': |
roff_ccond(r, ln, ep - buf->buf - 1); |
memmove(ep, ep + 2, strlen(ep + 2) + 1); |
} |
roff_ccond(r, ln, ep - buf->buf); |
if (*ep != '\0') |
break; |
|
case '\0': |
++ep; |
++ep; |
|
break; |
|
default: |
|
ep += 2; |
|
break; |
|
} |
} |
} |
return rr ? ROFF_CONT : ROFF_IGN; |
|
|
/* |
|
* Fully handle known macros when they are structurally |
|
* required or when the conditional evaluated to true. |
|
*/ |
|
|
|
t = roff_parse(r, buf->buf, &pos, ln, ppos); |
|
return t != TOKEN_NONE && (rr || roffs[t].flags & ROFFMAC_STRUCT) |
|
? (*roffs[t].proc)(r, t, buf, ln, ppos, pos, offs) : rr |
|
? ROFF_CONT : ROFF_IGN; |
} |
} |
|
|
static enum rofferr |
static enum rofferr |