version 1.86, 2010/06/30 04:05:02 |
version 1.89, 2010/07/01 21:12:00 |
Line 97 const struct mdoc_macro __mdoc_macros[MDOC_MAX] = { |
|
Line 97 const struct mdoc_macro __mdoc_macros[MDOC_MAX] = { |
|
{ in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* In */ |
{ in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* In */ |
{ in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Li */ |
{ in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Li */ |
{ blk_full, 0 }, /* Nd */ |
{ blk_full, 0 }, /* Nd */ |
{ in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Nm */ |
{ ctx_synopsis, MDOC_CALLABLE | MDOC_PARSED }, /* Nm */ |
{ blk_part_imp, MDOC_CALLABLE | MDOC_PARSED }, /* Op */ |
{ blk_part_imp, MDOC_CALLABLE | MDOC_PARSED }, /* Op */ |
{ obsolete, 0 }, /* Ot */ |
{ obsolete, 0 }, /* Ot */ |
{ in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Pa */ |
{ in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Pa */ |
Line 392 rew_dohalt(enum mdoct tok, enum mdoc_type type, |
|
Line 392 rew_dohalt(enum mdoct tok, enum mdoc_type type, |
|
if (MDOC_Op == p->tok) |
if (MDOC_Op == p->tok) |
return(REWIND_MORE); |
return(REWIND_MORE); |
break; |
break; |
|
case (MDOC_Nm): |
|
return(REWIND_NONE); |
case (MDOC_Nd): |
case (MDOC_Nd): |
/* FALLTHROUGH */ |
/* FALLTHROUGH */ |
case (MDOC_Ss): |
case (MDOC_Ss): |
Line 409 rew_dohalt(enum mdoct tok, enum mdoc_type type, |
|
Line 411 rew_dohalt(enum mdoct tok, enum mdoc_type type, |
|
|
|
/* |
/* |
* Default block rewinding rules. |
* Default block rewinding rules. |
* In particular, always skip block end markers. |
* In particular, always skip block end markers, |
|
* and let all blocks rewind Nm children. |
*/ |
*/ |
if (p->end || (MDOC_BLOCK == p->type && |
if (ENDBODY_NOT != p->end || MDOC_Nm == p->tok || |
|
(MDOC_BLOCK == p->type && |
! (MDOC_EXPLICIT & mdoc_macros[tok].flags))) |
! (MDOC_EXPLICIT & mdoc_macros[tok].flags))) |
return(REWIND_MORE); |
return(REWIND_MORE); |
|
|
Line 507 make_pending(struct mdoc_node *broken, enum mdoct tok, |
|
Line 511 make_pending(struct mdoc_node *broken, enum mdoct tok, |
|
taker->pending = broken->pending; |
taker->pending = broken->pending; |
} |
} |
broken->pending = breaker; |
broken->pending = breaker; |
mdoc_vmsg(m, MANDOCERR_SCOPE, line, ppos, "%s breaks %s", |
mdoc_vmsg(m, MANDOCERR_SCOPENEST, line, ppos, |
mdoc_macronames[tok], mdoc_macronames[broken->tok]); |
"%s breaks %s", mdoc_macronames[tok], |
|
mdoc_macronames[broken->tok]); |
return(1); |
return(1); |
} |
} |
|
|
Line 542 rew_sub(enum mdoc_type t, struct mdoc *m, |
|
Line 547 rew_sub(enum mdoc_type t, struct mdoc *m, |
|
return(make_pending(n, tok, m, line, ppos)); |
return(make_pending(n, tok, m, line, ppos)); |
case (REWIND_ERROR): |
case (REWIND_ERROR): |
/* XXX Make this non-fatal. */ |
/* XXX Make this non-fatal. */ |
mdoc_pmsg(m, line, ppos, MANDOCERR_SYNTNOSCOPE); |
mdoc_vmsg(m, MANDOCERR_SCOPEFATAL, line, ppos, |
|
"%s cannot break %s", mdoc_macronames[tok], |
|
mdoc_macronames[n->tok]); |
return 0; |
return 0; |
} |
} |
break; |
break; |
Line 648 blk_exp_close(MACRO_PROT_ARGS) |
|
Line 655 blk_exp_close(MACRO_PROT_ARGS) |
|
|
|
/* Remember the start of our own body. */ |
/* Remember the start of our own body. */ |
if (MDOC_BODY == n->type && atok == n->tok) { |
if (MDOC_BODY == n->type && atok == n->tok) { |
if ( ! n->end) |
if (ENDBODY_NOT == n->end) |
body = n; |
body = n; |
continue; |
continue; |
} |
} |
|
|
if (MDOC_BLOCK != n->type) |
if (MDOC_BLOCK != n->type || MDOC_Nm == n->tok) |
continue; |
continue; |
if (atok == n->tok) { |
if (atok == n->tok) { |
assert(body); |
assert(body); |
Line 1018 blk_full(MACRO_PROT_ARGS) |
|
Line 1025 blk_full(MACRO_PROT_ARGS) |
|
lac = ARGS_ERROR == ac ? ARGS_PEND : ac; |
lac = ARGS_ERROR == ac ? ARGS_PEND : ac; |
ac = mdoc_args(m, line, pos, buf, tok, &p); |
ac = mdoc_args(m, line, pos, buf, tok, &p); |
|
|
|
if (ARGS_PUNCT == ac) |
|
break; |
|
|
if (ARGS_ERROR == ac) |
if (ARGS_ERROR == ac) |
return(0); |
return(0); |
|
|
Line 1290 blk_part_imp(MACRO_PROT_ARGS) |
|
Line 1300 blk_part_imp(MACRO_PROT_ARGS) |
|
* is ugly behaviour nodding its head to OpenBSD's overwhelming |
* is ugly behaviour nodding its head to OpenBSD's overwhelming |
* crufty use of `Op' breakage. |
* crufty use of `Op' breakage. |
*/ |
*/ |
if (n != body && ! mdoc_vmsg(m, MANDOCERR_SCOPE, line, ppos, |
if (n != body && ! mdoc_vmsg(m, MANDOCERR_SCOPENEST, |
"%s broken", mdoc_macronames[tok])) |
line, ppos, "%s broken", mdoc_macronames[tok])) |
return(0); |
return(0); |
|
|
if (n && ! rew_sub(MDOC_BODY, m, tok, line, ppos)) |
if (n && ! rew_sub(MDOC_BODY, m, tok, line, ppos)) |
Line 1647 ctx_synopsis(MACRO_PROT_ARGS) |
|
Line 1657 ctx_synopsis(MACRO_PROT_ARGS) |
|
* up formatting the block scope, then child nodes will inherit |
* up formatting the block scope, then child nodes will inherit |
* the formatting. Be careful. |
* the formatting. Be careful. |
*/ |
*/ |
|
if (MDOC_Nm == tok) |
|
return(blk_full(m, tok, line, ppos, pos, buf)); |
|
assert(MDOC_Vt == tok); |
return(blk_part_imp(m, tok, line, ppos, pos, buf)); |
return(blk_part_imp(m, tok, line, ppos, pos, buf)); |
} |
} |
|
|