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

Diff for /mandoc/Attic/validate.c between version 1.63 and 1.64

version 1.63, 2009/02/27 09:39:40 version 1.64, 2009/02/28 13:47:36
Line 36 
Line 36 
 typedef int     (*v_pre)(PRE_ARGS);  typedef int     (*v_pre)(PRE_ARGS);
 typedef int     (*v_post)(POST_ARGS);  typedef int     (*v_post)(POST_ARGS);
   
 /* FIXME: some sections should only occur in specific msecs. */  /* TODO: ignoring Pp (it's superfluous in some invocations). */
 /* FIXME: ignoring Pp. */  
 /* FIXME: math symbols. */  
   
 struct  valids {  struct  valids {
         v_pre   *pre;          v_pre   *pre;
Line 626  pre_bl(PRE_ARGS)
Line 624  pre_bl(PRE_ARGS)
                                 "superfluous -%s argument",                                  "superfluous -%s argument",
                                 mdoc_argnames[MDOC_Width]));                                  mdoc_argnames[MDOC_Width]));
         case (MDOC_Tag):          case (MDOC_Tag):
                 if (-1 != width)                  if (-1 == width && ! mdoc_nwarn(mdoc, n, WARN_SYNTAX,
                         break;                                          "suggest -%s argument",
                 return(mdoc_nwarn(mdoc, n, WARN_SYNTAX,                                          mdoc_argnames[MDOC_Width]))
                                 "suggest -%s argument",                          return(0);
                                 mdoc_argnames[MDOC_Width]));                  break;
         default:          default:
                 break;                  break;
         }          }
Line 706  static int
Line 704  static int
 pre_it(PRE_ARGS)  pre_it(PRE_ARGS)
 {  {
   
         /* TODO: children too big for -width? */  
   
         if (MDOC_BLOCK != n->type)          if (MDOC_BLOCK != n->type)
                 return(1);                  return(1);
         return(check_parent(mdoc, n, MDOC_Bl, MDOC_BODY));          return(check_parent(mdoc, n, MDOC_Bl, MDOC_BODY));
Line 1056  post_bl(POST_ARGS)
Line 1052  post_bl(POST_ARGS)
   
         if (MDOC_BODY != mdoc->last->type)          if (MDOC_BODY != mdoc->last->type)
                 return(1);                  return(1);
           if (NULL == (mdoc->last->child))
                   return(1);
   
           /*
            * Only allow `It' macros to be the immediate descendants of the
            * `Bl' list.
            */
   
         /* 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)
                         if (MDOC_It == n->tok)                          if (MDOC_It == n->tok)
                                 continue;                                  continue;
                 break;  
                   return(mdoc_nerr(mdoc, n, "bad child of parent %s",
                                   mdoc_macronames[mdoc->last->tok]));
         }          }
   
         if (NULL == n)          return(1);
                 return(1);  
   
         return(mdoc_nerr(mdoc, n, "bad child of parent list"));  
 }  }
   
   

Legend:
Removed from v.1.63  
changed lines
  Added in v.1.64

CVSweb