[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.365 and 1.370

version 1.365, 2018/12/14 05:18:02 version 1.370, 2019/03/04 11:40:09
Line 288  static const char * const secnames[SEC__MAX] = {
Line 288  static const char * const secnames[SEC__MAX] = {
   
 /* Validate the subtree rooted at mdoc->last. */  /* Validate the subtree rooted at mdoc->last. */
 void  void
 mdoc_node_validate(struct roff_man *mdoc)  mdoc_validate(struct roff_man *mdoc)
 {  {
         struct roff_node *n, *np;          struct roff_node *n, *np;
         const v_post *p;          const v_post *p;
Line 319  mdoc_node_validate(struct roff_man *mdoc)
Line 319  mdoc_node_validate(struct roff_man *mdoc)
   
         mdoc->last = mdoc->last->child;          mdoc->last = mdoc->last->child;
         while (mdoc->last != NULL) {          while (mdoc->last != NULL) {
                 mdoc_node_validate(mdoc);                  mdoc_validate(mdoc);
                 if (mdoc->last == n)                  if (mdoc->last == n)
                         mdoc->last = mdoc->last->child;                          mdoc->last = mdoc->last->child;
                 else                  else
Line 336  mdoc_node_validate(struct roff_man *mdoc)
Line 336  mdoc_node_validate(struct roff_man *mdoc)
                 if (n->sec != SEC_SYNOPSIS ||                  if (n->sec != SEC_SYNOPSIS ||
                     (np->tok != MDOC_Cd && np->tok != MDOC_Fd))                      (np->tok != MDOC_Cd && np->tok != MDOC_Fd))
                         check_text(mdoc, n->line, n->pos, n->string);                          check_text(mdoc, n->line, n->pos, n->string);
                 if (np->tok != MDOC_Ql && np->tok != MDOC_Dl &&                  if ((n->flags & NODE_NOFILL) == 0 &&
                     (np->tok != MDOC_Bd ||  
                      (mdoc->flags & MDOC_LITERAL) == 0) &&  
                     (np->tok != MDOC_It || np->type != ROFFT_HEAD ||                      (np->tok != MDOC_It || np->type != ROFFT_HEAD ||
                      np->parent->parent->norm->Bl.type != LIST_diag))                       np->parent->parent->norm->Bl.type != LIST_diag))
                         check_text_em(mdoc, n->line, n->pos, n->string);                          check_text_em(mdoc, n->line, n->pos, n->string);
Line 411  check_text(struct roff_man *mdoc, int ln, int pos, cha
Line 409  check_text(struct roff_man *mdoc, int ln, int pos, cha
 {  {
         char            *cp;          char            *cp;
   
         if (MDOC_LITERAL & mdoc->flags)          if (mdoc->last->flags & NODE_NOFILL)
                 return;                  return;
   
         for (cp = p; NULL != (p = strchr(p, '\t')); p++)          for (cp = p; NULL != (p = strchr(p, '\t')); p++)
Line 1583  post_it(POST_ARGS)
Line 1581  post_it(POST_ARGS)
                         mandoc_msg(MANDOCERR_BL_COL, nit->line, nit->pos,                          mandoc_msg(MANDOCERR_BL_COL, nit->line, nit->pos,
                             "%d columns, %d cells", cols, i);                              "%d columns, %d cells", cols, i);
                 else if (nit->head->next->child != NULL &&                  else if (nit->head->next->child != NULL &&
                     nit->head->next->child->line > nit->line)                      nit->head->next->child->flags & NODE_LINE)
                         mandoc_msg(MANDOCERR_IT_NOARG,                          mandoc_msg(MANDOCERR_IT_NOARG,
                             nit->line, nit->pos, "Bl -column It");                              nit->line, nit->pos, "Bl -column It");
                 break;                  break;
Line 1952  post_root(POST_ARGS)
Line 1950  post_root(POST_ARGS)
                 while (*arch != NULL && strcmp(*arch, mdoc->meta.arch))                  while (*arch != NULL && strcmp(*arch, mdoc->meta.arch))
                         arch++;                          arch++;
                 if (*arch == NULL) {                  if (*arch == NULL) {
                         n = mdoc->first->child;                          n = mdoc->meta.first->child;
                         while (n->tok != MDOC_Dt ||                          while (n->tok != MDOC_Dt ||
                             n->child == NULL ||                              n->child == NULL ||
                             n->child->next == NULL ||                              n->child->next == NULL ||
Line 1968  post_root(POST_ARGS)
Line 1966  post_root(POST_ARGS)
   
         /* Check that we begin with a proper `Sh'. */          /* Check that we begin with a proper `Sh'. */
   
         n = mdoc->first->child;          n = mdoc->meta.first->child;
         while (n != NULL &&          while (n != NULL &&
             (n->type == ROFFT_COMMENT ||              (n->type == ROFFT_COMMENT ||
              (n->tok >= MDOC_Dd &&               (n->tok >= MDOC_Dd &&

Legend:
Removed from v.1.365  
changed lines
  Added in v.1.370

CVSweb