From 5b9fac5e713255fd71fe6d4dfb25ad29e2db9413 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Sat, 8 Jul 2017 17:52:49 +0000 Subject: Simplify by creating struct roff_node syntax tree nodes for tbl(7) right from roff_parseln() rather than delegating to read.c, similar to what i just did for eqn(7). The interface function roff_span() becomes obsolete and is deleted, the former interface function roff_addtbl() becomes static, the interface functions tbl_read() and tbl_cdata() become void, and minus twelve linus of code. No functional change. --- read.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'read.c') diff --git a/read.c b/read.c index 2b3abde1..bed97580 100644 --- a/read.c +++ b/read.c @@ -1,4 +1,4 @@ -/* $Id: read.c,v 1.190 2017/07/08 14:51:04 schwarze Exp $ */ +/* $Id: read.c,v 1.191 2017/07/08 17:52:50 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010-2017 Ingo Schwarze @@ -42,7 +42,6 @@ #include "mdoc.h" #include "man.h" #include "libmandoc.h" -#include "roff_int.h" #define REPARSE_LIMIT 1000 @@ -343,7 +342,6 @@ choose_parser(struct mparse *curp) static int mparse_buf_r(struct mparse *curp, struct buf blk, size_t i, int start) { - const struct tbl_span *span; struct buf ln; const char *save_file; char *cp; @@ -534,18 +532,7 @@ rerun: if (curp->man->macroset == MACROSET_NONE) choose_parser(curp); - /* - * Lastly, push down into the parsers themselves. - * 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 (rr == ROFF_TBL) - while ((span = roff_span(curp->roff)) != NULL) - roff_addtbl(curp->man, span); - else if ((curp->man->macroset == MACROSET_MDOC ? + 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; -- cgit v1.2.3-56-ge451