summaryrefslogtreecommitdiffstats
path: root/read.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2015-04-19 14:25:41 +0000
committerIngo Schwarze <schwarze@openbsd.org>2015-04-19 14:25:41 +0000
commitb41835362693d09c3eff29cb37f2217b9dca8cc3 (patch)
tree304f88d63b2cc2aa84f33f3805156cd93c4f7cec /read.c
parenteed5e7f1fb85805f1b324c5a4501ed30467ae2a0 (diff)
downloadmandoc-b41835362693d09c3eff29cb37f2217b9dca8cc3.tar.gz
Unify some node handling functions that use TOKEN_NONE.
* mdoc_word_alloc(), man_word_alloc() -> roff_word_alloc() * mdoc_word_append(), man_word_append() -> roff_word_append() * mdoc_addspan(), man_addspan() -> roff_addtbl() * mdoc_addeqn(), man_addeqn() -> roff_addeqn() Minus 50 lines of code, no functional change.
Diffstat (limited to 'read.c')
-rw-r--r--read.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/read.c b/read.c
index 002f34d8..40fb15a4 100644
--- a/read.c
+++ b/read.c
@@ -43,6 +43,7 @@
#include "mdoc.h"
#include "man.h"
#include "libmandoc.h"
+#include "roff_int.h"
#define REPARSE_LIMIT 1000
@@ -583,18 +584,12 @@ rerun:
* Do the same for ROFF_EQN.
*/
- if (rr == ROFF_TBL) {
+ if (rr == ROFF_TBL)
while ((span = roff_span(curp->roff)) != NULL)
- if (curp->man->macroset == MACROSET_MDOC)
- mdoc_addspan(curp->man, span);
- else
- man_addspan(curp->man, span);
- } else if (rr == ROFF_EQN) {
- if (curp->man->macroset == MACROSET_MDOC)
- mdoc_addeqn(curp->man, roff_eqn(curp->roff));
- else
- man_addeqn(curp->man, roff_eqn(curp->roff));
- } else if ((curp->man->macroset == MACROSET_MDOC ?
+ roff_addtbl(curp->man, span);
+ else if (rr == ROFF_EQN)
+ roff_addeqn(curp->man, roff_eqn(curp->roff));
+ else if ((curp->man->macroset == MACROSET_MDOC ?
mdoc_parseln(curp->man, curp->line, ln.buf, of) :
man_parseln(curp->man, curp->line, ln.buf, of)) == 2)
break;