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

Diff for /mandoc/roff.c between version 1.251 and 1.255

version 1.251, 2015/01/20 21:16:51 version 1.255, 2015/01/23 20:18:40
Line 608  static struct roffmac  roffs[ROFF_MAX] = {
Line 608  static struct roffmac  roffs[ROFF_MAX] = {
         { "po", roff_line_ignore, NULL, NULL, 0, NULL },          { "po", roff_line_ignore, NULL, NULL, 0, NULL },
         { "ps", roff_line_ignore, NULL, NULL, 0, NULL },          { "ps", roff_line_ignore, NULL, NULL, 0, NULL },
         { "psbb", roff_unsupp, NULL, NULL, 0, NULL },          { "psbb", roff_unsupp, NULL, NULL, 0, NULL },
         { "pshape", roff_line_ignore, NULL, NULL, 0, NULL },          { "pshape", roff_unsupp, NULL, NULL, 0, NULL },
         { "pso", roff_insec, NULL, NULL, 0, NULL },          { "pso", roff_insec, NULL, NULL, 0, NULL },
         { "ptr", roff_line_ignore, NULL, NULL, 0, NULL },          { "ptr", roff_line_ignore, NULL, NULL, 0, NULL },
         { "pvs", roff_line_ignore, NULL, NULL, 0, NULL },          { "pvs", roff_line_ignore, NULL, NULL, 0, NULL },
Line 640  static struct roffmac  roffs[ROFF_MAX] = {
Line 640  static struct roffmac  roffs[ROFF_MAX] = {
         { "sv", roff_line_ignore, NULL, NULL, 0, NULL },          { "sv", roff_line_ignore, NULL, NULL, 0, NULL },
         { "sy", roff_insec, NULL, NULL, 0, NULL },          { "sy", roff_insec, NULL, NULL, 0, NULL },
         { "T&", roff_T_, NULL, NULL, 0, NULL },          { "T&", roff_T_, NULL, NULL, 0, NULL },
         { "ta", roff_line_ignore, NULL, NULL, 0, NULL },          { "ta", roff_unsupp, NULL, NULL, 0, NULL },
         { "tc", roff_unsupp, NULL, NULL, 0, NULL },          { "tc", roff_unsupp, NULL, NULL, 0, NULL },
         { "TE", roff_TE, NULL, NULL, 0, NULL },          { "TE", roff_TE, NULL, NULL, 0, NULL },
         { "TH", roff_TH, NULL, NULL, 0, NULL },          { "TH", roff_TH, NULL, NULL, 0, NULL },
         { "ti", roff_line_ignore, NULL, NULL, 0, NULL },          { "ti", roff_unsupp, NULL, NULL, 0, NULL },
         { "tkf", roff_line_ignore, NULL, NULL, 0, NULL },          { "tkf", roff_line_ignore, NULL, NULL, 0, NULL },
         { "tl", roff_unsupp, NULL, NULL, 0, NULL },          { "tl", roff_unsupp, NULL, NULL, 0, NULL },
         { "tm", roff_line_ignore, NULL, NULL, 0, NULL },          { "tm", roff_line_ignore, NULL, NULL, 0, NULL },
Line 1004  roff_res(struct roff *r, struct buf *buf, int ln, int 
Line 1004  roff_res(struct roff *r, struct buf *buf, int ln, int 
   
                 /* Advance to the end of the name. */                  /* Advance to the end of the name. */
   
                   naml = 0;
                 arg_complete = 1;                  arg_complete = 1;
                 for (naml = 0; maxl == 0 || naml < maxl; naml++, cp++) {                  while (maxl == 0 || naml < maxl) {
                         if (*cp == '\0') {                          if (*cp == '\0') {
                                 mandoc_msg(MANDOCERR_ESC_BAD, r->parse,                                  mandoc_msg(MANDOCERR_ESC_BAD, r->parse,
                                     ln, (int)(stesc - buf->buf), stesc);                                      ln, (int)(stesc - buf->buf), stesc);
Line 1016  roff_res(struct roff *r, struct buf *buf, int ln, int 
Line 1017  roff_res(struct roff *r, struct buf *buf, int ln, int 
                                 cp++;                                  cp++;
                                 break;                                  break;
                         }                          }
                           if (*cp++ != '\\' || stesc[1] != 'w') {
                                   naml++;
                                   continue;
                           }
                           switch (mandoc_escape(&cp, NULL, NULL)) {
                           case ESCAPE_SPECIAL:
                                   /* FALLTHROUGH */
                           case ESCAPE_UNICODE:
                                   /* FALLTHROUGH */
                           case ESCAPE_NUMBERED:
                                   /* FALLTHROUGH */
                           case ESCAPE_OVERSTRIKE:
                                   naml++;
                                   break;
                           default:
                                   break;
                           }
                 }                  }
   
                 /*                  /*
Line 1166  roff_parseln(struct roff *r, int ln, struct buf *buf, 
Line 1184  roff_parseln(struct roff *r, int ln, struct buf *buf, 
   
         /*          /*
          * First, if a scope is open and we're not a macro, pass the           * First, if a scope is open and we're not a macro, pass the
          * text through the macro's filter.  If a scope isn't open and           * text through the macro's filter.
          * we're not a macro, just let it through.           * Equations process all content themselves.
          * Finally, if there's an equation scope open, divert it into it           * Tables process almost all content themselves, but we want
          * no matter our state.           * to warn about macros before passing it there.
          */           */
   
         if (r->last && ! ctl) {          if (r->last != NULL && ! ctl) {
                 t = r->last->tok;                  t = r->last->tok;
                 assert(roffs[t].text);                  assert(roffs[t].text);
                 e = (*roffs[t].text)(r, t, buf, ln, pos, pos, offs);                  e = (*roffs[t].text)(r, t, buf, ln, pos, pos, offs);
Line 1180  roff_parseln(struct roff *r, int ln, struct buf *buf, 
Line 1198  roff_parseln(struct roff *r, int ln, struct buf *buf, 
                 if (e != ROFF_CONT)                  if (e != ROFF_CONT)
                         return(e);                          return(e);
         }          }
         if (r->eqn)          if (r->eqn != NULL)
                 return(eqn_read(&r->eqn, ln, buf->buf, ppos, offs));                  return(eqn_read(&r->eqn, ln, buf->buf, ppos, offs));
         if ( ! ctl) {          if (r->tbl != NULL && ( ! ctl || buf->buf[pos] == '\0'))
                 if (r->tbl)                  return(tbl_read(r->tbl, ln, buf->buf, pos));
                         return(tbl_read(r->tbl, ln, buf->buf, pos));          if ( ! ctl)
                 return(roff_parsetext(buf, pos, offs));                  return(roff_parsetext(buf, pos, offs));
         }  
   
         /* Skip empty request lines. */          /* Skip empty request lines. */
   
Line 1624  roff_getnum(const char *v, int *pos, int *res)
Line 1641  roff_getnum(const char *v, int *pos, int *res)
         if (n)          if (n)
                 *res = -*res;                  *res = -*res;
   
         *pos = p;          /* Each number may be followed by one optional scaling unit. */
         return 1;  
           switch (v[p]) {
           case 'f':
                   *res *= 65536;
                   break;
           case 'i':
                   *res *= 240;
                   break;
           case 'c':
                   *res *= 240;
                   *res /= 2.54;
                   break;
           case 'v':
                   /* FALLTROUGH */
           case 'P':
                   *res *= 40;
                   break;
           case 'm':
                   /* FALLTROUGH */
           case 'n':
                   *res *= 24;
                   break;
           case 'p':
                   *res *= 10;
                   *res /= 3;
                   break;
           case 'u':
                   break;
           case 'M':
                   *res *= 6;
                   *res /= 25;
                   break;
           default:
                   p--;
                   break;
           }
   
           *pos = p + 1;
           return(1);
 }  }
   
 /*  /*

Legend:
Removed from v.1.251  
changed lines
  Added in v.1.255

CVSweb