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

Diff for /mandoc/read.c between version 1.57 and 1.76

version 1.57, 2014/07/02 13:10:45 version 1.76, 2014/07/31 09:22:21
Line 65  struct mparse {
Line 65  struct mparse {
         mandocmsg         mmsg; /* warning/error message handler */          mandocmsg         mmsg; /* warning/error message handler */
         const char       *file;          const char       *file;
         struct buf       *secondary;          struct buf       *secondary;
         char             *defos; /* default operating system */          const char       *defos; /* default operating system */
 };  };
   
 static  void      resize_buf(struct buf *, size_t);  static  void      resize_buf(struct buf *, size_t);
Line 128  static const char * const mandocerrs[MANDOCERR_MAX] = 
Line 128  static const char * const mandocerrs[MANDOCERR_MAX] = 
         "line scope broken",          "line scope broken",
   
         /* related to missing macro arguments */          /* related to missing macro arguments */
           "skipping empty request",
           "conditional request controls empty scope",
         "skipping empty macro",          "skipping empty macro",
           "empty argument, using 0n",
         "argument count wrong",          "argument count wrong",
         "missing display type",          "missing display type, using -ragged",
         "list type must come first",          "list type is not the first argument",
         "tag lists require a width argument",          "missing -width in -tag list, using 8n",
         "missing font type",          "missing name for .Ex, using \"\"",
           "empty head in list item",
           "empty list item",
           "missing font type, using \\fR",
           "unknown font type, using \\fR",
           "missing -std argument, adding it",
   
         /* related to bad macro arguments */          /* related to bad macro arguments */
         "skipping argument",          "unterminated quoted argument",
         "duplicate argument",          "duplicate argument",
         "duplicate display type",          "skipping duplicate argument",
         "duplicate list type",          "skipping duplicate display type",
           "skipping duplicate list type",
           "skipping -width argument",
         "unknown AT&T UNIX version",          "unknown AT&T UNIX version",
         "bad Boolean value",          "invalid content in Rs block",
         "unknown font",          "invalid Boolean argument",
         "unknown standard specifier",          "unknown font, skipping request",
         "bad width argument",  
   
         /* related to plain text */          /* related to plain text */
         "blank line in non-literal context",          "blank line in fill mode, using .sp",
         "tab in non-literal context",          "tab in filled text",
         "end of line whitespace",          "whitespace at end of input line",
         "bad comment style",          "bad comment style",
         "bad escape sequence",          "invalid escape sequence",
         "unterminated quoted string",          "undefined string, using \"\"",
   
         "generic error",          "generic error",
   
Line 173  static const char * const mandocerrs[MANDOCERR_MAX] = 
Line 182  static const char * const mandocerrs[MANDOCERR_MAX] = 
         "data block still open",          "data block still open",
         "ignoring extra data cells",          "ignoring extra data cells",
   
           /* related to document structure and macros */
         "input stack limit exceeded, infinite loop?",          "input stack limit exceeded, infinite loop?",
         "skipping bad character",          "skipping bad character",
         "escaped character not allowed in a name",  
         "manual name not yet set",  
         "skipping text before first section header",  
         "skipping unknown macro",          "skipping unknown macro",
         "NOT IMPLEMENTED, please use groff: skipping request",          "skipping item outside list",
         "argument count wrong",  
         "skipping invalid content in .Rs block",  
         "skipping column outside column list",          "skipping column outside column list",
         "skipping end of block that is not open",          "skipping end of block that is not open",
         "missing end of block",          "inserting missing end of block",
         "scope open on exit",          "appending missing end of block",
         "uname(3) system call failed",  
         "macro requires line argument(s)",  
         "macro requires body argument(s)",  
         "macro requires argument(s)",  
         "request requires a numeric argument",  
         "missing list type",  
         "line argument(s) will be lost",  
   
           /* related to request and macro arguments */
           "escaped character not allowed in a name",
           "argument count wrong",
           "missing list type, using -item",
           "missing manual name, using \"\"",
           "uname(3) system call failed, using UNKNOWN",
           "unknown standard specifier",
           "skipping request without numeric argument",
           "skipping all arguments",
           "skipping excess arguments",
   
         "generic fatal error",          "generic fatal error",
   
         "input too large",          "input too large",
         "not a manual",  
         "column syntax is inconsistent",  
         "NOT IMPLEMENTED: .Bd -file",          "NOT IMPLEMENTED: .Bd -file",
         "argument count wrong, violates syntax",  
         "child violates parent syntax",  
         "argument count wrong, violates syntax",  
         "NOT IMPLEMENTED: .so with absolute path or \"..\"",          "NOT IMPLEMENTED: .so with absolute path or \"..\"",
         ".so request failed",          ".so request failed",
         "no document prologue",  
         "static buffer exhausted",          "static buffer exhausted",
   
         /* system errors */          /* system errors */
