From e6cfc592798a7e03016169696640f0dd9f11d5e6 Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Sat, 1 Jan 2011 12:18:37 +0000 Subject: Add table processing structures to -mdoc. This consists of an external-facing function mdoc_addspan(), then various bits to prohibit printing and scanning (this requires some if's to be converted into switch's). --- mdoc_validate.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'mdoc_validate.c') diff --git a/mdoc_validate.c b/mdoc_validate.c index aa167454..f5ac5be7 100644 --- a/mdoc_validate.c +++ b/mdoc_validate.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_validate.c,v 1.149 2010/12/25 23:25:53 kristaps Exp $ */ +/* $Id: mdoc_validate.c,v 1.150 2011/01/01 12:18:37 kristaps Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons * @@ -329,12 +329,19 @@ mdoc_valid_pre(struct mdoc *mdoc, struct mdoc_node *n) int line, pos; char *tp; - if (MDOC_TEXT == n->type) { + switch (n->type) { + case (MDOC_TEXT): tp = n->string; line = n->line; pos = n->pos; check_text(mdoc, line, pos, tp); + /* FALLTHROUGH */ + case (MDOC_TBL): + /* FALLTHROUGH */ + case (MDOC_ROOT): return(1); + default: + break; } check_args(mdoc, n); @@ -357,10 +364,16 @@ mdoc_valid_post(struct mdoc *mdoc) return(1); mdoc->last->flags |= MDOC_VALID; - if (MDOC_TEXT == mdoc->last->type) + switch (mdoc->last->type) { + case (MDOC_TEXT): + /* FALLTHROUGH */ + case (MDOC_TBL): return(1); - if (MDOC_ROOT == mdoc->last->type) + case (MDOC_ROOT): return(post_root(mdoc)); + default: + break; + } if (NULL == mdoc_valids[mdoc->last->tok].post) return(1); -- cgit v1.2.3