[BACK]Return to mdoc_validate.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / mandoc

Diff for /src/usr.bin/mandoc/mdoc_validate.c between version 1.83 and 1.84

version 1.83, 2011/01/03 23:39:27 version 1.84, 2011/01/04 22:28:17
Line 1 
Line 1 
 /*      $Id$ */  /*      $Id$ */
 /*  /*
  * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>   * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
  *   *
  * Permission to use, copy, modify, and distribute this software for any   * Permission to use, copy, modify, and distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above   * purpose with or without fee is hereby granted, provided that the above
Line 32 
Line 32 
 #include "libmdoc.h"  #include "libmdoc.h"
 #include "libmandoc.h"  #include "libmandoc.h"
   
 #include "out.h"  
 #include "term.h"  
 #include "tbl.h"  
   
 /* FIXME: .Bl -diag can't have non-text children in HEAD. */  /* FIXME: .Bl -diag can't have non-text children in HEAD. */
   
 #define PRE_ARGS  struct mdoc *mdoc, struct mdoc_node *n  #define PRE_ARGS  struct mdoc *mdoc, struct mdoc_node *n
Line 127 
Line 123 
 static  int      pre_sh(PRE_ARGS);  static  int      pre_sh(PRE_ARGS);
 static  int      pre_ss(PRE_ARGS);  static  int      pre_ss(PRE_ARGS);
 static  int      pre_std(PRE_ARGS);  static  int      pre_std(PRE_ARGS);
 static  int      pre_ts(PRE_ARGS);  
   
 static  v_post   posts_an[] = { post_an, NULL };  static  v_post   posts_an[] = { post_an, NULL };
 static  v_post   posts_at[] = { post_at, post_defaults, NULL };  static  v_post   posts_at[] = { post_at, post_defaults, NULL };
Line 174 
Line 169 
 static  v_pre    pres_sh[] = { pre_sh, NULL };  static  v_pre    pres_sh[] = { pre_sh, NULL };
 static  v_pre    pres_ss[] = { pre_ss, NULL };  static  v_pre    pres_ss[] = { pre_ss, NULL };
 static  v_pre    pres_std[] = { pre_std, NULL };  static  v_pre    pres_std[] = { pre_std, NULL };
 static  v_pre    pres_ts[] = { pre_ts, NULL };  
   
 const   struct valids mdoc_valids[MDOC_MAX] = {  const   struct valids mdoc_valids[MDOC_MAX] = {
         { NULL, NULL },                         /* Ap */          { NULL, NULL },                         /* Ap */
Line 299 
Line 293 
         { pres_pp, posts_sp },                  /* sp */          { pres_pp, posts_sp },                  /* sp */
         { NULL, posts_text1 },                  /* %U */          { NULL, posts_text1 },                  /* %U */
         { NULL, NULL },                         /* Ta */          { NULL, NULL },                         /* Ta */
         { pres_ts, NULL },                      /* TS */  
         { NULL, NULL },                         /* TE */  
 };  };
   
 #define RSORD_MAX 14 /* Number of `Rs' blocks. */  #define RSORD_MAX 14 /* Number of `Rs' blocks. */
Line 330 
Line 322 
         int              line, pos;          int              line, pos;
         char            *tp;          char            *tp;
   
         if (MDOC_TEXT == n->type) {          switch (n->type) {
           case (MDOC_TEXT):
                 tp = n->string;                  tp = n->string;
                 line = n->line;                  line = n->line;
                 pos = n->pos;                  pos = n->pos;
                 check_text(mdoc, line, pos, tp);                  check_text(mdoc, line, pos, tp);
                   /* FALLTHROUGH */
           case (MDOC_TBL):
                   /* FALLTHROUGH */
           case (MDOC_ROOT):
                 return(1);                  return(1);
           default:
                   break;
         }          }
   
         check_args(mdoc, n);          check_args(mdoc, n);
Line 358 
Line 357 
                 return(1);                  return(1);
         mdoc->last->flags |= MDOC_VALID;          mdoc->last->flags |= MDOC_VALID;
   
         if (MDOC_TEXT == mdoc->last->type)          switch (mdoc->last->type) {
           case (MDOC_TEXT):
                   /* FALLTHROUGH */
           case (MDOC_TBL):
                 return(1);                  return(1);
         if (MDOC_ROOT == mdoc->last->type)          case (MDOC_ROOT):
                 return(post_root(mdoc));                  return(post_root(mdoc));
           default:
                   break;
           }
   
         if (NULL == mdoc_valids[mdoc->last->tok].post)          if (NULL == mdoc_valids[mdoc->last->tok].post)
                 return(1);                  return(1);
Line 1892 
Line 1897 
                         mdoc_nmsg(mdoc, np, MANDOCERR_IGNPAR);                          mdoc_nmsg(mdoc, np, MANDOCERR_IGNPAR);
                         mdoc_node_delete(mdoc, np);                          mdoc_node_delete(mdoc, np);
                 }                  }
   
         return(1);  
 }  
   
 static int  
 pre_ts(PRE_ARGS)  
 {  
   
         if (MDOC_BLOCK == mdoc->last->type)  
                 mdoc->last->norm->TS = tbl_alloc();  
   
         return(1);          return(1);
 }  }

Legend:
Removed from v.1.83  
changed lines
  Added in v.1.84