[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.58 and 1.65

version 1.58, 2010/02/17 19:28:11 version 1.65, 2010/04/06 11:52:25
Line 44  struct valids {
Line 44  struct valids {
         v_post  *post;          v_post  *post;
 };  };
   
 static  int      check_parent(PRE_ARGS, int, enum mdoc_type);  static  int      check_parent(PRE_ARGS, enum mdoct, enum mdoc_type);
 static  int      check_msec(PRE_ARGS, ...);  static  int      check_msec(PRE_ARGS, ...);
 static  int      check_sec(PRE_ARGS, ...);  static  int      check_sec(PRE_ARGS, ...);
 static  int      check_stdarg(PRE_ARGS);  static  int      check_stdarg(PRE_ARGS);
Line 133  static v_post  posts_text1[] = { eerr_eq1, NULL };
Line 133  static v_post  posts_text1[] = { eerr_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, 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, NULL };  static  v_post   posts_xr[] = { 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, NULL };  static  v_pre    pres_bd[] = { pre_display, pre_bd, NULL };
 static  v_pre    pres_bl[] = { pre_bl, NULL };  static  v_pre    pres_bl[] = { pre_bl, NULL };
Line 547  check_text(struct mdoc *mdoc, int line, int pos, const
Line 547  check_text(struct mdoc *mdoc, int line, int pos, const
   
   
 static int  static int
 check_parent(PRE_ARGS, int tok, enum mdoc_type t)  check_parent(PRE_ARGS, enum mdoct tok, enum mdoc_type t)
 {  {
   
         assert(n->parent);          assert(n->parent);
Line 621  pre_bl(PRE_ARGS)
Line 621  pre_bl(PRE_ARGS)
                 case (MDOC_Inset):                  case (MDOC_Inset):
                         /* FALLTHROUGH */                          /* FALLTHROUGH */
                 case (MDOC_Column):                  case (MDOC_Column):
                         if (type >= 0)                          /*
                                 return(mdoc_nerr(mdoc, n, EMULTILIST));                           * Note that if a duplicate is detected, we
                            * remove the duplicate instead of passing it
                            * over.  If we don't do this, mdoc_action will
                            * become confused when it scans over multiple
                            * types whilst setting its bitmasks.
                            *
                            * FIXME: this should occur in mdoc_action.c.
                            */
                           if (type >= 0) {
                                   if ( ! mdoc_nwarn(mdoc, n, EMULTILIST))
                                           return(0);
                                   mdoc_argn_free(n->args, pos);
                                   break;
                           }
                         type = n->args->argv[pos].arg;                          type = n->args->argv[pos].arg;
                         break;                          break;
                 case (MDOC_Compact):                  case (MDOC_Compact):
Line 1082  post_bl_head(POST_ARGS) 
Line 1095  post_bl_head(POST_ARGS) 
 {  {
         int                     i;          int                     i;
         const struct mdoc_node *n;          const struct mdoc_node *n;
           const struct mdoc_argv *a;
   
         n = mdoc->last->parent;          n = mdoc->last->parent;
         assert(n->args);          assert(n->args);
   
         for (i = 0; i < (int)n->args->argc; i++)          for (i = 0; i < (int)n->args->argc; i++) {
                 if (n->args->argv[i].arg == MDOC_Column)                  a = &n->args->argv[i];
                         break;                  if (a->arg == MDOC_Column) {
                           if (a->sz && mdoc->last->nchild)
                                   return(mdoc_nerr(mdoc, n, ECOLMIS));
                           return(1);
                   }
           }
   
         if (i == (int)n->args->argc)          if (0 == (i = mdoc->last->nchild))
                 return(1);                  return(1);
           return(warn_count(mdoc, "==", 0, "line arguments", i));
         if (n->args->argv[i].sz && mdoc->last->child)  
                 return(mdoc_nerr(mdoc, n, ECOLMIS));  
   
         return(1);  
 }  }
   
   
Line 1308  post_sh_head(POST_ARGS)
Line 1323  post_sh_head(POST_ARGS)
          * non-CUSTOM has a conventional order to be followed.           * non-CUSTOM has a conventional order to be followed.
          */           */
   
         if (SEC_NAME != sec && SEC_NONE == mdoc->lastnamed)          if (SEC_NAME != sec && SEC_NONE == mdoc->lastnamed &&
                 return(mdoc_nerr(mdoc, mdoc->last, ESECNAME));                          ! mdoc_nwarn(mdoc, mdoc->last, ESECNAME))
                   return(0);
         if (SEC_CUSTOM == sec)          if (SEC_CUSTOM == sec)
                 return(1);                  return(1);
         if (sec == mdoc->lastnamed)          if (sec == mdoc->lastnamed)

Legend:
Removed from v.1.58  
changed lines
  Added in v.1.65

CVSweb