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

Diff for /mandoc/mdoc_macro.c between version 1.131 and 1.144

version 1.131, 2014/04/20 16:46:05 version 1.144, 2014/11/17 06:44:58
Line 1 
Line 1 
 /*      $Id$ */  /*      $Id$ */
 /*  /*
  * Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>   * Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
  * Copyright (c) 2010, 2012, 2013 Ingo Schwarze <schwarze@openbsd.org>   * Copyright (c) 2010, 2012, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org>
  *   *
  * 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 15 
Line 15 
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF   * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.   * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */   */
 #ifdef HAVE_CONFIG_H  
 #include "config.h"  #include "config.h"
 #endif  
   
   #include <sys/types.h>
   
 #include <assert.h>  #include <assert.h>
 #include <ctype.h>  #include <ctype.h>
 #include <stdlib.h>  #include <stdlib.h>
Line 48  static int  ctx_synopsis(MACRO_PROT_ARGS);
Line 48  static int  ctx_synopsis(MACRO_PROT_ARGS);
 static  int             in_line_eoln(MACRO_PROT_ARGS);  static  int             in_line_eoln(MACRO_PROT_ARGS);
 static  int             in_line_argn(MACRO_PROT_ARGS);  static  int             in_line_argn(MACRO_PROT_ARGS);
 static  int             in_line(MACRO_PROT_ARGS);  static  int             in_line(MACRO_PROT_ARGS);
 static  int             obsolete(MACRO_PROT_ARGS);  
 static  int             phrase_ta(MACRO_PROT_ARGS);  static  int             phrase_ta(MACRO_PROT_ARGS);
   
 static  int             dword(struct mdoc *, int, int, const char *,  static  int             dword(struct mdoc *, int, int, const char *,
Line 104  const struct mdoc_macro __mdoc_macros[MDOC_MAX] = {
Line 103  const struct mdoc_macro __mdoc_macros[MDOC_MAX] = {
         { blk_full, MDOC_JOIN }, /* Nd */          { blk_full, MDOC_JOIN }, /* Nd */
         { ctx_synopsis, MDOC_CALLABLE | MDOC_PARSED }, /* Nm */          { ctx_synopsis, MDOC_CALLABLE | MDOC_PARSED }, /* Nm */
         { blk_part_imp, MDOC_CALLABLE | MDOC_PARSED }, /* Op */          { blk_part_imp, MDOC_CALLABLE | MDOC_PARSED }, /* Op */
         { obsolete, 0 }, /* Ot */          { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Ot */
         { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Pa */          { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Pa */
         { in_line_eoln, 0 }, /* Rv */          { in_line_eoln, 0 }, /* Rv */
         { in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* St */          { in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* St */
Line 148  const struct mdoc_macro __mdoc_macros[MDOC_MAX] = {
Line 147  const struct mdoc_macro __mdoc_macros[MDOC_MAX] = {
         { blk_part_exp, MDOC_CALLABLE | MDOC_PARSED | MDOC_EXPLICIT }, /* Eo */          { blk_part_exp, MDOC_CALLABLE | MDOC_PARSED | MDOC_EXPLICIT }, /* Eo */
         { in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* Fx */          { in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* Fx */
         { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Ms */          { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Ms */
           { in_line, MDOC_CALLABLE | MDOC_PARSED | MDOC_JOIN }, /* No */
         { in_line_argn, MDOC_CALLABLE | MDOC_PARSED |          { in_line_argn, MDOC_CALLABLE | MDOC_PARSED |
                         MDOC_IGNDELIM | MDOC_JOIN }, /* No */  
         { in_line_argn, MDOC_CALLABLE | MDOC_PARSED |  
                         MDOC_IGNDELIM | MDOC_JOIN }, /* Ns */                          MDOC_IGNDELIM | MDOC_JOIN }, /* Ns */
         { in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* Nx */          { in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* Nx */
         { in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* Ox */          { in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* Ox */
Line 191  const struct mdoc_macro __mdoc_macros[MDOC_MAX] = {
Line 189  const struct mdoc_macro __mdoc_macros[MDOC_MAX] = {
         { blk_exp_close, MDOC_EXPLICIT | MDOC_JOIN }, /* Ek */          { blk_exp_close, MDOC_EXPLICIT | MDOC_JOIN }, /* Ek */
         { in_line_eoln, 0 }, /* Bt */          { in_line_eoln, 0 }, /* Bt */
         { in_line_eoln, 0 }, /* Hf */          { in_line_eoln, 0 }, /* Hf */
         { obsolete, 0 }, /* Fr */          { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Fr */
         { in_line_eoln, 0 }, /* Ud */          { in_line_eoln, 0 }, /* Ud */
         { in_line, 0 }, /* Lb */          { in_line, 0 }, /* Lb */
         { in_line_eoln, 0 }, /* Lp */          { in_line_eoln, 0 }, /* Lp */
Line 203  const struct mdoc_macro __mdoc_macros[MDOC_MAX] = {
Line 201  const struct mdoc_macro __mdoc_macros[MDOC_MAX] = {
         { blk_exp_close, MDOC_CALLABLE | MDOC_PARSED |          { blk_exp_close, MDOC_CALLABLE | MDOC_PARSED |
                          MDOC_EXPLICIT | MDOC_JOIN }, /* Brc */                           MDOC_EXPLICIT | MDOC_JOIN }, /* Brc */
         { in_line_eoln, MDOC_JOIN }, /* %C */          { in_line_eoln, MDOC_JOIN }, /* %C */
         { obsolete, 0 }, /* Es */          { in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* Es */
         { obsolete, 0 }, /* En */          { blk_part_imp, MDOC_CALLABLE | MDOC_PARSED | MDOC_JOIN }, /* En */
         { in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* Dx */          { in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* Dx */
         { in_line_eoln, MDOC_JOIN }, /* %Q */          { in_line_eoln, MDOC_JOIN }, /* %Q */
         { in_line_eoln, 0 }, /* br */          { in_line_eoln, 0 }, /* br */
         { in_line_eoln, 0 }, /* sp */          { in_line_eoln, 0 }, /* sp */
         { in_line_eoln, 0 }, /* %U */          { in_line_eoln, 0 }, /* %U */
         { phrase_ta, MDOC_CALLABLE | MDOC_PARSED | MDOC_JOIN }, /* Ta */          { phrase_ta, MDOC_CALLABLE | MDOC_PARSED | MDOC_JOIN }, /* Ta */
         { in_line_eoln, 0 }, /* ll */          { in_line_eoln, MDOC_PROLOGUE }, /* ll */
 };  };
   
 const   struct mdoc_macro * const mdoc_macros = __mdoc_macros;  const   struct mdoc_macro * const mdoc_macros = __mdoc_macros;
Line 235  mdoc_macroend(struct mdoc *mdoc)
Line 233  mdoc_macroend(struct mdoc *mdoc)
         for ( ; n; n = n->parent)          for ( ; n; n = n->parent)
                 if (MDOC_BLOCK == n->type &&                  if (MDOC_BLOCK == n->type &&
                     MDOC_EXPLICIT & mdoc_macros[n->tok].flags)                      MDOC_EXPLICIT & mdoc_macros[n->tok].flags)
                         mdoc_nmsg(mdoc, n, MANDOCERR_SCOPEEXIT);                          mandoc_msg(MANDOCERR_BLK_NOEND, mdoc->parse,
                               n->line, n->pos, mdoc_macronames[n->tok]);
   
         /* Rewind to the first. */          /* Rewind to the first. */
   
Line 424  rew_dohalt(enum mdoct tok, enum mdoc_type type,
Line 423  rew_dohalt(enum mdoct tok, enum mdoc_type type,
                         return(REWIND_NONE);                          return(REWIND_NONE);
                 /* FALLTHROUGH */                  /* FALLTHROUGH */
         case MDOC_Sh:          case MDOC_Sh:
                   if (MDOC_ROOT == p->parent->type)
                           return(REWIND_THIS);
                 if (MDOC_Nd == p->tok || MDOC_Ss == p->tok ||                  if (MDOC_Nd == p->tok || MDOC_Ss == p->tok ||
                     MDOC_Sh == p->tok)                      MDOC_Sh == p->tok)
                         return(REWIND_MORE);                          return(REWIND_MORE);
Line 529  make_pending(struct mdoc_node *broken, enum mdoct tok,
Line 530  make_pending(struct mdoc_node *broken, enum mdoct tok,
                         taker->pending = broken->pending;                          taker->pending = broken->pending;
                 }                  }
                 broken->pending = breaker;                  broken->pending = breaker;
                 mandoc_vmsg(MANDOCERR_SCOPENEST, mdoc->parse, line, ppos,                  mandoc_vmsg(MANDOCERR_BLK_NEST, mdoc->parse, line, ppos,
                     "%s breaks %s", mdoc_macronames[tok],                      "%s breaks %s", mdoc_macronames[tok],
                     mdoc_macronames[broken->tok]);                      mdoc_macronames[broken->tok]);
                 return(1);                  return(1);
Line 559  rew_sub(enum mdoc_type t, struct mdoc *mdoc,
Line 560  rew_sub(enum mdoc_type t, struct mdoc *mdoc,
                              ! (MDOC_EXPLICIT & mdoc_macros[tok].flags));                               ! (MDOC_EXPLICIT & mdoc_macros[tok].flags));
                         break;                          break;
                 case REWIND_FORCE:                  case REWIND_FORCE:
                         mandoc_vmsg(MANDOCERR_SCOPEBROKEN, mdoc->parse,                          mandoc_vmsg(MANDOCERR_BLK_BROKEN, mdoc->parse,
                             line, ppos, "%s breaks %s",                              line, ppos, "%s breaks %s",
                             mdoc_macronames[tok],                              mdoc_macronames[tok],
                             mdoc_macronames[n->tok]);                              mdoc_macronames[n->tok]);
Line 575  rew_sub(enum mdoc_type t, struct mdoc *mdoc,
Line 576  rew_sub(enum mdoc_type t, struct mdoc *mdoc,
                                 return(1);                                  return(1);
                         /* FALLTHROUGH */                          /* FALLTHROUGH */
                 case REWIND_ERROR:                  case REWIND_ERROR:
                         mdoc_pmsg(mdoc, line, ppos, MANDOCERR_NOSCOPE);                          mandoc_msg(MANDOCERR_BLK_NOTOPEN,
                               mdoc->parse, line, ppos,
                               mdoc_macronames[tok]);
                         return(1);                          return(1);
                 }                  }
                 break;                  break;
Line 623  dword(struct mdoc *mdoc, int line, int col, const char
Line 626  dword(struct mdoc *mdoc, int line, int col, const char
         if ( ! mdoc_word_alloc(mdoc, line, col, p))          if ( ! mdoc_word_alloc(mdoc, line, col, p))
                 return(0);                  return(0);
   
         if (DELIM_OPEN == d)  
                 mdoc->last->flags |= MDOC_DELIMO;  
   
         /*          /*
          * Closing delimiters only suppress the preceding space           * If the word consists of a bare delimiter,
          * when they follow something, not when they start a new           * flag the new node accordingly,
          * block or element, and not when they follow `No'.           * unless doing so was vetoed by the invoking macro.
          *           * Always clear the veto, it is only valid for one word.
          * XXX  Explicitly special-casing MDOC_No here feels  
          *      like a layering violation.  Find a better way  
          *      and solve this in the code related to `No'!  
          */           */
   
         else if (DELIM_CLOSE == d && mdoc->last->prev &&          if (d == DELIM_OPEN)
             mdoc->last->prev->tok != MDOC_No &&                  mdoc->last->flags |= MDOC_DELIMO;
           else if (d == DELIM_CLOSE &&
               ! (mdoc->flags & MDOC_NODELIMC) &&
             mdoc->last->parent->tok != MDOC_Fd)              mdoc->last->parent->tok != MDOC_Fd)
                 mdoc->last->flags |= MDOC_DELIMC;                  mdoc->last->flags |= MDOC_DELIMC;
   
           mdoc->flags &= ~MDOC_NODELIMC;
   
         return(1);          return(1);
 }  }
   
Line 770  blk_exp_close(MACRO_PROT_ARGS)
Line 771  blk_exp_close(MACRO_PROT_ARGS)
                         later = n;                          later = n;
         }          }
   
         if ( ! (MDOC_CALLABLE & mdoc_macros[tok].flags)) {          if ( ! (MDOC_PARSED & mdoc_macros[tok].flags)) {
                 /* FIXME: do this in validate */                  if ('\0' != buf[*pos])
                 if (buf[*pos])                          mandoc_vmsg(MANDOCERR_ARG_SKIP,
                         mdoc_pmsg(mdoc, line, ppos, MANDOCERR_ARGSLOST);                              mdoc->parse, line, ppos,
                               "%s %s", mdoc_macronames[tok],
                               buf + *pos);
                 if ( ! rew_sub(MDOC_BODY, mdoc, tok, line, ppos))                  if ( ! rew_sub(MDOC_BODY, mdoc, tok, line, ppos))
                         return(0);                          return(0);
                 return(rew_sub(MDOC_BLOCK, mdoc, tok, line, ppos));                  return(rew_sub(MDOC_BLOCK, mdoc, tok, line, ppos));
Line 838  blk_exp_close(MACRO_PROT_ARGS)
Line 840  blk_exp_close(MACRO_PROT_ARGS)
 static int  static int
 in_line(MACRO_PROT_ARGS)  in_line(MACRO_PROT_ARGS)
 {  {
         int              la, scope, cnt, nc, nl;          int              la, scope, cnt, firstarg, mayopen, nc, nl;
         enum margverr    av;          enum margverr    av;
         enum mdoct       ntok;          enum mdoct       ntok;
         enum margserr    ac;          enum margserr    ac;
Line 889  in_line(MACRO_PROT_ARGS)
Line 891  in_line(MACRO_PROT_ARGS)
                 return(0);                  return(0);
         }          }
   
           d = DELIM_NONE;
           firstarg = 1;
           mayopen = 1;
         for (cnt = scope = 0;; ) {          for (cnt = scope = 0;; ) {
                 la = *pos;                  la = *pos;
                 ac = mdoc_args(mdoc, line, pos, buf, tok, &p);                  ac = mdoc_args(mdoc, line, pos, buf, tok, &p);
   
                 if (ARGS_ERROR == ac)                  if (ac == ARGS_ERROR)
                         return(0);                          return(0);
                 if (ARGS_EOLN == ac)  
                   /*
                    * At the end of a macro line,
                    * opening delimiters do not suppress spacing.
                    */
   
                   if (ac == ARGS_EOLN) {
                           if (d == DELIM_OPEN)
                                   mdoc->last->flags &= ~MDOC_DELIMO;
                         break;                          break;
                 if (ARGS_PUNCT == ac)                  }
   
                   /*
                    * The rest of the macro line is only punctuation,
                    * to be handled by append_delims().
                    * If there were no other arguments,
                    * do not allow the first one to suppress spacing,
                    * even if it turns out to be a closing one.
                    */
   
                   if (ac == ARGS_PUNCT) {
                           if (cnt == 0 && nc == 0)
                                   mdoc->flags |= MDOC_NODELIMC;
                         break;                          break;
                   }
   
                 ntok = ARGS_QWORD == ac ? MDOC_MAX : lookup(tok, p);                  ntok = ARGS_QWORD == ac ? MDOC_MAX : lookup(tok, p);
   
Line 920  in_line(MACRO_PROT_ARGS)
Line 946  in_line(MACRO_PROT_ARGS)
                                         return(0);                                          return(0);
                         } else if ( ! nc && 0 == cnt) {                          } else if ( ! nc && 0 == cnt) {
                                 mdoc_argv_free(arg);                                  mdoc_argv_free(arg);
                                 mdoc_pmsg(mdoc, line, ppos,                                  mandoc_msg(MANDOCERR_MACRO_EMPTY,
                                     MANDOCERR_MACROEMPTY);                                      mdoc->parse, line, ppos,
                                       mdoc_macronames[tok]);
                         }                          }
   
                         if ( ! mdoc_macro(mdoc, ntok, line, la, pos, buf))                          if ( ! mdoc_macro(mdoc, ntok, line, la, pos, buf))
Line 942  in_line(MACRO_PROT_ARGS)
Line 969  in_line(MACRO_PROT_ARGS)
                 if (DELIM_NONE != d) {                  if (DELIM_NONE != d) {
                         /*                          /*
                          * If we encounter closing punctuation, no word                           * If we encounter closing punctuation, no word
                          * has been omitted, no scope is open, and we're                           * has been emitted, no scope is open, and we're
                          * allowed to have an empty element, then start                           * allowed to have an empty element, then start
                          * a new scope.  `Ar', `Fl', and `Li', only do                           * a new scope.
                          * this once per invocation.  There may be more  
                          * of these (all of them?).  
                          */                           */
                         if (0 == cnt && (nc || MDOC_Li == tok) &&                          if ((d == DELIM_CLOSE ||
                             DELIM_CLOSE == d && ! scope) {                               (d == DELIM_MIDDLE && tok == MDOC_Fl)) &&
                               !cnt && !scope && nc && mayopen) {
                                 if ( ! mdoc_elem_alloc(mdoc,                                  if ( ! mdoc_elem_alloc(mdoc,
                                     line, ppos, tok, arg))                                      line, ppos, tok, arg))
                                         return(0);                                          return(0);
                                 if (MDOC_Ar == tok || MDOC_Li == tok ||  
                                     MDOC_Fl == tok)  
                                         cnt++;  
                                 scope = 1;                                  scope = 1;
                                   cnt++;
                                   if (MDOC_Nm == tok)
                                           mayopen = 0;
                         }                          }
                         /*                          /*
                          * Close out our scope, if one is open, before                           * Close out our scope, if one is open, before
Line 965  in_line(MACRO_PROT_ARGS)
Line 991  in_line(MACRO_PROT_ARGS)
                         if (scope && ! rew_elem(mdoc, tok))                          if (scope && ! rew_elem(mdoc, tok))
                                 return(0);                                  return(0);
                         scope = 0;                          scope = 0;
                 } else if ( ! scope) {                  } else if (mayopen && !scope) {
                         if ( ! mdoc_elem_alloc(mdoc, line, ppos, tok, arg))                          if ( ! mdoc_elem_alloc(mdoc, line, ppos, tok, arg))
                                 return(0);                                  return(0);
                         scope = 1;                          scope = 1;
                           cnt++;
                 }                  }
   
                 if (DELIM_NONE == d)  
                         cnt++;  
   
                 if ( ! dword(mdoc, line, la, p, d,                  if ( ! dword(mdoc, line, la, p, d,
                     MDOC_JOIN & mdoc_macros[tok].flags))                      MDOC_JOIN & mdoc_macros[tok].flags))
                         return(0);                          return(0);
   
                 /*                  /*
                    * If the first argument is a closing delimiter,
                    * do not suppress spacing before it.
                    */
   
                   if (firstarg && d == DELIM_CLOSE && !nc)
                           mdoc->last->flags &= ~MDOC_DELIMC;
                   firstarg = 0;
   
                   /*
                  * `Fl' macros have their scope re-opened with each new                   * `Fl' macros have their scope re-opened with each new
                  * word so that the `-' can be added to each one without                   * word so that the `-' can be added to each one without
                  * having to parse out spaces.                   * having to parse out spaces.
Line 1006  in_line(MACRO_PROT_ARGS)
Line 1039  in_line(MACRO_PROT_ARGS)
                         return(0);                          return(0);
         } else if ( ! nc && 0 == cnt) {          } else if ( ! nc && 0 == cnt) {
                 mdoc_argv_free(arg);                  mdoc_argv_free(arg);
                 mdoc_pmsg(mdoc, line, ppos, MANDOCERR_MACROEMPTY);                  mandoc_msg(MANDOCERR_MACRO_EMPTY, mdoc->parse,
                       line, ppos, mdoc_macronames[tok]);
         }          }
   
         if ( ! nl)          if ( ! nl)
Line 1030  blk_full(MACRO_PROT_ARGS)
Line 1064  blk_full(MACRO_PROT_ARGS)
   
         nl = MDOC_NEWLINE & mdoc->flags;          nl = MDOC_NEWLINE & mdoc->flags;
   
           /* Skip items outside lists. */
   
           if (tok == MDOC_It) {
                   for (n = mdoc->last; n; n = n->parent)
                           if (n->tok == MDOC_Bl &&
                               ! (n->flags & MDOC_VALID))
                                   break;
                   if (n == NULL) {
                           mandoc_vmsg(MANDOCERR_IT_STRAY, mdoc->parse,
                               line, ppos, "It %s", buf + *pos);
                           if ( ! mdoc_elem_alloc(mdoc, line, ppos,
                               MDOC_br, NULL))
                                   return(0);
                           return(rew_elem(mdoc, MDOC_br));
                   }
           }
   
         /* Close out prior implicit scope. */          /* Close out prior implicit scope. */
   
         if ( ! (MDOC_EXPLICIT & mdoc_macros[tok].flags)) {          if ( ! (MDOC_EXPLICIT & mdoc_macros[tok].flags)) {
Line 1355  blk_part_imp(MACRO_PROT_ARGS)
Line 1406  blk_part_imp(MACRO_PROT_ARGS)
                         return(1);                          return(1);
                 }                  }
         }          }
           assert(n == body);
   
         /*          if ( ! rew_sub(MDOC_BODY, mdoc, tok, line, ppos))
          * If we can't rewind to our body, then our scope has already  
          * been closed by another macro (like `Oc' closing `Op').  This  
          * is ugly behaviour nodding its head to OpenBSD's overwhelming  
          * crufty use of `Op' breakage.  
          */  
         if (n != body)  
                 mandoc_vmsg(MANDOCERR_SCOPENEST, mdoc->parse, line,  
                     ppos, "%s broken", mdoc_macronames[tok]);  
   
         if (n && ! rew_sub(MDOC_BODY, mdoc, tok, line, ppos))  
                 return(0);                  return(0);
   
         /* Standard appending of delimiters. */          /* Standard appending of delimiters. */
Line 1376  blk_part_imp(MACRO_PROT_ARGS)
Line 1418  blk_part_imp(MACRO_PROT_ARGS)
   
         /* Rewind scope, if applicable. */          /* Rewind scope, if applicable. */
   
         if (n && ! rew_sub(MDOC_BLOCK, mdoc, tok, line, ppos))          if ( ! rew_sub(MDOC_BLOCK, mdoc, tok, line, ppos))
                 return(0);                  return(0);
   
         /* Move trailing .Ns out of scope. */          /* Move trailing .Ns out of scope. */
Line 1519  in_line_argn(MACRO_PROT_ARGS)
Line 1561  in_line_argn(MACRO_PROT_ARGS)
         switch (tok) {          switch (tok) {
         case MDOC_Ap:          case MDOC_Ap:
                 /* FALLTHROUGH */                  /* FALLTHROUGH */
         case MDOC_No:  
                 /* FALLTHROUGH */  
         case MDOC_Ns:          case MDOC_Ns:
                 /* FALLTHROUGH */                  /* FALLTHROUGH */
         case MDOC_Ux:          case MDOC_Ux:
Line 1528  in_line_argn(MACRO_PROT_ARGS)
Line 1568  in_line_argn(MACRO_PROT_ARGS)
                 break;                  break;
         case MDOC_Bx:          case MDOC_Bx:
                 /* FALLTHROUGH */                  /* FALLTHROUGH */
           case MDOC_Es:
                   /* FALLTHROUGH */
         case MDOC_Xr:          case MDOC_Xr:
                 maxargs = 2;                  maxargs = 2;
                 break;                  break;
Line 1572  in_line_argn(MACRO_PROT_ARGS)
Line 1614  in_line_argn(MACRO_PROT_ARGS)
                                 return(0);                                  return(0);
                         continue;                          continue;
                 } else if (0 == j)                  } else if (0 == j)
                        if ( ! mdoc_elem_alloc(mdoc, line, la, tok, arg))                         if ( ! mdoc_elem_alloc(mdoc, line, ppos, tok, arg))
                                return(0);                                 return(0);
   
                 if (j == maxargs && ! flushed) {                  if (j == maxargs && ! flushed) {
Line 1608  in_line_argn(MACRO_PROT_ARGS)
Line 1650  in_line_argn(MACRO_PROT_ARGS)
                 j++;                  j++;
         }          }
   
         if (0 == j && ! mdoc_elem_alloc(mdoc, line, la, tok, arg))          if (0 == j && ! mdoc_elem_alloc(mdoc, line, ppos, tok, arg))
                return(0);                 return(0);
   
         /* Close out in a consistent state. */          /* Close out in a consistent state. */
Line 1715  ctx_synopsis(MACRO_PROT_ARGS)
Line 1757  ctx_synopsis(MACRO_PROT_ARGS)
         return(blk_part_imp(mdoc, tok, line, ppos, pos, buf));          return(blk_part_imp(mdoc, tok, line, ppos, pos, buf));
 }  }
   
 static int  
 obsolete(MACRO_PROT_ARGS)  
 {  
   
         mdoc_pmsg(mdoc, line, ppos, MANDOCERR_MACROOBS);  
         return(1);  
 }  
   
 /*  /*
  * Phrases occur within `Bl -column' entries, separated by `Ta' or tabs.   * Phrases occur within `Bl -column' entries, separated by `Ta' or tabs.
  * They're unusual because they're basically free-form text until a   * They're unusual because they're basically free-form text until a
Line 1776  phrase_ta(MACRO_PROT_ARGS)
Line 1810  phrase_ta(MACRO_PROT_ARGS)
         while (NULL != n && MDOC_Bl != n->tok)          while (NULL != n && MDOC_Bl != n->tok)
                 n = n->parent;                  n = n->parent;
         if (NULL == n || LIST_column != n->norm->Bl.type) {          if (NULL == n || LIST_column != n->norm->Bl.type) {
                 mdoc_pmsg(mdoc, line, ppos, MANDOCERR_STRAYTA);                  mandoc_msg(MANDOCERR_TA_STRAY, mdoc->parse,
                       line, ppos, "Ta");
                 return(1);                  return(1);
         }          }
   

Legend:
Removed from v.1.131  
changed lines
  Added in v.1.144

CVSweb