[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.50 and 1.55

version 1.50, 2009/10/24 05:52:14 version 1.55, 2010/01/01 15:14:03
Line 18 
Line 18 
   
 #include <assert.h>  #include <assert.h>
 #include <ctype.h>  #include <ctype.h>
 #include <errno.h>  
 #include <limits.h>  #include <limits.h>
 #include <stdarg.h>  #include <stdarg.h>
 #include <stdlib.h>  #include <stdlib.h>
Line 119  static v_post  posts_bf[] = { hwarn_le1, post_bf, NULL
Line 118  static v_post  posts_bf[] = { hwarn_le1, post_bf, NULL
 static  v_post   posts_bl[] = { bwarn_ge1, post_bl, NULL };  static  v_post   posts_bl[] = { bwarn_ge1, post_bl, NULL };
 static  v_post   posts_bool[] = { eerr_eq1, ebool, NULL };  static  v_post   posts_bool[] = { eerr_eq1, ebool, NULL };
 static  v_post   posts_fo[] = { hwarn_eq1, bwarn_ge1, NULL };  static  v_post   posts_fo[] = { hwarn_eq1, bwarn_ge1, NULL };
 static  v_post   posts_in[] = { eerr_eq1, NULL };  
 static  v_post   posts_it[] = { post_it, NULL };  static  v_post   posts_it[] = { post_it, NULL };
 static  v_post   posts_lb[] = { eerr_eq1, post_lb, NULL };  static  v_post   posts_lb[] = { eerr_eq1, post_lb, NULL };
 static  v_post   posts_nd[] = { berr_ge1, NULL };  static  v_post   posts_nd[] = { berr_ge1, NULL };
 static  v_post   posts_nm[] = { post_nm, NULL };  static  v_post   posts_nm[] = { post_nm, NULL };
 static  v_post   posts_notext[] = { eerr_eq0, NULL };  static  v_post   posts_notext[] = { eerr_eq0, NULL };
 static  v_post   posts_pf[] = { eerr_eq1, NULL };  
 static  v_post   posts_rs[] = { berr_ge1, herr_eq0, post_rs, NULL };  static  v_post   posts_rs[] = { berr_ge1, herr_eq0, post_rs, NULL };
 static  v_post   posts_sh[] = { herr_ge1, bwarn_ge1, post_sh, NULL };  static  v_post   posts_sh[] = { herr_ge1, bwarn_ge1, post_sh, NULL };
 static  v_post   posts_sp[] = { eerr_le1, NULL };  static  v_post   posts_sp[] = { eerr_le1, NULL };
 static  v_post   posts_ss[] = { herr_ge1, NULL };  static  v_post   posts_ss[] = { herr_ge1, NULL };
 static  v_post   posts_st[] = { eerr_eq1, post_st, NULL };  static  v_post   posts_st[] = { eerr_eq1, post_st, NULL };
 static  v_post   posts_text[] = { eerr_ge1, NULL };  static  v_post   posts_text[] = { eerr_ge1, NULL };
   static  v_post   posts_text1[] = { eerr_eq1, NULL };
 static  v_post   posts_wline[] = { bwarn_ge1, herr_eq0, NULL };  static  v_post   posts_wline[] = { bwarn_ge1, herr_eq0, NULL };
 static  v_post   posts_wtext[] = { ewarn_ge1, NULL };  static  v_post   posts_wtext[] = { ewarn_ge1, NULL };
 static  v_post   posts_xr[] = { eerr_ge1, eerr_le2, NULL };  static  v_post   posts_xr[] = { eerr_ge1, eerr_le2, NULL };
Line 182  const struct valids mdoc_valids[MDOC_MAX] = {
Line 180  const struct valids mdoc_valids[MDOC_MAX] = {
         { NULL, posts_text },                   /* Fn */          { NULL, posts_text },                   /* Fn */
         { NULL, posts_wtext },                  /* Ft */          { NULL, posts_wtext },                  /* Ft */
         { NULL, posts_text },                   /* Ic */          { NULL, posts_text },                   /* Ic */
         { NULL, posts_in },                     /* In */          { NULL, posts_text1 },                  /* In */
         { NULL, NULL },                         /* Li */          { NULL, NULL },                         /* Li */
         { NULL, posts_nd },                     /* Nd */          { NULL, posts_nd },                     /* Nd */
         { NULL, posts_nm },                     /* Nm */          { NULL, posts_nm },                     /* Nm */
Line 196  const struct valids mdoc_valids[MDOC_MAX] = {
Line 194  const struct valids mdoc_valids[MDOC_MAX] = {
         { NULL, posts_xr },                     /* Xr */          { NULL, posts_xr },                     /* 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 */          { NULL, posts_text },                   /* %D */ /* FIXME: check date with mandoc_a2time(). */
         { NULL, posts_text },                   /* %I */          { NULL, posts_text },                   /* %I */
         { NULL, posts_text },                   /* %J */          { NULL, posts_text },                   /* %J */
         { NULL, posts_text },                   /* %N */          { NULL, posts_text },                   /* %N */
Line 230  const struct valids mdoc_valids[MDOC_MAX] = {
Line 228  const struct valids mdoc_valids[MDOC_MAX] = {
         { NULL, NULL },                         /* Nx */          { NULL, NULL },                         /* Nx */
         { NULL, NULL },                         /* Ox */          { NULL, NULL },                         /* Ox */
         { NULL, NULL },                         /* Pc */          { NULL, NULL },                         /* Pc */
         { NULL, posts_pf },                     /* Pf */          { NULL, posts_text1 },                  /* Pf */
         { NULL, NULL },                         /* Po */          { NULL, NULL },                         /* Po */
         { NULL, posts_wline },                  /* Pq */          { NULL, posts_wline },                  /* Pq */
         { NULL, NULL },                         /* Qc */          { NULL, NULL },                         /* Qc */
Line 261  const struct valids mdoc_valids[MDOC_MAX] = {
Line 259  const struct valids mdoc_valids[MDOC_MAX] = {
         { NULL, posts_notext },                 /* Ud */          { NULL, posts_notext },                 /* Ud */
         { pres_lb, posts_lb },                  /* Lb */          { pres_lb, posts_lb },                  /* Lb */
         { NULL, posts_notext },                 /* Lp */          { NULL, posts_notext },                 /* Lp */
         { NULL, NULL },                         /* Lk */          { NULL, posts_text },                   /* Lk */
         { NULL, posts_text },                   /* Mt */          { NULL, posts_text },                   /* Mt */
         { NULL, posts_wline },                  /* Brq */          { NULL, posts_wline },                  /* Brq */
         { NULL, NULL },                         /* Bro */          { NULL, NULL },                         /* Bro */
Line 273  const struct valids mdoc_valids[MDOC_MAX] = {
Line 271  const struct valids mdoc_valids[MDOC_MAX] = {
         { NULL, posts_text },                   /* %Q */          { NULL, posts_text },                   /* %Q */
         { NULL, posts_notext },                 /* br */          { NULL, posts_notext },                 /* br */
         { NULL, posts_sp },                     /* sp */          { NULL, posts_sp },                     /* sp */
         { NULL, posts_text },                   /* %U */          { NULL, posts_text1 },                  /* %U */
 };  };
   
   
Line 667  pre_bl(PRE_ARGS)
Line 665  pre_bl(PRE_ARGS)
                 /* FALLTHROUGH */                  /* FALLTHROUGH */
         case (MDOC_Diag):          case (MDOC_Diag):
                 /* FALLTHROUGH */                  /* FALLTHROUGH */
           case (MDOC_Ohang):
                   /* FALLTHROUGH */
         case (MDOC_Inset):          case (MDOC_Inset):
                 /* FALLTHROUGH */                  /* FALLTHROUGH */
         case (MDOC_Item):          case (MDOC_Item):
Line 808  static int
Line 808  static int
 pre_dt(PRE_ARGS)  pre_dt(PRE_ARGS)
 {  {
   
           /* FIXME: make sure is capitalised. */
   
         if (0 == mdoc->meta.date || mdoc->meta.os)          if (0 == mdoc->meta.date || mdoc->meta.os)
                 if ( ! mdoc_nwarn(mdoc, n, EPROLOOO))                  if ( ! mdoc_nwarn(mdoc, n, EPROLOOO))
                         return(0);                          return(0);
Line 1084  post_bl(POST_ARGS)
Line 1086  post_bl(POST_ARGS)
         if (NULL == mdoc->last->child)          if (NULL == mdoc->last->child)
                 return(1);                  return(1);
   
           /*
            * We only allow certain children of `Bl'.  This is usually on
            * `It', but apparently `Sm' occurs here and there, so we let
            * that one through, too.
            */
   
         /* LINTED */          /* LINTED */
         for (n = mdoc->last->child; n; n = n->next) {          for (n = mdoc->last->child; n; n = n->next) {
                 if (MDOC_BLOCK == n->type)                  if (MDOC_BLOCK == n->type && MDOC_It == n->tok)
                         if (MDOC_It == n->tok)                          continue;
                                 continue;                  if (MDOC_Sm == n->tok)
                           continue;
                 return(mdoc_nerr(mdoc, n, EBADCHILD));                  return(mdoc_nerr(mdoc, n, EBADCHILD));
         }          }
   

Legend:
Removed from v.1.50  
changed lines
  Added in v.1.55

CVSweb