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

Diff for /mandoc/man_validate.c between version 1.110 and 1.112

version 1.110, 2015/02/06 07:13:14 version 1.112, 2015/02/06 09:38:43
Line 38 
Line 38 
   
 typedef void    (*v_check)(CHKARGS);  typedef void    (*v_check)(CHKARGS);
   
 static  void      check_eq0(CHKARGS);  
 static  void      check_eq2(CHKARGS);  static  void      check_eq2(CHKARGS);
 static  void      check_le1(CHKARGS);  
 static  void      check_le5(CHKARGS);  static  void      check_le5(CHKARGS);
 static  void      check_par(CHKARGS);  static  void      check_par(CHKARGS);
 static  void      check_part(CHKARGS);  static  void      check_part(CHKARGS);
Line 86  static v_check man_valids[MAN_MAX] = {
Line 84  static v_check man_valids[MAN_MAX] = {
         check_part, /* RS */          check_part, /* RS */
         NULL,       /* DT */          NULL,       /* DT */
         post_UC,    /* UC */          post_UC,    /* UC */
         check_le1,  /* PD */          NULL,       /* PD */
         post_AT,    /* AT */          post_AT,    /* AT */
         NULL,       /* in */          NULL,       /* in */
         post_ft,    /* ft */          post_ft,    /* ft */
Line 182  check_##name(CHKARGS) \
Line 180  check_##name(CHKARGS) \
             #ineq, (x), n->nchild); \              #ineq, (x), n->nchild); \
 }  }
   
 INEQ_DEFINE(0, ==, eq0)  
 INEQ_DEFINE(2, ==, eq2)  INEQ_DEFINE(2, ==, eq2)
 INEQ_DEFINE(1, <=, le1)  
 INEQ_DEFINE(5, <=, le5)  INEQ_DEFINE(5, <=, le5)
   
 static void  static void
Line 242  post_ft(CHKARGS)
Line 238  post_ft(CHKARGS)
                     n->line, n->pos, "ft %s", cp);                      n->line, n->pos, "ft %s", cp);
                 *cp = '\0';                  *cp = '\0';
         }          }
   
         if (1 < n->nchild)  
                 mandoc_vmsg(MANDOCERR_ARGCOUNT, man->parse, n->line,  
                     n->pos, "want one child (have %d)", n->nchild);  
 }  }
   
 static void  static void
Line 401  static void
Line 393  static void
 post_nf(CHKARGS)  post_nf(CHKARGS)
 {  {
   
         check_eq0(man, n);          if (man->flags & MAN_LITERAL)
   
         if (MAN_LITERAL & man->flags)  
                 mandoc_msg(MANDOCERR_NF_SKIP, man->parse,                  mandoc_msg(MANDOCERR_NF_SKIP, man->parse,
                     n->line, n->pos, "nf");                      n->line, n->pos, "nf");
   
Line 414  static void
Line 404  static void
 post_fi(CHKARGS)  post_fi(CHKARGS)
 {  {
   
         check_eq0(man, n);  
   
         if ( ! (MAN_LITERAL & man->flags))          if ( ! (MAN_LITERAL & man->flags))
                 mandoc_msg(MANDOCERR_FI_SKIP, man->parse,                  mandoc_msg(MANDOCERR_FI_SKIP, man->parse,
                     n->line, n->pos, "fi");                      n->line, n->pos, "fi");
Line 500  post_AT(CHKARGS)
Line 488  post_AT(CHKARGS)
 static void  static void
 post_vs(CHKARGS)  post_vs(CHKARGS)
 {  {
   
         if (n->tok == MAN_br)  
                 check_eq0(man, n);  
         else  
                 check_le1(man, n);  
   
         if (NULL != n->prev)          if (NULL != n->prev)
                 return;                  return;

Legend:
Removed from v.1.110  
changed lines
  Added in v.1.112

CVSweb