[BACK]Return to main.c CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / mandoc

Diff for /mandoc/main.c between version 1.121 and 1.123

version 1.121, 2010/12/06 16:55:35 version 1.123, 2010/12/15 23:39:40
Line 41 
Line 41 
 #define MAP_FILE        0  #define MAP_FILE        0
 #endif  #endif
   
   #define REPARSE_LIMIT   1000
 #define UNCONST(a)      ((void *)(uintptr_t)(const void *)(a))  #define UNCONST(a)      ((void *)(uintptr_t)(const void *)(a))
   
 /* FIXME: Intel's compiler?  LLVM?  pcc?  */  /* FIXME: Intel's compiler?  LLVM?  pcc?  */
Line 89  struct curparse {
Line 90  struct curparse {
         struct mdoc      *mdoc;         /* mdoc parser */          struct mdoc      *mdoc;         /* mdoc parser */
         struct roff      *roff;         /* roff parser (!NULL) */          struct roff      *roff;         /* roff parser (!NULL) */
         struct regset     regs;         /* roff registers */          struct regset     regs;         /* roff registers */
           int               reparse_count; /* finite interpolation stack */
         enum outt         outtype;      /* which output to use */          enum outt         outtype;      /* which output to use */
         out_mdoc          outmdoc;      /* mdoc output ptr */          out_mdoc          outmdoc;      /* mdoc output ptr */
         out_man           outman;       /* man output ptr */          out_man           outman;       /* man output ptr */
Line 143  static const char * const mandocerrs[MANDOCERR_MAX] = 
Line 145  static const char * const mandocerrs[MANDOCERR_MAX] = 
   
         /* related to macros and nesting */          /* related to macros and nesting */
         "skipping obsolete macro",          "skipping obsolete macro",
         "skipping paragraph macro",  
         "blocks badly nested",          "blocks badly nested",
         "child violates parent syntax",          "child violates parent syntax",
         "nested displays are not portable",          "nested displays are not portable",
Line 177  static const char * const mandocerrs[MANDOCERR_MAX] = 
Line 178  static const char * const mandocerrs[MANDOCERR_MAX] = 
   
         "generic error",          "generic error",
   
           "input stack limit exceeded, infinite loop?",
         "skipping bad character",          "skipping bad character",
         "skipping text before the first section header",          "skipping text before the first section header",
         "skipping unknown macro",          "skipping unknown macro",
           "skipping paragraph macro",
         "NOT IMPLEMENTED: skipping request",          "NOT IMPLEMENTED: skipping request",
         "line scope broken",          "line scope broken",
         "argument count wrong",          "argument count wrong",
Line 665  parsebuf(struct curparse *curp, struct buf blk, int st
Line 668  parsebuf(struct curparse *curp, struct buf blk, int st
                 if (0 == pos && '\0' == blk.buf[i])                  if (0 == pos && '\0' == blk.buf[i])
                         break;                          break;
   
                 if (start)                  if (start) {
                         curp->line = lnn;                          curp->line = lnn;
                           curp->reparse_count = 0;
                   }
   
                 while (i < (int)blk.sz && (start || '\0' != blk.buf[i])) {                  while (i < (int)blk.sz && (start || '\0' != blk.buf[i])) {
                         if ('\n' == blk.buf[i]) {                          if ('\n' == blk.buf[i]) {
Line 765  rerun:
Line 770  rerun:
   
                 switch (rr) {                  switch (rr) {
                 case (ROFF_REPARSE):                  case (ROFF_REPARSE):
                         parsebuf(curp, ln, 0);                          if (REPARSE_LIMIT >= ++curp->reparse_count)
                                   parsebuf(curp, ln, 0);
                           else
                                   mmsg(MANDOCERR_ROFFLOOP, curp,
                                       curp->line, pos, NULL);
                         pos = 0;                          pos = 0;
                         continue;                          continue;
                 case (ROFF_APPEND):                  case (ROFF_APPEND):

Legend:
Removed from v.1.121  
changed lines
  Added in v.1.123

CVSweb