summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-01-01 13:37:40 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-01-01 13:37:40 +0000
commiteaae29b74b1f45f13fc7edacce3631f05b0ba412 (patch)
treea2021d67c44d7d4dd3c20ca622eb5fd8e98a661e
parent131de1ee113c08ea304f934c38488baa917375f6 (diff)
downloadmandoc-eaae29b74b1f45f13fc7edacce3631f05b0ba412.tar.gz
Switch on tbl rows being added to the parse stream. Here we go!
-rw-r--r--main.c15
-rw-r--r--tbl.c8
-rw-r--r--tbl_data.c2
3 files changed, 18 insertions, 7 deletions
diff --git a/main.c b/main.c
index 18b0ab60..d20c36fb 100644
--- a/main.c
+++ b/main.c
@@ -798,7 +798,7 @@ rerun:
continue;
} else
break;
- case (ROFF_CONT):
+ default:
break;
}
@@ -816,9 +816,20 @@ rerun:
* Lastly, push down into the parsers themselves. One
* of these will have already been set in the pset()
* routine.
+ * If libroff returns ROFF_TBL, then add it to the
+ * currently open parse. Since we only get here if
+ * there does exist data (see tbl_data.c), we're
+ * guaranteed that something's been allocated.
*/
- if (curp->man || curp->mdoc) {
+ if (ROFF_TBL == rr) {
+ assert(curp->man || curp->mdoc);
+ if (curp->man)
+ man_addspan(curp->man, roff_span(curp->roff));
+ else
+ mdoc_addspan(curp->mdoc, roff_span(curp->roff));
+
+ } else if (curp->man || curp->mdoc) {
rc = curp->man ?
man_parseln(curp->man,
curp->line, ln.buf, of) :
diff --git a/tbl.c b/tbl.c
index f91aec29..a4d3fa92 100644
--- a/tbl.c
+++ b/tbl.c
@@ -56,11 +56,11 @@ tbl_read(struct tbl *tbl, int ln, const char *p, int offs)
break;
}
- /*
- * FIXME: allow the original string to slip through for the time
- * being.
+ /*
+ * This only returns zero if the line is empty, so we ignore it
+ * and continue on.
*/
- return(tbl_data(tbl, ln, p) ? ROFF_CONT : ROFF_ERR);
+ return(tbl_data(tbl, ln, p) ? ROFF_TBL : ROFF_IGN);
}
struct tbl *
diff --git a/tbl_data.c b/tbl_data.c
index e0de6235..26749e9e 100644
--- a/tbl_data.c
+++ b/tbl_data.c
@@ -91,7 +91,7 @@ tbl_data(struct tbl *tbl, int ln, const char *p)
if ('\0' == p[pos]) {
TBL_MSG(tbl, MANDOCERR_TBL, ln, pos);
- return(1);
+ return(0);
}
/*