version 1.99, 2010/08/24 12:48:43 |
version 1.101, 2010/09/04 18:31:44 |
|
|
ROFF_rm, |
ROFF_rm, |
ROFF_tr, |
ROFF_tr, |
ROFF_cblock, |
ROFF_cblock, |
ROFF_ccond, |
ROFF_ccond, /* FIXME: remove this. */ |
ROFF_nr, |
ROFF_nr, |
ROFF_MAX |
ROFF_MAX |
}; |
}; |
Line 248 roffnode_pop(struct roff *r) |
|
Line 248 roffnode_pop(struct roff *r) |
|
if (r->rstackpos > -1) |
if (r->rstackpos > -1) |
r->rstackpos--; |
r->rstackpos--; |
|
|
|
ROFF_DEBUG("roff: popping scope\n"); |
r->last = r->last->parent; |
r->last = r->last->parent; |
if (p->end) |
if (p->end) |
free(p->end); |
free(p->end); |
Line 426 roff_parseln(struct roff *r, int ln, char **bufp, |
|
Line 427 roff_parseln(struct roff *r, int ln, char **bufp, |
|
if (r->last) { |
if (r->last) { |
t = r->last->tok; |
t = r->last->tok; |
assert(roffs[t].sub); |
assert(roffs[t].sub); |
ROFF_DEBUG("roff: intercept scoped context: %s\n", |
ROFF_DEBUG("roff: intercept scoped context: %s, [%s]\n", |
roffs[t].name); |
roffs[t].name, &(*bufp)[pos]); |
return((*roffs[t].sub) |
return((*roffs[t].sub) |
(r, t, bufp, szp, |
(r, t, bufp, szp, |
ln, pos, pos, offs)); |
ln, pos, pos, offs)); |
Line 761 roff_cond_sub(ROFF_ARGS) |
|
Line 762 roff_cond_sub(ROFF_ARGS) |
|
l = r->last; |
l = r->last; |
roffnode_cleanscope(r); |
roffnode_cleanscope(r); |
|
|
if (l != r->last) |
if (ROFF_MAX == (t = roff_parse(*bufp, &pos))) { |
|
if ('\\' == (*bufp)[pos] && '}' == (*bufp)[pos + 1]) |
|
return(roff_ccond |
|
(r, ROFF_ccond, bufp, szp, |
|
ln, pos, pos + 2, offs)); |
return(ROFFRULE_DENY == rr ? ROFF_IGN : ROFF_CONT); |
return(ROFFRULE_DENY == rr ? ROFF_IGN : ROFF_CONT); |
|
} |
|
|
if (ROFF_MAX == (t = roff_parse(*bufp, &pos))) |
|
return(ROFFRULE_DENY == rr ? ROFF_IGN : ROFF_CONT); |
|
|
|
/* |
/* |
* A denied conditional must evaluate its children if and only |
* A denied conditional must evaluate its children if and only |
* if they're either structurally required (such as loops and |
* if they're either structurally required (such as loops and |
Line 796 roff_cond_text(ROFF_ARGS) |
|
Line 799 roff_cond_text(ROFF_ARGS) |
|
* We display the value of the text if out current evaluation |
* We display the value of the text if out current evaluation |
* scope permits us to do so. |
* scope permits us to do so. |
*/ |
*/ |
|
|
|
/* FIXME: use roff_ccond? */ |
|
|
st = &(*bufp)[pos]; |
st = &(*bufp)[pos]; |
if (NULL == (ep = strstr(st, "\\}"))) { |
if (NULL == (ep = strstr(st, "\\}"))) { |