=================================================================== RCS file: /cvs/mandoc/read.c,v retrieving revision 1.137 retrieving revision 1.139 diff -u -p -r1.137 -r1.139 --- mandoc/read.c 2015/04/18 17:28:36 1.137 +++ mandoc/read.c 2015/04/19 14:25:41 1.139 @@ -1,4 +1,4 @@ -/* $Id: read.c,v 1.137 2015/04/18 17:28:36 schwarze Exp $ */ +/* $Id: read.c,v 1.139 2015/04/19 14:25:41 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010-2015 Ingo Schwarze @@ -43,6 +43,7 @@ #include "mdoc.h" #include "man.h" #include "libmandoc.h" +#include "roff_int.h" #define REPARSE_LIMIT 1000 @@ -293,17 +294,17 @@ choose_parser(struct mparse *curp) curp->man = roff_man_alloc(curp->roff, curp, curp->defos, curp->options & MPARSE_QUICK ? 1 : 0); curp->man->macroset = MACROSET_MAN; - curp->man->first->tok = MDOC_MAX; + curp->man->first->tok = TOKEN_NONE; } if (format == MPARSE_MDOC) { mdoc_hash_init(); curp->man->macroset = MACROSET_MDOC; - curp->man->first->tok = MDOC_MAX; + curp->man->first->tok = TOKEN_NONE; } else { man_hash_init(); curp->man->macroset = MACROSET_MAN; - curp->man->first->tok = MAN_MAX; + curp->man->first->tok = TOKEN_NONE; } } @@ -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; @@ -893,12 +888,11 @@ mparse_alloc(int options, enum mandoclevel wlevel, man if (curp->options & MPARSE_MDOC) { mdoc_hash_init(); curp->man->macroset = MACROSET_MDOC; - curp->man->first->tok = MDOC_MAX; } else if (curp->options & MPARSE_MAN) { man_hash_init(); curp->man->macroset = MACROSET_MAN; - curp->man->first->tok = MAN_MAX; } + curp->man->first->tok = TOKEN_NONE; return(curp); }