aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_validate.c
diff options
context:
space:
mode:
Diffstat (limited to 'mdoc_validate.c')
-rw-r--r--mdoc_validate.c46
1 files changed, 6 insertions, 40 deletions
diff --git a/mdoc_validate.c b/mdoc_validate.c
index c87ab23f..6176c975 100644
--- a/mdoc_validate.c
+++ b/mdoc_validate.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_validate.c,v 1.277 2015/02/10 08:05:30 schwarze Exp $ */
+/* $Id: mdoc_validate.c,v 1.278 2015/02/12 12:24:33 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -325,7 +325,7 @@ mdoc_valid_post(struct mdoc *mdoc)
n = mdoc->last;
if (n->flags & MDOC_VALID)
return;
- n->flags |= MDOC_VALID;
+ n->flags |= MDOC_VALID | MDOC_ENDED;
switch (n->type) {
case MDOC_TEXT:
@@ -416,24 +416,13 @@ pre_display(PRE_ARGS)
static void
pre_bl(PRE_ARGS)
{
- struct mdoc_node *np;
struct mdoc_argv *argv, *wa;
int i;
enum mdocargt mdoclt;
enum mdoc_list lt;
- if (MDOC_BLOCK != n->type) {
- if (ENDBODY_NOT != n->end) {
- assert(n->pending);
- np = n->pending->parent;
- } else
- np = n->parent;
-
- assert(np);
- assert(MDOC_BLOCK == np->type);
- assert(MDOC_Bl == np->tok);
+ if (n->type != MDOC_BLOCK)
return;
- }
/*
* First figure out which kind of list to use: bind ourselves to
@@ -609,25 +598,14 @@ pre_bl(PRE_ARGS)
static void
pre_bd(PRE_ARGS)
{
- struct mdoc_node *np;
struct mdoc_argv *argv;
int i;
enum mdoc_disp dt;
pre_literal(mdoc, n);
- if (MDOC_BLOCK != n->type) {
- if (ENDBODY_NOT != n->end) {
- assert(n->pending);
- np = n->pending->parent;
- } else
- np = n->parent;
-
- assert(np);
- assert(MDOC_BLOCK == np->type);
- assert(MDOC_Bd == np->tok);
+ if (n->type != MDOC_BLOCK)
return;
- }
for (i = 0; n->args && i < (int)n->args->argc; i++) {
argv = n->args->argv + i;
@@ -797,22 +775,10 @@ post_bf(POST_ARGS)
* element, which contains the goods.
*/
- if (MDOC_HEAD != mdoc->last->type) {
- if (ENDBODY_NOT != mdoc->last->end) {
- assert(mdoc->last->pending);
- np = mdoc->last->pending->parent->head;
- } else if (MDOC_BLOCK != mdoc->last->type) {
- np = mdoc->last->parent->head;
- } else
- np = mdoc->last->head;
-
- assert(np);
- assert(MDOC_HEAD == np->type);
- assert(MDOC_Bf == np->tok);
+ np = mdoc->last;
+ if (MDOC_HEAD != np->type)
return;
- }
- np = mdoc->last;
assert(MDOC_BLOCK == np->parent->type);
assert(MDOC_Bf == np->parent->tok);