Line 258  pset(const char *buf, int pos, struct mparse *curp)
Line 261  pset(const char *buf, int pos, struct mparse *curp)
         }          }
   
         if (MPARSE_MDOC & curp->options) {          if (MPARSE_MDOC & curp->options) {
                 if (NULL == curp->pmdoc)  
                         curp->pmdoc = mdoc_alloc(  
                             curp->roff, curp, curp->defos,  
                             MPARSE_QUICK & curp->options ? 1 : 0);  
                 assert(curp->pmdoc);  
                 curp->mdoc = curp->pmdoc;                  curp->mdoc = curp->pmdoc;
                 return;                  return;
         } else if (MPARSE_MAN & curp->options) {          } else if (MPARSE_MAN & curp->options) {
                 if (NULL == curp->pman)  
                         curp->pman = man_alloc(curp->roff, curp,  
                             MPARSE_QUICK & curp->options ? 1 : 0);  
                 assert(curp->pman);  
                 curp->man = curp->pman;                  curp->man = curp->pman;
                 return;                  return;
         }          }
Line 677  mparse_end(struct mparse *curp)
Line 671  mparse_end(struct mparse *curp)
         if (MANDOCLEVEL_FATAL <= curp->file_status)          if (MANDOCLEVEL_FATAL <= curp->file_status)
                 return;                  return;
   
           if (curp->mdoc == NULL &&
               curp->man == NULL &&
               curp->sodest == NULL) {
                   if (curp->options & MPARSE_MDOC)
                           curp->mdoc = curp->pmdoc;
                   else {
                           if (curp->pman == NULL)
                                   curp->pman = man_alloc(curp->roff, curp,
                                       curp->options & MPARSE_QUICK ? 1 : 0);
                           curp->man = curp->pman;
                   }
           }
   
         if (curp->mdoc && ! mdoc_endparse(curp->mdoc)) {          if (curp->mdoc && ! mdoc_endparse(curp->mdoc)) {
                 assert(MANDOCLEVEL_FATAL <= curp->file_status);                  assert(MANDOCLEVEL_FATAL <= curp->file_status);
                 return;                  return;
Line 687  mparse_end(struct mparse *curp)
Line 694  mparse_end(struct mparse *curp)
                 return;                  return;
         }          }
   
         if ( ! (curp->mdoc || curp->man || curp->sodest)) {  
                 mandoc_msg(MANDOCERR_NOTMANUAL, curp, 0, 0, NULL);  
                 curp->file_status = MANDOCLEVEL_FATAL;  
                 return;  
         }  
   
         roff_endparse(curp->roff);          roff_endparse(curp->roff);
 }  }
   
Line 776  out:
Line 777  out:
   
 struct mparse *  struct mparse *
 mparse_alloc(int options, enum mandoclevel wlevel,  mparse_alloc(int options, enum mandoclevel wlevel,
                 mandocmsg mmsg, char *defos)                  mandocmsg mmsg, const char *defos)
 {  {
         struct mparse   *curp;          struct mparse   *curp;
   
Line 790  mparse_alloc(int options, enum mandoclevel wlevel,
Line 791  mparse_alloc(int options, enum mandoclevel wlevel,
         curp->defos = defos;          curp->defos = defos;
   
         curp->roff = roff_alloc(curp, options);          curp->roff = roff_alloc(curp, options);
           if (curp->options & MPARSE_MDOC)
                   curp->pmdoc = mdoc_alloc(
                       curp->roff, curp, curp->defos,
                       curp->options & MPARSE_QUICK ? 1 : 0);
           if (curp->options & MPARSE_MAN)
                   curp->pman = man_alloc(curp->roff, curp,
                       curp->options & MPARSE_QUICK ? 1 : 0);
   
         return(curp);          return(curp);
 }  }
   

Legend:
Removed from v.1.57  
changed lines
  Added in v.1.76

CVSweb