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

Diff for /mandoc/mdoc_validate.c between version 1.356 and 1.362

version 1.356, 2018/03/16 20:41:41 version 1.362, 2018/08/17 20:33:38
Line 116  static void  post_useless(POST_ARGS);
Line 116  static void  post_useless(POST_ARGS);
 static  void     post_xr(POST_ARGS);  static  void     post_xr(POST_ARGS);
 static  void     post_xx(POST_ARGS);  static  void     post_xx(POST_ARGS);
   
 static  const v_post __mdoc_valids[MDOC_MAX - MDOC_Dd] = {  static  const v_post mdoc_valids[MDOC_MAX - MDOC_Dd] = {
         post_dd,        /* Dd */          post_dd,        /* Dd */
         post_dt,        /* Dt */          post_dt,        /* Dt */
         post_os,        /* Os */          post_os,        /* Os */
Line 238  static const v_post __mdoc_valids[MDOC_MAX - MDOC_Dd] 
Line 238  static const v_post __mdoc_valids[MDOC_MAX - MDOC_Dd] 
         NULL,           /* %U */          NULL,           /* %U */
         NULL,           /* Ta */          NULL,           /* Ta */
 };  };
 static  const v_post *const mdoc_valids = __mdoc_valids - MDOC_Dd;  
   
 #define RSORD_MAX 14 /* Number of `Rs' blocks. */  #define RSORD_MAX 14 /* Number of `Rs' blocks. */
   
Line 320  mdoc_node_validate(struct roff_man *mdoc)
Line 319  mdoc_node_validate(struct roff_man *mdoc)
                     (np->tok == MDOC_Sh || np->tok == MDOC_Ss)))                      (np->tok == MDOC_Sh || np->tok == MDOC_Ss)))
                         check_toptext(mdoc, n->line, n->pos, n->string);                          check_toptext(mdoc, n->line, n->pos, n->string);
                 break;                  break;
           case ROFFT_COMMENT:
         case ROFFT_EQN:          case ROFFT_EQN:
         case ROFFT_TBL:          case ROFFT_TBL:
                 break;                  break;
Line 356  mdoc_node_validate(struct roff_man *mdoc)
Line 356  mdoc_node_validate(struct roff_man *mdoc)
                 }                  }
   
                 assert(n->tok >= MDOC_Dd && n->tok < MDOC_MAX);                  assert(n->tok >= MDOC_Dd && n->tok < MDOC_MAX);
                 p = mdoc_valids + n->tok;                  p = mdoc_valids + (n->tok - MDOC_Dd);
                 if (*p)                  if (*p)
                         (*p)(mdoc);                          (*p)(mdoc);
                 if (mdoc->last == n)                  if (mdoc->last == n)
Line 436  check_text_em(struct roff_man *mdoc, int ln, int pos, 
Line 436  check_text_em(struct roff_man *mdoc, int ln, int pos, 
                      isalpha((unsigned char)cp[-3]) :                       isalpha((unsigned char)cp[-3]) :
                      np != NULL &&                       np != NULL &&
                      np->type == ROFFT_TEXT &&                       np->type == ROFFT_TEXT &&
                      np->string != '\0' &&                       *np->string != '\0' &&
                      isalpha((unsigned char)np->string[                       isalpha((unsigned char)np->string[
                        strlen(np->string) - 1])) ||                         strlen(np->string) - 1])) ||
                     (cp[2] != '\0' ?                      (cp[1] != '\0' && cp[2] != '\0' ?
                      isalpha((unsigned char)cp[2]) :                       isalpha((unsigned char)cp[2]) :
                      nn != NULL &&                       nn != NULL &&
                      nn->type == ROFFT_TEXT &&                       nn->type == ROFFT_TEXT &&
                      nn->string != '\0' &&  
                      isalpha((unsigned char)*nn->string))) {                       isalpha((unsigned char)*nn->string))) {
                         mandoc_msg(MANDOCERR_DASHDASH, mdoc->parse,                          mandoc_msg(MANDOCERR_DASHDASH, mdoc->parse,
                             ln, pos + (int)(cp - p) - 1, NULL);                              ln, pos + (int)(cp - p) - 1, NULL);
Line 1004  post_lb(POST_ARGS)
Line 1003  post_lb(POST_ARGS)
   
         roff_word_alloc(mdoc, n->line, n->pos, "library");          roff_word_alloc(mdoc, n->line, n->pos, "library");
         mdoc->last->flags = NODE_NOSRC;          mdoc->last->flags = NODE_NOSRC;
         roff_word_alloc(mdoc, n->line, n->pos, "\\(Lq");          roff_word_alloc(mdoc, n->line, n->pos, "\\(lq");
         mdoc->last->flags = NODE_DELIMO | NODE_NOSRC;          mdoc->last->flags = NODE_DELIMO | NODE_NOSRC;
         mdoc->last = mdoc->last->next;          mdoc->last = mdoc->last->next;
         roff_word_alloc(mdoc, n->line, n->pos, "\\(Rq");          roff_word_alloc(mdoc, n->line, n->pos, "\\(rq");
         mdoc->last->flags = NODE_DELIMC | NODE_NOSRC;          mdoc->last->flags = NODE_DELIMC | NODE_NOSRC;
         mdoc->last = n;          mdoc->last = n;
 }  }
Line 1988  post_root(POST_ARGS)
Line 1987  post_root(POST_ARGS)
         /* Check that we begin with a proper `Sh'. */          /* Check that we begin with a proper `Sh'. */
   
         n = mdoc->first->child;          n = mdoc->first->child;
         while (n != NULL && n->tok >= MDOC_Dd &&          while (n != NULL &&
             mdoc_macros[n->tok].flags & MDOC_PROLOGUE)              (n->type == ROFFT_COMMENT ||
                (n->tok >= MDOC_Dd &&
                 mdoc_macro(n->tok)->flags & MDOC_PROLOGUE)))
                 n = n->next;                  n = n->next;
   
         if (n == NULL)          if (n == NULL)

Legend:
Removed from v.1.356  
changed lines
  Added in v.1.362

CVSweb