version 1.133, 2014/07/02 08:21:39 |
version 1.137, 2014/07/07 21:36:20 |
Line 234 mdoc_macroend(struct mdoc *mdoc) |
|
Line 234 mdoc_macroend(struct mdoc *mdoc) |
|
for ( ; n; n = n->parent) |
for ( ; n; n = n->parent) |
if (MDOC_BLOCK == n->type && |
if (MDOC_BLOCK == n->type && |
MDOC_EXPLICIT & mdoc_macros[n->tok].flags) |
MDOC_EXPLICIT & mdoc_macros[n->tok].flags) |
mdoc_nmsg(mdoc, n, MANDOCERR_SCOPEEXIT); |
mandoc_msg(MANDOCERR_BLK_NOEND, mdoc->parse, |
|
n->line, n->pos, mdoc_macronames[n->tok]); |
|
|
/* Rewind to the first. */ |
/* Rewind to the first. */ |
|
|
Line 528 make_pending(struct mdoc_node *broken, enum mdoct tok, |
|
Line 529 make_pending(struct mdoc_node *broken, enum mdoct tok, |
|
taker->pending = broken->pending; |
taker->pending = broken->pending; |
} |
} |
broken->pending = breaker; |
broken->pending = breaker; |
mandoc_vmsg(MANDOCERR_SCOPENEST, mdoc->parse, line, ppos, |
mandoc_vmsg(MANDOCERR_BLK_NEST, mdoc->parse, line, ppos, |
"%s breaks %s", mdoc_macronames[tok], |
"%s breaks %s", mdoc_macronames[tok], |
mdoc_macronames[broken->tok]); |
mdoc_macronames[broken->tok]); |
return(1); |
return(1); |
Line 558 rew_sub(enum mdoc_type t, struct mdoc *mdoc, |
|
Line 559 rew_sub(enum mdoc_type t, struct mdoc *mdoc, |
|
! (MDOC_EXPLICIT & mdoc_macros[tok].flags)); |
! (MDOC_EXPLICIT & mdoc_macros[tok].flags)); |
break; |
break; |
case REWIND_FORCE: |
case REWIND_FORCE: |
mandoc_vmsg(MANDOCERR_SCOPEBROKEN, mdoc->parse, |
mandoc_vmsg(MANDOCERR_BLK_BROKEN, mdoc->parse, |
line, ppos, "%s breaks %s", |
line, ppos, "%s breaks %s", |
mdoc_macronames[tok], |
mdoc_macronames[tok], |
mdoc_macronames[n->tok]); |
mdoc_macronames[n->tok]); |
Line 574 rew_sub(enum mdoc_type t, struct mdoc *mdoc, |
|
Line 575 rew_sub(enum mdoc_type t, struct mdoc *mdoc, |
|
return(1); |
return(1); |
/* FALLTHROUGH */ |
/* FALLTHROUGH */ |
case REWIND_ERROR: |
case REWIND_ERROR: |
mdoc_pmsg(mdoc, line, ppos, MANDOCERR_NOSCOPE); |
mandoc_msg(MANDOCERR_BLK_NOTOPEN, |
|
mdoc->parse, line, ppos, |
|
mdoc_macronames[tok]); |
return(1); |
return(1); |
} |
} |
break; |
break; |
Line 769 blk_exp_close(MACRO_PROT_ARGS) |
|
Line 772 blk_exp_close(MACRO_PROT_ARGS) |
|
later = n; |
later = n; |
} |
} |
|
|
if ( ! (MDOC_CALLABLE & mdoc_macros[tok].flags)) { |
if ( ! (MDOC_PARSED & mdoc_macros[tok].flags)) { |
/* FIXME: do this in validate */ |
if ('\0' != buf[*pos]) |
if (buf[*pos]) |
mandoc_vmsg(MANDOCERR_ARG_SKIP, |
mdoc_pmsg(mdoc, line, ppos, MANDOCERR_ARGSLOST); |
mdoc->parse, line, ppos, |
|
"%s %s", mdoc_macronames[tok], |
|
buf + *pos); |
if ( ! rew_sub(MDOC_BODY, mdoc, tok, line, ppos)) |
if ( ! rew_sub(MDOC_BODY, mdoc, tok, line, ppos)) |
return(0); |
return(0); |
return(rew_sub(MDOC_BLOCK, mdoc, tok, line, ppos)); |
return(rew_sub(MDOC_BLOCK, mdoc, tok, line, ppos)); |
Line 919 in_line(MACRO_PROT_ARGS) |
|
Line 923 in_line(MACRO_PROT_ARGS) |
|
return(0); |
return(0); |
} else if ( ! nc && 0 == cnt) { |
} else if ( ! nc && 0 == cnt) { |
mdoc_argv_free(arg); |
mdoc_argv_free(arg); |
mdoc_pmsg(mdoc, line, ppos, |
mandoc_msg(MANDOCERR_MACRO_EMPTY, |
MANDOCERR_MACROEMPTY); |
mdoc->parse, line, ppos, |
|
mdoc_macronames[tok]); |
} |
} |
|
|
if ( ! mdoc_macro(mdoc, ntok, line, la, pos, buf)) |
if ( ! mdoc_macro(mdoc, ntok, line, la, pos, buf)) |
Line 1005 in_line(MACRO_PROT_ARGS) |
|
Line 1010 in_line(MACRO_PROT_ARGS) |
|
return(0); |
return(0); |
} else if ( ! nc && 0 == cnt) { |
} else if ( ! nc && 0 == cnt) { |
mdoc_argv_free(arg); |
mdoc_argv_free(arg); |
mdoc_pmsg(mdoc, line, ppos, MANDOCERR_MACROEMPTY); |
mandoc_msg(MANDOCERR_MACRO_EMPTY, mdoc->parse, |
|
line, ppos, mdoc_macronames[tok]); |
} |
} |
|
|
if ( ! nl) |
if ( ! nl) |
Line 1354 blk_part_imp(MACRO_PROT_ARGS) |
|
Line 1360 blk_part_imp(MACRO_PROT_ARGS) |
|
return(1); |
return(1); |
} |
} |
} |
} |
|
assert(n == body); |
|
|
/* |
if ( ! rew_sub(MDOC_BODY, mdoc, tok, line, ppos)) |
* If we can't rewind to our body, then our scope has already |
|
* been closed by another macro (like `Oc' closing `Op'). This |
|
* is ugly behaviour nodding its head to OpenBSD's overwhelming |
|
* crufty use of `Op' breakage. |
|
*/ |
|
if (n != body) |
|
mandoc_vmsg(MANDOCERR_SCOPENEST, mdoc->parse, line, |
|
ppos, "%s broken", mdoc_macronames[tok]); |
|
|
|
if (n && ! rew_sub(MDOC_BODY, mdoc, tok, line, ppos)) |
|
return(0); |
return(0); |
|
|
/* Standard appending of delimiters. */ |
/* Standard appending of delimiters. */ |
Line 1375 blk_part_imp(MACRO_PROT_ARGS) |
|
Line 1372 blk_part_imp(MACRO_PROT_ARGS) |
|
|
|
/* Rewind scope, if applicable. */ |
/* Rewind scope, if applicable. */ |
|
|
if (n && ! rew_sub(MDOC_BLOCK, mdoc, tok, line, ppos)) |
if ( ! rew_sub(MDOC_BLOCK, mdoc, tok, line, ppos)) |
return(0); |
return(0); |
|
|
/* Move trailing .Ns out of scope. */ |
/* Move trailing .Ns out of scope. */ |
Line 1769 phrase_ta(MACRO_PROT_ARGS) |
|
Line 1766 phrase_ta(MACRO_PROT_ARGS) |
|
while (NULL != n && MDOC_Bl != n->tok) |
while (NULL != n && MDOC_Bl != n->tok) |
n = n->parent; |
n = n->parent; |
if (NULL == n || LIST_column != n->norm->Bl.type) { |
if (NULL == n || LIST_column != n->norm->Bl.type) { |
mdoc_pmsg(mdoc, line, ppos, MANDOCERR_STRAYTA); |
mandoc_msg(MANDOCERR_TA_STRAY, mdoc->parse, |
|
line, ppos, NULL); |
return(1); |
return(1); |
} |
} |
|
|