diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-01-01 12:18:37 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-01-01 12:18:37 +0000 |
commit | e544ee7c50ee6f579859cf0983518ab73f11cac1 (patch) | |
tree | 27b769c61f531ca49b70efb6715220e2249a8c35 /mdoc_validate.c | |
parent | 1d3c95dfc94730fe58488b00744522e212559f61 (diff) | |
download | mandoc-e544ee7c50ee6f579859cf0983518ab73f11cac1.tar.gz |
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.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/mdoc_validate.c b/mdoc_validate.c index 19215261..9622409a 100644 --- a/mdoc_validate.c +++ b/mdoc_validate.c @@ -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); |