aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_term.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_term.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_term.c')
-rw-r--r--mdoc_term.c31
1 files changed, 23 insertions, 8 deletions
diff --git a/mdoc_term.c b/mdoc_term.c
index b9e4b080..3bf82b5f 100644
--- a/mdoc_term.c
+++ b/mdoc_term.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_term.c,v 1.205 2010/12/25 23:27:50 kristaps Exp $ */
+/* $Id: mdoc_term.c,v 1.206 2011/01/01 12:18:37 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org>
@@ -312,11 +312,19 @@ print_mdoc_node(DECL_ARGS)
memset(&npair, 0, sizeof(struct termpair));
npair.ppair = pair;
-
- if (MDOC_TEXT == n->type)
- term_word(p, n->string);
- else if (termacts[n->tok].pre && ENDBODY_NOT == n->end)
- chld = (*termacts[n->tok].pre)(p, &npair, m, n);
+
+ switch (n->type) {
+ case (MDOC_TEXT):
+ term_word(p, n->string);
+ break;
+ case (MDOC_TBL):
+ break;
+ default:
+ if (termacts[n->tok].pre && ENDBODY_NOT == n->end)
+ chld = (*termacts[n->tok].pre)
+ (p, &npair, m, n);
+ break;
+ }
/*
* Keeps only work until the end of a line. If a keep was
@@ -353,8 +361,14 @@ print_mdoc_node(DECL_ARGS)
term_fontpopq(p, font);
- if (MDOC_TEXT != n->type && termacts[n->tok].post &&
- ! (MDOC_ENDED & n->flags)) {
+ switch (n->type) {
+ case (MDOC_TEXT):
+ break;
+ case (MDOC_TBL):
+ break;
+ default:
+ if ( ! termacts[n->tok].post || MDOC_ENDED & n->flags)
+ break;
(void)(*termacts[n->tok].post)(p, &npair, m, n);
/*
@@ -372,6 +386,7 @@ print_mdoc_node(DECL_ARGS)
*/
if (ENDBODY_NOSPACE == n->end)
p->flags |= TERMP_NOSPACE;
+ break;
}
if (MDOC_EOS & n->flags)