aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_validate.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-01-01 12:18:37 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-01-01 12:18:37 +0000
commite6cfc592798a7e03016169696640f0dd9f11d5e6 (patch)
treee9e5e188e11b13d858969b59b69d45953be7504d /mdoc_validate.c
parent0b95ed5dc93d34749b819aa398725ff81f524b89 (diff)
downloadmandoc-e6cfc592798a7e03016169696640f0dd9f11d5e6.tar.gz
mandoc-e6cfc592798a7e03016169696640f0dd9f11d5e6.tar.zst
mandoc-e6cfc592798a7e03016169696640f0dd9f11d5e6.zip
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).
Diffstat (limited to 'mdoc_validate.c')
-rw-r--r--mdoc_validate.c21
1 files changed, 17 insertions, 4 deletions
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 <kristaps@bsd.lv>
*
@@ -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);