=================================================================== RCS file: /cvs/mandoc/read.c,v retrieving revision 1.15 retrieving revision 1.22 diff -u -p -r1.15 -r1.22 --- mandoc/read.c 2011/05/26 20:36:21 1.15 +++ mandoc/read.c 2011/07/22 14:55:07 1.22 @@ -1,4 +1,4 @@ -/* $Id: read.c,v 1.15 2011/05/26 20:36:21 kristaps Exp $ */ +/* $Id: read.c,v 1.22 2011/07/22 14:55:07 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 */ @@ -146,9 +145,20 @@ static const char * const mandocerrs[MANDOCERR_MAX] = "bad comment style", "bad escape sequence", "unterminated quoted string", + + /* related to equations */ + "unexpected literal in equation", "generic error", + /* related to equations */ + "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", @@ -237,13 +247,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; @@ -253,14 +263,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; } @@ -681,15 +691,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);