version 1.28, 2010/02/18 02:11:26 |
version 1.29, 2010/02/26 12:12:24 |
|
|
} |
} |
|
|
assert(n); |
assert(n); |
return(rew_last(m, n)); |
if ( ! rew_last(m, n)) |
|
return(0); |
|
|
|
/* |
|
* The current block extends an enclosing block beyond a line break. |
|
* Now that the current block ends, close the enclosing block, too. |
|
*/ |
|
if ((n = n->pending) != NULL) { |
|
assert(MDOC_HEAD == n->type); |
|
if ( ! rew_last(m, n)) |
|
return(0); |
|
if ( ! mdoc_body_alloc(m, n->line, n->pos, n->tok)) |
|
return(0); |
|
} |
|
return(1); |
} |
} |
|
|
|
|
|
|
{ |
{ |
int c, lastarg, reopen, dohead; |
int c, lastarg, reopen, dohead; |
struct mdoc_arg *arg; |
struct mdoc_arg *arg; |
|
struct mdoc_node *head, *n; |
char *p; |
char *p; |
|
|
/* |
/* |
|
|
|
|
if ( ! mdoc_block_alloc(m, line, ppos, tok, arg)) |
if ( ! mdoc_block_alloc(m, line, ppos, tok, arg)) |
return(0); |
return(0); |
|
if ( ! mdoc_head_alloc(m, line, ppos, tok)) |
|
return(0); |
|
head = m->last; |
|
|
if (0 == buf[*pos]) { |
if (0 == buf[*pos]) { |
if ( ! mdoc_head_alloc(m, line, ppos, tok)) |
|
return(0); |
|
if ( ! rew_sub(MDOC_HEAD, m, tok, line, ppos)) |
if ( ! rew_sub(MDOC_HEAD, m, tok, line, ppos)) |
return(0); |
return(0); |
if ( ! mdoc_body_alloc(m, line, ppos, tok)) |
if ( ! mdoc_body_alloc(m, line, ppos, tok)) |
|
|
return(1); |
return(1); |
} |
} |
|
|
if ( ! mdoc_head_alloc(m, line, ppos, tok)) |
|
return(0); |
|
|
|
/* Immediately close out head and enter body, if applicable. */ |
/* Immediately close out head and enter body, if applicable. */ |
|
|
if (0 == dohead) { |
if (0 == dohead) { |
|
|
assert(dohead); |
assert(dohead); |
if (reopen && ! mdoc_head_alloc(m, line, ppos, tok)) |
if (reopen && ! mdoc_head_alloc(m, line, ppos, tok)) |
return(0); |
return(0); |
|
head = m->last; |
/* |
/* |
* Phrases are self-contained macro phrases used |
* Phrases are self-contained macro phrases used |
* in the columnar output of a macro. They need |
* in the columnar output of a macro. They need |
|
|
/* If the body's already open, then just return. */ |
/* If the body's already open, then just return. */ |
if (0 == dohead) |
if (0 == dohead) |
return(1); |
return(1); |
|
|
|
/* |
|
* If there is an open sub-block requiring explicit close-out, |
|
* postpone switching the current block from head to body |
|
* until the rew_sub() call closing out that sub-block. |
|
*/ |
|
for (n = m->last; n && n != head; n = n->parent) { |
|
if (MDOC_BLOCK == n->type && |
|
MDOC_EXPLICIT & mdoc_macros[n->tok].flags) { |
|
n->pending = head; |
|
return(1); |
|
} |
|
} |
|
|
if ( ! rew_sub(MDOC_HEAD, m, tok, line, ppos)) |
if ( ! rew_sub(MDOC_HEAD, m, tok, line, ppos)) |
return(0); |
return(0); |