[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.349 and 1.354

version 1.349, 2017/07/15 16:40:29 version 1.354, 2018/02/06 16:29:57
Line 169  static const v_post __mdoc_valids[MDOC_MAX - MDOC_Dd] 
Line 169  static const v_post __mdoc_valids[MDOC_MAX - MDOC_Dd] 
         post_hyph,      /* %T */ /* FIXME: can be used outside Rs/Re. */          post_hyph,      /* %T */ /* FIXME: can be used outside Rs/Re. */
         NULL,           /* %V */          NULL,           /* %V */
         NULL,           /* Ac */          NULL,           /* Ac */
         post_delim_nb,  /* Ao */          NULL,           /* Ao */
         post_delim_nb,  /* Aq */          post_delim_nb,  /* Aq */
         post_at,        /* At */          post_at,        /* At */
         NULL,           /* Bc */          NULL,           /* Bc */
         post_bf,        /* Bf */          post_bf,        /* Bf */
         post_delim_nb,  /* Bo */          NULL,           /* Bo */
         NULL,           /* Bq */          NULL,           /* Bq */
         post_xx,        /* Bsx */          post_xx,        /* Bsx */
         post_bx,        /* Bx */          post_bx,        /* Bx */
Line 194  static const v_post __mdoc_valids[MDOC_MAX - MDOC_Dd] 
Line 194  static const v_post __mdoc_valids[MDOC_MAX - MDOC_Dd] 
         post_xx,        /* Ox */          post_xx,        /* Ox */
         NULL,           /* Pc */          NULL,           /* Pc */
         NULL,           /* Pf */          NULL,           /* Pf */
         post_delim_nb,  /* Po */          NULL,           /* Po */
         post_delim_nb,  /* Pq */          post_delim_nb,  /* Pq */
         NULL,           /* Qc */          NULL,           /* Qc */
         post_delim_nb,  /* Ql */          post_delim_nb,  /* Ql */
         post_delim_nb,  /* Qo */          NULL,           /* Qo */
         post_delim_nb,  /* Qq */          post_delim_nb,  /* Qq */
         NULL,           /* Re */          NULL,           /* Re */
         post_rs,        /* Rs */          post_rs,        /* Rs */
         NULL,           /* Sc */          NULL,           /* Sc */
         post_delim_nb,  /* So */          NULL,           /* So */
         post_delim_nb,  /* Sq */          post_delim_nb,  /* Sq */
         post_sm,        /* Sm */          post_sm,        /* Sm */
         post_sx,        /* Sx */          post_sx,        /* Sx */
Line 214  static const v_post __mdoc_valids[MDOC_MAX - MDOC_Dd] 
Line 214  static const v_post __mdoc_valids[MDOC_MAX - MDOC_Dd] 
         NULL,           /* Xo */          NULL,           /* Xo */
         post_fo,        /* Fo */          post_fo,        /* Fo */
         NULL,           /* Fc */          NULL,           /* Fc */
         post_delim_nb,  /* Oo */          NULL,           /* Oo */
         NULL,           /* Oc */          NULL,           /* Oc */
         post_bk,        /* Bk */          post_bk,        /* Bk */
         NULL,           /* Ek */          NULL,           /* Ek */
Line 227  static const v_post __mdoc_valids[MDOC_MAX - MDOC_Dd] 
Line 227  static const v_post __mdoc_valids[MDOC_MAX - MDOC_Dd] 
         post_delim_nb,  /* Lk */          post_delim_nb,  /* Lk */
         post_defaults,  /* Mt */          post_defaults,  /* Mt */
         post_delim_nb,  /* Brq */          post_delim_nb,  /* Brq */
         post_delim_nb,  /* Bro */          NULL,           /* Bro */
         NULL,           /* Brc */          NULL,           /* Brc */
         NULL,           /* %C */          NULL,           /* %C */
         post_es,        /* Es */          post_es,        /* Es */
Line 530  post_delim_nb(POST_ARGS)
Line 530  post_delim_nb(POST_ARGS)
   
         /* At least three alphabetic words with a sentence ending. */          /* At least three alphabetic words with a sentence ending. */
         if (strchr("!.:?", *lc) != NULL && (tok == MDOC_Em ||          if (strchr("!.:?", *lc) != NULL && (tok == MDOC_Em ||
             tok == MDOC_Li || tok == MDOC_Po || tok == MDOC_Pq ||              tok == MDOC_Li || tok == MDOC_Pq || tok == MDOC_Sy)) {
             tok == MDOC_Sy)) {  
                 nw = 0;                  nw = 0;
                 for (cp = lc - 1; cp >= nch->string; cp--) {                  for (cp = lc - 1; cp >= nch->string; cp--) {
                         if (*cp == ' ') {                          if (*cp == ' ') {
Line 1137  post_fname(POST_ARGS)
Line 1136  post_fname(POST_ARGS)
         if ( ! (cp[0] == '\0' || (cp[0] == '(' && cp[1] == '*')))          if ( ! (cp[0] == '\0' || (cp[0] == '(' && cp[1] == '*')))
                 mandoc_msg(MANDOCERR_FN_PAREN, mdoc->parse,                  mandoc_msg(MANDOCERR_FN_PAREN, mdoc->parse,
                     n->line, n->pos + pos, n->string);                      n->line, n->pos + pos, n->string);
         if (n->sec == SEC_SYNOPSIS && mdoc->meta.msec != NULL)  
                 mandoc_xr_add(mdoc->meta.msec, n->string, -1, -1);  
 }  }
   
 static void  static void
Line 1205  post_nm(POST_ARGS)
Line 1202  post_nm(POST_ARGS)
   
         n = mdoc->last;          n = mdoc->last;
   
         if ((n->sec == SEC_NAME || n->sec == SEC_SYNOPSIS) &&          if (n->sec == SEC_NAME && n->child != NULL &&
             n->child != NULL && n->child->type == ROFFT_TEXT &&              n->child->type == ROFFT_TEXT && mdoc->meta.msec != NULL)
             mdoc->meta.msec != NULL)  
                 mandoc_xr_add(mdoc->meta.msec, n->child->string, -1, -1);                  mandoc_xr_add(mdoc->meta.msec, n->child->string, -1, -1);
   
         if (n->last != NULL &&          if (n->last != NULL &&
Line 1423  post_xx(POST_ARGS)
Line 1419  post_xx(POST_ARGS)
 {  {
         struct roff_node        *n;          struct roff_node        *n;
         const char              *os;          const char              *os;
           char                    *v;
   
         post_delim_nb(mdoc);          post_delim_nb(mdoc);
   
Line 1439  post_xx(POST_ARGS)
Line 1436  post_xx(POST_ARGS)
                 break;                  break;
         case MDOC_Nx:          case MDOC_Nx:
                 os = "NetBSD";                  os = "NetBSD";
                   if (n->child == NULL)
                           break;
                   v = n->child->string;
                   if ((v[0] != '0' && v[0] != '1') || v[1] != '.' ||
                       v[2] < '0' || v[2] > '9' ||
                       v[3] < 'a' || v[3] > 'z' || v[4] != '\0')
                           break;
                   n->child->flags |= NODE_NOPRT;
                   mdoc->next = ROFF_NEXT_CHILD;
                   roff_word_alloc(mdoc, n->child->line, n->child->pos, v);
                   v = mdoc->last->string;
                   v[3] = toupper((unsigned char)v[3]);
                   mdoc->last->flags |= NODE_NOSRC;
                   mdoc->last = n;
                 break;                  break;
         case MDOC_Ox:          case MDOC_Ox:
                 os = "OpenBSD";                  os = "OpenBSD";
Line 1902  post_root(POST_ARGS)
Line 1913  post_root(POST_ARGS)
                         arch++;                          arch++;
                 if (*arch == NULL) {                  if (*arch == NULL) {
                         n = mdoc->first->child;                          n = mdoc->first->child;
                         while (n->tok != MDOC_Dt)                          while (n->tok != MDOC_Dt ||
                               n->child == NULL ||
                               n->child->next == NULL ||
                               n->child->next->next == NULL)
                                 n = n->next;                                  n = n->next;
                         n = n->child->next->next;                          n = n->child->next->next;
                         mandoc_vmsg(MANDOCERR_ARCH_BAD,                          mandoc_vmsg(MANDOCERR_ARCH_BAD,
Line 1916  post_root(POST_ARGS)
Line 1930  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->first->child;
         while (n != NULL && n->tok != TOKEN_NONE &&          while (n != NULL && n->tok >= MDOC_Dd &&
             mdoc_macros[n->tok].flags & MDOC_PROLOGUE)              mdoc_macros[n->tok].flags & MDOC_PROLOGUE)
                 n = n->next;                  n = n->next;
   

Legend:
Removed from v.1.349  
changed lines
  Added in v.1.354

CVSweb