version 1.189, 2017/07/06 22:59:48 |
version 1.191, 2017/07/08 17:52:50 |
|
|
#include "mdoc.h" |
#include "mdoc.h" |
#include "man.h" |
#include "man.h" |
#include "libmandoc.h" |
#include "libmandoc.h" |
#include "roff_int.h" |
|
|
|
#define REPARSE_LIMIT 1000 |
#define REPARSE_LIMIT 1000 |
|
|
Line 343 choose_parser(struct mparse *curp) |
|
Line 342 choose_parser(struct mparse *curp) |
|
static int |
static int |
mparse_buf_r(struct mparse *curp, struct buf blk, size_t i, int start) |
mparse_buf_r(struct mparse *curp, struct buf blk, size_t i, int start) |
{ |
{ |
const struct tbl_span *span; |
|
struct buf ln; |
struct buf ln; |
const char *save_file; |
const char *save_file; |
char *cp; |
char *cp; |
|
|
if (curp->man->macroset == MACROSET_NONE) |
if (curp->man->macroset == MACROSET_NONE) |
choose_parser(curp); |
choose_parser(curp); |
|
|
/* |
if ((curp->man->macroset == MACROSET_MDOC ? |
* 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. |
|
* Do the same for ROFF_EQN. |
|
*/ |
|
|
|
if (rr == ROFF_TBL) |
|
while ((span = roff_span(curp->roff)) != NULL) |
|
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) : |
mdoc_parseln(curp->man, curp->line, ln.buf, of) : |
man_parseln(curp->man, curp->line, ln.buf, of)) == 2) |
man_parseln(curp->man, curp->line, ln.buf, of)) == 2) |
break; |
break; |