[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.151 and 1.152

version 1.151, 2011/01/03 23:53:51 version 1.152, 2011/01/22 14:00:52
Line 78  static int  concat(struct mdoc *, char *, 
Line 78  static int  concat(struct mdoc *, char *, 
 static  int      ebool(POST_ARGS);  static  int      ebool(POST_ARGS);
 static  int      berr_ge1(POST_ARGS);  static  int      berr_ge1(POST_ARGS);
 static  int      bwarn_ge1(POST_ARGS);  static  int      bwarn_ge1(POST_ARGS);
 static  int      eerr_ge1(POST_ARGS);  
 static  int      ewarn_eq0(POST_ARGS);  static  int      ewarn_eq0(POST_ARGS);
 static  int      ewarn_eq1(POST_ARGS);  static  int      ewarn_eq1(POST_ARGS);
 static  int      ewarn_ge1(POST_ARGS);  static  int      ewarn_ge1(POST_ARGS);
Line 154  static v_post  posts_sp[] = { ewarn_le1, NULL };
Line 153  static v_post  posts_sp[] = { ewarn_le1, NULL };
 static  v_post   posts_ss[] = { post_ignpar, hwarn_ge1, bwarn_ge1, NULL };  static  v_post   posts_ss[] = { post_ignpar, hwarn_ge1, bwarn_ge1, NULL };
 static  v_post   posts_st[] = { post_st, NULL };  static  v_post   posts_st[] = { post_st, NULL };
 static  v_post   posts_std[] = { post_std, NULL };  static  v_post   posts_std[] = { post_std, NULL };
 static  v_post   posts_text[] = { eerr_ge1, NULL };  static  v_post   posts_text[] = { ewarn_ge1, NULL };
 static  v_post   posts_text1[] = { ewarn_eq1, NULL };  static  v_post   posts_text1[] = { ewarn_eq1, NULL };
 static  v_post   posts_vt[] = { post_vt, NULL };  static  v_post   posts_vt[] = { post_vt, NULL };
 static  v_post   posts_wline[] = { bwarn_ge1, NULL };  static  v_post   posts_wline[] = { bwarn_ge1, NULL };
 static  v_post   posts_wtext[] = { ewarn_ge1, NULL };  
 static  v_pre    pres_an[] = { pre_an, NULL };  static  v_pre    pres_an[] = { pre_an, NULL };
 static  v_pre    pres_bd[] = { pre_display, pre_bd, pre_literal, pre_par, NULL };  static  v_pre    pres_bd[] = { pre_display, pre_bd, pre_literal, pre_par, NULL };
 static  v_pre    pres_bl[] = { pre_bl, pre_par, NULL };  static  v_pre    pres_bl[] = { pre_bl, pre_par, NULL };
Line 190  const struct valids mdoc_valids[MDOC_MAX] = {
Line 188  const struct valids mdoc_valids[MDOC_MAX] = {
         { pres_bl, posts_bl },                  /* Bl */          { pres_bl, posts_bl },                  /* Bl */
         { NULL, NULL },                         /* El */          { NULL, NULL },                         /* El */
         { pres_it, posts_it },                  /* It */          { pres_it, posts_it },                  /* It */
         { NULL, posts_text },                   /* Ad */          { NULL, NULL },                         /* Ad */
         { pres_an, posts_an },                  /* An */          { pres_an, posts_an },                  /* An */
         { NULL, posts_defaults },               /* Ar */          { NULL, posts_defaults },               /* Ar */
         { NULL, posts_text },                   /* Cd */          { NULL, NULL },                         /* Cd */
         { NULL, NULL },                         /* Cm */          { NULL, NULL },                         /* Cm */
         { NULL, NULL },                         /* Dv */          { NULL, NULL },                         /* Dv */
         { pres_er, posts_text },                /* Er */          { pres_er, NULL },                      /* Er */
         { NULL, NULL },                         /* Ev */          { NULL, NULL },                         /* Ev */
         { pres_std, posts_std },                /* Ex */          { pres_std, posts_std },                /* Ex */
         { NULL, NULL },                         /* Fa */          { NULL, NULL },                         /* Fa */
         { pres_fd, posts_wtext },               /* Fd */          { pres_fd, posts_text },                /* Fd */
         { NULL, NULL },                         /* Fl */          { NULL, NULL },                         /* Fl */
         { NULL, posts_text },                   /* Fn */          { NULL, NULL },                         /* Fn */
         { NULL, posts_wtext },                  /* Ft */          { NULL, NULL },                         /* Ft */
         { NULL, posts_text },                   /* Ic */          { NULL, NULL },                         /* Ic */
         { NULL, posts_text1 },                  /* In */          { NULL, posts_text1 },                  /* In */
         { NULL, posts_defaults },               /* Li */          { NULL, posts_defaults },               /* Li */
         { NULL, posts_nd },                     /* Nd */          { NULL, posts_nd },                     /* Nd */
Line 216  const struct valids mdoc_valids[MDOC_MAX] = {
Line 214  const struct valids mdoc_valids[MDOC_MAX] = {
         { NULL, posts_st },                     /* St */          { NULL, posts_st },                     /* St */
         { NULL, NULL },                         /* Va */          { NULL, NULL },                         /* Va */
         { NULL, posts_vt },                     /* Vt */          { NULL, posts_vt },                     /* Vt */
         { NULL, posts_wtext },                  /* Xr */          { NULL, posts_text },                   /* Xr */
         { NULL, posts_text },                   /* %A */          { NULL, posts_text },                   /* %A */
         { NULL, posts_text },                   /* %B */ /* FIXME: can be used outside Rs/Re. */          { NULL, posts_text },                   /* %B */ /* FIXME: can be used outside Rs/Re. */
         { NULL, posts_text },                   /* %D */ /* FIXME: check date with mandoc_a2time(). */          { NULL, posts_text },                   /* %D */ /* FIXME: check date with mandoc_a2time(). */
Line 247  const struct valids mdoc_valids[MDOC_MAX] = {
Line 245  const struct valids mdoc_valids[MDOC_MAX] = {
         { NULL, NULL },                         /* Em */          { NULL, NULL },                         /* Em */
         { NULL, NULL },                         /* Eo */          { NULL, NULL },                         /* Eo */
         { NULL, NULL },                         /* Fx */          { NULL, NULL },                         /* Fx */
         { NULL, posts_text },                   /* Ms */          { NULL, NULL },                         /* Ms */
         { NULL, posts_notext },                 /* No */          { NULL, posts_notext },                 /* No */
         { NULL, posts_notext },                 /* Ns */          { NULL, posts_notext },                 /* Ns */
         { NULL, NULL },                         /* Nx */          { NULL, NULL },                         /* Nx */
Line 266  const struct valids mdoc_valids[MDOC_MAX] = {
Line 264  const struct valids mdoc_valids[MDOC_MAX] = {
         { NULL, NULL },                         /* So */          { NULL, NULL },                         /* So */
         { NULL, NULL },                         /* Sq */          { NULL, NULL },                         /* Sq */
         { NULL, posts_bool },                   /* Sm */          { NULL, posts_bool },                   /* Sm */
         { NULL, posts_text },                   /* Sx */          { NULL, NULL },                         /* Sx */
         { NULL, posts_text },                   /* Sy */          { NULL, NULL },                         /* Sy */
         { NULL, posts_text },                   /* Tn */          { NULL, NULL },                         /* Tn */
         { NULL, NULL },                         /* Ux */          { NULL, NULL },                         /* Ux */
         { NULL, NULL },                         /* Xc */          { NULL, NULL },                         /* Xc */
         { NULL, NULL },                         /* Xo */          { NULL, NULL },                         /* Xo */
Line 284  const struct valids mdoc_valids[MDOC_MAX] = {
Line 282  const struct valids mdoc_valids[MDOC_MAX] = {
         { NULL, posts_eoln },                   /* Ud */          { NULL, posts_eoln },                   /* Ud */
         { NULL, posts_lb },                     /* Lb */          { NULL, posts_lb },                     /* Lb */
         { NULL, posts_notext },                 /* Lp */          { NULL, posts_notext },                 /* Lp */
         { NULL, posts_text },                   /* Lk */          { NULL, NULL },                         /* Lk */
         { NULL, posts_defaults },               /* Mt */          { NULL, posts_defaults },               /* Mt */
         { NULL, NULL },                         /* Brq */          { NULL, NULL },                         /* Brq */
         { NULL, NULL },                         /* Bro */          { NULL, NULL },                         /* Bro */
Line 434  bwarn_ge1(POST_ARGS)
Line 432  bwarn_ge1(POST_ARGS)
 }  }
   
 static int  static int
 eerr_ge1(POST_ARGS)  
 {  
         return(check_count(mdoc, MDOC_ELEM, CHECK_ERROR, CHECK_GT, 0));  
 }  
   
 static int  
 ewarn_eq0(POST_ARGS)  ewarn_eq0(POST_ARGS)
 {  {
         return(check_count(mdoc, MDOC_ELEM, CHECK_WARN, CHECK_EQ, 0));          return(check_count(mdoc, MDOC_ELEM, CHECK_WARN, CHECK_EQ, 0));
Line 1079  post_vt(POST_ARGS)
Line 1071  post_vt(POST_ARGS)
         /*          /*
          * The Vt macro comes in both ELEM and BLOCK form, both of which           * The Vt macro comes in both ELEM and BLOCK form, both of which
          * have different syntaxes (yet more context-sensitive           * have different syntaxes (yet more context-sensitive
          * behaviour).  ELEM types must have a child; BLOCK types,           * behaviour).  ELEM types must have a child, which is already
            * guaranteed by the in_line parsing routine; BLOCK types,
          * specifically the BODY, should only have TEXT children.           * specifically the BODY, should only have TEXT children.
          */           */
   
         if (MDOC_ELEM == mdoc->last->type)  
                 return(eerr_ge1(mdoc));  
         if (MDOC_BODY != mdoc->last->type)          if (MDOC_BODY != mdoc->last->type)
                 return(1);                  return(1);
   
Line 1228  post_an(POST_ARGS)
Line 1219  post_an(POST_ARGS)
         struct mdoc_node *np;          struct mdoc_node *np;
   
         np = mdoc->last;          np = mdoc->last;
         if (AUTH__NONE != np->norm->An.auth && np->child) {          if (AUTH__NONE == np->norm->An.auth) {
                   if (0 == np->child)
                           check_count(mdoc, MDOC_ELEM, CHECK_WARN, CHECK_GT, 0);
           } else if (np->child)
                 check_count(mdoc, MDOC_ELEM, CHECK_WARN, CHECK_EQ, 0);                  check_count(mdoc, MDOC_ELEM, CHECK_WARN, CHECK_EQ, 0);
                 return(1);  
         }  
   
         /*  
          * FIXME: make this ewarn and make sure that the front-ends  
          * don't print the arguments.  
          */  
         if (AUTH__NONE != np->norm->An.auth || np->child)  
                 return(1);  
   
         mdoc_nmsg(mdoc, np, MANDOCERR_NOARGS);  
         return(1);          return(1);
 }  }
   

Legend:
Removed from v.1.151  
changed lines
  Added in v.1.152

CVSweb