=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/mdoc_macro.c,v retrieving revision 1.50 retrieving revision 1.51 diff -c -r1.50 -r1.51 *** src/usr.bin/mandoc/mdoc_macro.c 2010/06/30 03:57:49 1.50 --- src/usr.bin/mandoc/mdoc_macro.c 2010/07/01 15:36:59 1.51 *************** *** 1,4 **** ! /* $Id: mdoc_macro.c,v 1.50 2010/06/30 03:57:49 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * --- 1,4 ---- ! /* $Id: mdoc_macro.c,v 1.51 2010/07/01 15:36:59 schwarze Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * *************** *** 93,99 **** { in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* In */ { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Li */ { blk_full, 0 }, /* Nd */ ! { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Nm */ { blk_part_imp, MDOC_CALLABLE | MDOC_PARSED }, /* Op */ { obsolete, 0 }, /* Ot */ { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Pa */ --- 93,99 ---- { in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* In */ { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Li */ { blk_full, 0 }, /* Nd */ ! { ctx_synopsis, MDOC_CALLABLE | MDOC_PARSED }, /* Nm */ { blk_part_imp, MDOC_CALLABLE | MDOC_PARSED }, /* Op */ { obsolete, 0 }, /* Ot */ { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Pa */ *************** *** 388,393 **** --- 388,395 ---- if (MDOC_Op == p->tok) return(REWIND_MORE); break; + case (MDOC_Nm): + return(REWIND_NONE); case (MDOC_Nd): /* FALLTHROUGH */ case (MDOC_Ss): *************** *** 405,413 **** /* * Default block rewinding rules. ! * In particular, always skip block end markers. */ ! if (p->end || (MDOC_BLOCK == p->type && ! (MDOC_EXPLICIT & mdoc_macros[tok].flags))) return(REWIND_MORE); --- 407,417 ---- /* * Default block rewinding rules. ! * In particular, always skip block end markers, ! * and let all blocks rewind Nm children. */ ! if (p->end || MDOC_Nm == p->tok || ! (MDOC_BLOCK == p->type && ! (MDOC_EXPLICIT & mdoc_macros[tok].flags))) return(REWIND_MORE); *************** *** 503,510 **** taker->pending = broken->pending; } broken->pending = breaker; ! mdoc_vmsg(m, MANDOCERR_SCOPE, line, ppos, "%s breaks %s", ! mdoc_macronames[tok], mdoc_macronames[broken->tok]); return(1); } --- 507,515 ---- taker->pending = broken->pending; } broken->pending = breaker; ! mdoc_vmsg(m, MANDOCERR_SCOPENEST, line, ppos, ! "%s breaks %s", mdoc_macronames[tok], ! mdoc_macronames[broken->tok]); return(1); } *************** *** 538,544 **** return(make_pending(n, tok, m, line, ppos)); case (REWIND_ERROR): /* XXX Make this non-fatal. */ ! mdoc_pmsg(m, line, ppos, MANDOCERR_SYNTNOSCOPE); return 0; } break; --- 543,551 ---- return(make_pending(n, tok, m, line, ppos)); case (REWIND_ERROR): /* XXX Make this non-fatal. */ ! mdoc_vmsg(m, MANDOCERR_SCOPEFATAL, line, ppos, ! "%s cannot break %s", mdoc_macronames[tok], ! mdoc_macronames[n->tok]); return 0; } break; *************** *** 648,654 **** continue; } ! if (MDOC_BLOCK != n->type) continue; if (atok == n->tok) { assert(body); --- 655,661 ---- continue; } ! if (MDOC_BLOCK != n->type || MDOC_Nm == n->tok) continue; if (atok == n->tok) { assert(body); *************** *** 1284,1291 **** * is ugly behaviour nodding its head to OpenBSD's overwhelming * crufty use of `Op' breakage. */ ! if (n != body && ! mdoc_vmsg(m, MANDOCERR_SCOPE, line, ppos, ! "%s broken", mdoc_macronames[tok])) return(0); if (n && ! rew_sub(MDOC_BODY, m, tok, line, ppos)) --- 1291,1298 ---- * is ugly behaviour nodding its head to OpenBSD's overwhelming * crufty use of `Op' breakage. */ ! if (n != body && ! mdoc_vmsg(m, MANDOCERR_SCOPENEST, ! line, ppos, "%s broken", mdoc_macronames[tok])) return(0); if (n && ! rew_sub(MDOC_BODY, m, tok, line, ppos)) *************** *** 1638,1644 **** * up formatting the block scope, then child nodes will inherit * the formatting. Be careful. */ ! return(blk_part_imp(m, tok, line, ppos, pos, buf)); } --- 1645,1653 ---- * up formatting the block scope, then child nodes will inherit * 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)); }