=================================================================== RCS file: /cvs/mandoc/read.c,v retrieving revision 1.16 retrieving revision 1.21 diff -u -p -r1.16 -r1.21 --- mandoc/read.c 2011/07/17 12:52:54 1.16 +++ mandoc/read.c 2011/07/21 23:30:39 1.21 @@ -1,4 +1,4 @@ -/* $Id: read.c,v 1.16 2011/07/17 12:52:54 kristaps Exp $ */ +/* $Id: read.c,v 1.21 2011/07/21 23:30:39 kristaps Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010, 2011 Ingo Schwarze @@ -59,7 +59,6 @@ struct mparse { struct man *man; /* man parser */ struct mdoc *mdoc; /* mdoc parser */ struct roff *roff; /* roff parser (!NULL) */ - struct regset regs; /* roff registers */ int reparse_count; /* finite interp. stack */ mandocmsg mmsg; /* warning/error message handler */ void *arg; /* argument to mmsg */ @@ -152,6 +151,15 @@ static const char * const mandocerrs[MANDOCERR_MAX] = "generic error", + /* related to equations */ + "bad equation macro syntax", + "too many nested equation defines", + "unexpected equation scope closure", + "equation scope open on exit", + "overlapping equation scopes", + "unexpected end of equation", + "equation syntax error", + /* related to tables */ "bad table syntax", "bad table option", @@ -240,13 +248,13 @@ pset(const char *buf, int pos, struct mparse *curp) switch (curp->inttype) { case (MPARSE_MDOC): if (NULL == curp->pmdoc) - curp->pmdoc = mdoc_alloc(&curp->regs, curp); + curp->pmdoc = mdoc_alloc(curp->roff, curp); assert(curp->pmdoc); curp->mdoc = curp->pmdoc; return; case (MPARSE_MAN): if (NULL == curp->pman) - curp->pman = man_alloc(&curp->regs, curp); + curp->pman = man_alloc(curp->roff, curp); assert(curp->pman); curp->man = curp->pman; return; @@ -256,14 +264,14 @@ pset(const char *buf, int pos, struct mparse *curp) if (pos >= 3 && 0 == memcmp(buf, ".Dd", 3)) { if (NULL == curp->pmdoc) - curp->pmdoc = mdoc_alloc(&curp->regs, curp); + curp->pmdoc = mdoc_alloc(curp->roff, curp); assert(curp->pmdoc); curp->mdoc = curp->pmdoc; return; } if (NULL == curp->pman) - curp->pman = man_alloc(&curp->regs, curp); + curp->pman = man_alloc(curp->roff, curp); assert(curp->pman); curp->man = curp->pman; } @@ -684,15 +692,13 @@ mparse_alloc(enum mparset inttype, enum mandoclevel wl curp->arg = arg; curp->inttype = inttype; - curp->roff = roff_alloc(&curp->regs, curp); + curp->roff = roff_alloc(curp); return(curp); } void mparse_reset(struct mparse *curp) { - - memset(&curp->regs, 0, sizeof(struct regset)); roff_reset(curp->roff);