From 494bb76472a464f4c16c06824742893732fe349e Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Wed, 2 Jul 2014 11:43:20 +0000 Subject: Clean up warnings related to macros and nesting. * Hierarchical naming of enum mandocerr items. * Improve the wording to make it comprehensible. * Mention the offending macro. * Garbage collect one chunk of ancient, long unreachable code. --- mdoc_macro.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) (limited to 'mdoc_macro.c') diff --git a/mdoc_macro.c b/mdoc_macro.c index c662990d..da836a74 100644 --- a/mdoc_macro.c +++ b/mdoc_macro.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_macro.c,v 1.133 2014/07/02 08:21:39 schwarze Exp $ */ +/* $Id: mdoc_macro.c,v 1.134 2014/07/02 11:43:20 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010, 2012, 2013 Ingo Schwarze @@ -528,7 +528,7 @@ make_pending(struct mdoc_node *broken, enum mdoct tok, taker->pending = broken->pending; } broken->pending = breaker; - mandoc_vmsg(MANDOCERR_SCOPENEST, mdoc->parse, line, ppos, + mandoc_vmsg(MANDOCERR_BLOCK_NEST, mdoc->parse, line, ppos, "%s breaks %s", mdoc_macronames[tok], mdoc_macronames[broken->tok]); return(1); @@ -1354,18 +1354,9 @@ blk_part_imp(MACRO_PROT_ARGS) return(1); } } + assert(n == body); - /* - * 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)) + if ( ! rew_sub(MDOC_BODY, mdoc, tok, line, ppos)) return(0); /* Standard appending of delimiters. */ @@ -1375,7 +1366,7 @@ blk_part_imp(MACRO_PROT_ARGS) /* 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); /* Move trailing .Ns out of scope. */ -- cgit v1.2.3