[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.122 and 1.123

version 1.122, 2013/09/15 18:26:46 version 1.123, 2013/10/21 23:47: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 Ingo Schwarze <schwarze@openbsd.org>   * Copyright (c) 2010, 2012, 2013 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 51  static int    in_line(MACRO_PROT_ARGS);
Line 51  static int    in_line(MACRO_PROT_ARGS);
 static  int             obsolete(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,  static  int             dword(struct mdoc *, int, int, const char *,
                                 const char *, enum mdelim);                                   enum mdelim, int);
 static  int             append_delims(struct mdoc *,  static  int             append_delims(struct mdoc *,
                                 int, int *, char *);                                  int, int *, char *);
 static  enum mdoct      lookup(enum mdoct, const char *);  static  enum mdoct      lookup(enum mdoct, const char *);
Line 70  static int    rew_sub(enum mdoc_type, struct mdoc *, 
Line 70  static int    rew_sub(enum mdoc_type, struct mdoc *, 
                                 enum mdoct, int, int);                                  enum mdoct, int, int);
   
 const   struct mdoc_macro __mdoc_macros[MDOC_MAX] = {  const   struct mdoc_macro __mdoc_macros[MDOC_MAX] = {
         { in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* Ap */          { in_line_argn, MDOC_CALLABLE | MDOC_PARSED | MDOC_JOIN }, /* Ap */
         { in_line_eoln, MDOC_PROLOGUE }, /* Dd */          { in_line_eoln, MDOC_PROLOGUE }, /* Dd */
         { in_line_eoln, MDOC_PROLOGUE }, /* Dt */          { in_line_eoln, MDOC_PROLOGUE }, /* Dt */
         { in_line_eoln, MDOC_PROLOGUE }, /* Os */          { in_line_eoln, MDOC_PROLOGUE }, /* Os */
         { blk_full, MDOC_PARSED }, /* Sh */          { blk_full, MDOC_PARSED | MDOC_JOIN }, /* Sh */
         { blk_full, MDOC_PARSED }, /* Ss */          { blk_full, MDOC_PARSED | MDOC_JOIN }, /* Ss */
         { in_line_eoln, 0 }, /* Pp */          { in_line_eoln, 0 }, /* Pp */
         { blk_part_imp, MDOC_PARSED }, /* D1 */          { blk_part_imp, MDOC_PARSED | MDOC_JOIN }, /* D1 */
         { blk_part_imp, MDOC_PARSED }, /* Dl */          { blk_part_imp, MDOC_PARSED | MDOC_JOIN }, /* Dl */
         { blk_full, MDOC_EXPLICIT }, /* Bd */          { blk_full, MDOC_EXPLICIT }, /* Bd */
         { blk_exp_close, MDOC_EXPLICIT }, /* Ed */          { blk_exp_close, MDOC_EXPLICIT | MDOC_JOIN }, /* Ed */
         { blk_full, MDOC_EXPLICIT }, /* Bl */          { blk_full, MDOC_EXPLICIT }, /* Bl */
         { blk_exp_close, MDOC_EXPLICIT }, /* El */          { blk_exp_close, MDOC_EXPLICIT | MDOC_JOIN }, /* El */
         { blk_full, MDOC_PARSED }, /* It */          { blk_full, MDOC_PARSED | MDOC_JOIN }, /* It */
         { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Ad */          { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Ad */
         { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* An */          { in_line, MDOC_CALLABLE | MDOC_PARSED | MDOC_JOIN }, /* An */
         { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Ar */          { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Ar */
         { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Cd */          { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Cd */
         { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Cm */          { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Cm */
         { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Dv */          { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Dv */
         { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Er */          { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Er */
         { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Ev */          { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Ev */
         { in_line_eoln, 0 }, /* Ex */          { in_line_eoln, 0 }, /* Ex */
         { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Fa */          { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Fa */
         { in_line_eoln, 0 }, /* Fd */          { in_line_eoln, 0 }, /* Fd */
         { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Fl */          { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Fl */
         { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Fn */          { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Fn */
         { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Ft */          { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Ft */
         { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Ic */          { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Ic */
         { in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* In */          { in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* In */
         { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Li */          { in_line, MDOC_CALLABLE | MDOC_PARSED | MDOC_JOIN }, /* Li */
         { blk_full, 0 }, /* 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 */          { obsolete, 0 }, /* 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 */
         { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Va */          { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Va */
         { ctx_synopsis, MDOC_CALLABLE | MDOC_PARSED }, /* Vt */          { ctx_synopsis, MDOC_CALLABLE | MDOC_PARSED }, /* Vt */
         { in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* Xr */          { in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* Xr */
         { in_line_eoln, 0 }, /* %A */          { in_line_eoln, MDOC_JOIN }, /* %A */
         { in_line_eoln, 0 }, /* %B */          { in_line_eoln, MDOC_JOIN }, /* %B */
         { in_line_eoln, 0 }, /* %D */          { in_line_eoln, MDOC_JOIN }, /* %D */
         { in_line_eoln, 0 }, /* %I */          { in_line_eoln, MDOC_JOIN }, /* %I */
         { in_line_eoln, 0 }, /* %J */          { in_line_eoln, MDOC_JOIN }, /* %J */
         { in_line_eoln, 0 }, /* %N */          { in_line_eoln, 0 }, /* %N */
         { in_line_eoln, 0 }, /* %O */          { in_line_eoln, MDOC_JOIN }, /* %O */
         { in_line_eoln, 0 }, /* %P */          { in_line_eoln, 0 }, /* %P */
         { in_line_eoln, 0 }, /* %R */          { in_line_eoln, MDOC_JOIN }, /* %R */
         { in_line_eoln, 0 }, /* %T */          { in_line_eoln, MDOC_JOIN }, /* %T */
         { in_line_eoln, 0 }, /* %V */          { in_line_eoln, 0 }, /* %V */
         { blk_exp_close, MDOC_EXPLICIT | MDOC_CALLABLE | MDOC_PARSED }, /* Ac */          { blk_exp_close, MDOC_CALLABLE | MDOC_PARSED |
         { blk_part_exp, MDOC_CALLABLE | MDOC_PARSED | MDOC_EXPLICIT }, /* Ao */                           MDOC_EXPLICIT | MDOC_JOIN }, /* Ac */
         { blk_part_imp, MDOC_CALLABLE | MDOC_PARSED }, /* Aq */          { blk_part_exp, MDOC_CALLABLE | MDOC_PARSED |
                           MDOC_EXPLICIT | MDOC_JOIN }, /* Ao */
           { blk_part_imp, MDOC_CALLABLE | MDOC_PARSED | MDOC_JOIN }, /* Aq */
         { in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* At */          { in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* At */
         { blk_exp_close, MDOC_EXPLICIT | MDOC_CALLABLE | MDOC_PARSED }, /* Bc */          { blk_exp_close, MDOC_CALLABLE | MDOC_PARSED |
         { blk_full, MDOC_EXPLICIT }, /* Bf */                           MDOC_EXPLICIT | MDOC_JOIN }, /* Bc */
         { blk_part_exp, MDOC_CALLABLE | MDOC_PARSED | MDOC_EXPLICIT }, /* Bo */          { blk_full, MDOC_EXPLICIT }, /* Bf */
         { blk_part_imp, MDOC_CALLABLE | MDOC_PARSED }, /* Bq */          { blk_part_exp, MDOC_CALLABLE | MDOC_PARSED |
                           MDOC_EXPLICIT | MDOC_JOIN }, /* Bo */
           { blk_part_imp, MDOC_CALLABLE | MDOC_PARSED | MDOC_JOIN }, /* Bq */
         { in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* Bsx */          { in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* Bsx */
         { in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* Bx */          { in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* Bx */
         { in_line_eoln, 0 }, /* Db */          { in_line_eoln, 0 }, /* Db */
         { blk_exp_close, MDOC_EXPLICIT | MDOC_CALLABLE | MDOC_PARSED }, /* Dc */          { blk_exp_close, MDOC_CALLABLE | MDOC_PARSED |
         { blk_part_exp, MDOC_CALLABLE | MDOC_PARSED | MDOC_EXPLICIT }, /* Do */                           MDOC_EXPLICIT | MDOC_JOIN }, /* Dc */
         { blk_part_imp, MDOC_CALLABLE | MDOC_PARSED }, /* Dq */          { blk_part_exp, MDOC_CALLABLE | MDOC_PARSED |
         { blk_exp_close, MDOC_EXPLICIT | MDOC_CALLABLE | MDOC_PARSED }, /* Ec */                          MDOC_EXPLICIT | MDOC_JOIN }, /* Do */
         { blk_exp_close, MDOC_EXPLICIT }, /* Ef */          { blk_part_imp, MDOC_CALLABLE | MDOC_PARSED | MDOC_JOIN }, /* Dq */
         { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Em */          { blk_exp_close, MDOC_CALLABLE | MDOC_PARSED | MDOC_EXPLICIT }, /* Ec */
           { blk_exp_close, MDOC_EXPLICIT | MDOC_JOIN }, /* Ef */
           { in_line, MDOC_CALLABLE | MDOC_PARSED | MDOC_JOIN }, /* Em */
         { 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_argn, MDOC_CALLABLE | MDOC_PARSED | MDOC_IGNDELIM }, /* No */          { in_line_argn, MDOC_CALLABLE | MDOC_PARSED |
         { in_line_argn, MDOC_CALLABLE | MDOC_PARSED | MDOC_IGNDELIM }, /* Ns */                          MDOC_IGNDELIM | MDOC_JOIN }, /* No */
           { in_line_argn, MDOC_CALLABLE | MDOC_PARSED |
                           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 */
         { blk_exp_close, MDOC_EXPLICIT | MDOC_CALLABLE | MDOC_PARSED }, /* Pc */          { blk_exp_close, MDOC_CALLABLE | MDOC_PARSED |
                            MDOC_EXPLICIT | MDOC_JOIN }, /* Pc */
         { in_line_argn, MDOC_CALLABLE | MDOC_PARSED | MDOC_IGNDELIM }, /* Pf */          { in_line_argn, MDOC_CALLABLE | MDOC_PARSED | MDOC_IGNDELIM }, /* Pf */
         { blk_part_exp, MDOC_CALLABLE | MDOC_PARSED | MDOC_EXPLICIT }, /* Po */          { blk_part_exp, MDOC_CALLABLE | MDOC_PARSED |
         { blk_part_imp, MDOC_CALLABLE | MDOC_PARSED }, /* Pq */                          MDOC_EXPLICIT | MDOC_JOIN }, /* Po */
         { blk_exp_close, MDOC_EXPLICIT | MDOC_CALLABLE | MDOC_PARSED }, /* Qc */          { blk_part_imp, MDOC_CALLABLE | MDOC_PARSED | MDOC_JOIN }, /* Pq */
         { blk_part_imp, MDOC_CALLABLE | MDOC_PARSED }, /* Ql */          { blk_exp_close, MDOC_CALLABLE | MDOC_PARSED |
         { blk_part_exp, MDOC_CALLABLE | MDOC_PARSED | MDOC_EXPLICIT }, /* Qo */                           MDOC_EXPLICIT | MDOC_JOIN }, /* Qc */
         { blk_part_imp, MDOC_CALLABLE | MDOC_PARSED }, /* Qq */          { blk_part_imp, MDOC_CALLABLE | MDOC_PARSED | MDOC_JOIN }, /* Ql */
         { blk_exp_close, MDOC_EXPLICIT }, /* Re */          { blk_part_exp, MDOC_CALLABLE | MDOC_PARSED |
                           MDOC_EXPLICIT | MDOC_JOIN }, /* Qo */
           { blk_part_imp, MDOC_CALLABLE | MDOC_PARSED | MDOC_JOIN }, /* Qq */
           { blk_exp_close, MDOC_EXPLICIT | MDOC_JOIN }, /* Re */
         { blk_full, MDOC_EXPLICIT }, /* Rs */          { blk_full, MDOC_EXPLICIT }, /* Rs */
         { blk_exp_close, MDOC_EXPLICIT | MDOC_CALLABLE | MDOC_PARSED }, /* Sc */          { blk_exp_close, MDOC_CALLABLE | MDOC_PARSED |
         { blk_part_exp, MDOC_CALLABLE | MDOC_PARSED | MDOC_EXPLICIT }, /* So */                           MDOC_EXPLICIT | MDOC_JOIN }, /* Sc */
         { blk_part_imp, MDOC_CALLABLE | MDOC_PARSED }, /* Sq */          { blk_part_exp, MDOC_CALLABLE | MDOC_PARSED |
                           MDOC_EXPLICIT | MDOC_JOIN }, /* So */
           { blk_part_imp, MDOC_CALLABLE | MDOC_PARSED | MDOC_JOIN }, /* Sq */
         { in_line_eoln, 0 }, /* Sm */          { in_line_eoln, 0 }, /* Sm */
         { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Sx */          { in_line, MDOC_CALLABLE | MDOC_PARSED | MDOC_JOIN }, /* Sx */
         { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Sy */          { in_line, MDOC_CALLABLE | MDOC_PARSED | MDOC_JOIN }, /* Sy */
         { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Tn */          { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Tn */
         { in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* Ux */          { in_line_argn, MDOC_CALLABLE | MDOC_PARSED | MDOC_JOIN }, /* Ux */
         { blk_exp_close, MDOC_EXPLICIT | MDOC_CALLABLE | MDOC_PARSED }, /* Xc */          { blk_exp_close, MDOC_EXPLICIT | MDOC_CALLABLE | MDOC_PARSED }, /* Xc */
         { blk_part_exp, MDOC_CALLABLE | MDOC_PARSED | MDOC_EXPLICIT }, /* Xo */          { blk_part_exp, MDOC_CALLABLE | MDOC_PARSED | MDOC_EXPLICIT }, /* Xo */
         { blk_full, MDOC_EXPLICIT | MDOC_CALLABLE }, /* Fo */          { blk_full, MDOC_EXPLICIT | MDOC_CALLABLE }, /* Fo */
         { blk_exp_close, MDOC_EXPLICIT | MDOC_CALLABLE | MDOC_PARSED }, /* Fc */          { blk_exp_close, MDOC_CALLABLE | MDOC_PARSED |
         { blk_part_exp, MDOC_CALLABLE | MDOC_PARSED | MDOC_EXPLICIT }, /* Oo */                           MDOC_EXPLICIT | MDOC_JOIN }, /* Fc */
         { blk_exp_close, MDOC_EXPLICIT | MDOC_CALLABLE | MDOC_PARSED }, /* Oc */          { blk_part_exp, MDOC_CALLABLE | MDOC_PARSED |
                           MDOC_EXPLICIT | MDOC_JOIN }, /* Oo */
           { blk_exp_close, MDOC_CALLABLE | MDOC_PARSED |
                            MDOC_EXPLICIT | MDOC_JOIN }, /* Oc */
         { blk_full, MDOC_EXPLICIT }, /* Bk */          { blk_full, MDOC_EXPLICIT }, /* Bk */
         { blk_exp_close, MDOC_EXPLICIT }, /* 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 */          { obsolete, 0 }, /* 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 */
         { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Lk */          { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Lk */
         { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Mt */          { in_line, MDOC_CALLABLE | MDOC_PARSED }, /* Mt */
         { blk_part_imp, MDOC_CALLABLE | MDOC_PARSED }, /* Brq */          { blk_part_imp, MDOC_CALLABLE | MDOC_PARSED | MDOC_JOIN }, /* Brq */
         { blk_part_exp, MDOC_CALLABLE | MDOC_PARSED | MDOC_EXPLICIT }, /* Bro */          { blk_part_exp, MDOC_CALLABLE | MDOC_PARSED |
         { blk_exp_close, MDOC_EXPLICIT | MDOC_CALLABLE | MDOC_PARSED }, /* Brc */                          MDOC_EXPLICIT | MDOC_JOIN }, /* Bro */
         { in_line_eoln, 0 }, /* %C */          { blk_exp_close, MDOC_CALLABLE | MDOC_PARSED |
                            MDOC_EXPLICIT | MDOC_JOIN }, /* Brc */
           { in_line_eoln, MDOC_JOIN }, /* %C */
         { obsolete, 0 }, /* Es */          { obsolete, 0 }, /* Es */
         { obsolete, 0 }, /* En */          { obsolete, 0 }, /* En */
         { in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* Dx */          { in_line_argn, MDOC_CALLABLE | MDOC_PARSED }, /* Dx */
         { in_line_eoln, 0 }, /* %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 }, /* Ta */          { phrase_ta, MDOC_CALLABLE | MDOC_PARSED | MDOC_JOIN }, /* Ta */
 };  };
   
 const   struct mdoc_macro * const mdoc_macros = __mdoc_macros;  const   struct mdoc_macro * const mdoc_macros = __mdoc_macros;
Line 588  rew_sub(enum mdoc_type t, struct mdoc *mdoc, 
Line 607  rew_sub(enum mdoc_type t, struct mdoc *mdoc, 
  * Punctuation consists of those tokens found in mdoc_isdelim().   * Punctuation consists of those tokens found in mdoc_isdelim().
  */   */
 static int  static int
 dword(struct mdoc *mdoc, int line,  dword(struct mdoc *mdoc, int line, int col, const char *p,
                 int col, const char *p, enum mdelim d)                  enum mdelim d, int may_append)
 {  {
   
         if (DELIM_MAX == d)          if (DELIM_MAX == d)
                 d = mdoc_isdelim(p);                  d = mdoc_isdelim(p);
   
           if (may_append &&
               ! ((MDOC_SYNOPSIS | MDOC_KEEP | MDOC_SMOFF) & mdoc->flags) &&
               DELIM_NONE == d && MDOC_TEXT == mdoc->last->type &&
               DELIM_NONE == mdoc_isdelim(mdoc->last->string)) {
                   mdoc_word_append(mdoc, p);
                   return(1);
           }
   
         if ( ! mdoc_word_alloc(mdoc, line, col, p))          if ( ! mdoc_word_alloc(mdoc, line, col, p))
                 return(0);                  return(0);
   
Line 638  append_delims(struct mdoc *mdoc, int line, int *pos, c
Line 665  append_delims(struct mdoc *mdoc, int line, int *pos, c
                 else if (ARGS_EOLN == ac)                  else if (ARGS_EOLN == ac)
                         break;                          break;
   
                 dword(mdoc, line, la, p, DELIM_MAX);                  dword(mdoc, line, la, p, DELIM_MAX, 1);
   
                 /*                  /*
                  * If we encounter end-of-sentence symbols, then trigger                   * If we encounter end-of-sentence symbols, then trigger
Line 680  blk_exp_close(MACRO_PROT_ARGS)
Line 707  blk_exp_close(MACRO_PROT_ARGS)
         case (MDOC_Ec):          case (MDOC_Ec):
                 maxargs = 1;                  maxargs = 1;
                 break;                  break;
           case (MDOC_Ek):
                   if ( ! (MDOC_SYNOPSIS & mdoc->flags))
                           mdoc->flags &= ~MDOC_KEEP;
         default:          default:
                 maxargs = 0;                  maxargs = 0;
                 break;                  break;
Line 782  blk_exp_close(MACRO_PROT_ARGS)
Line 812  blk_exp_close(MACRO_PROT_ARGS)
                 ntok = ARGS_QWORD == ac ? MDOC_MAX : lookup(tok, p);                  ntok = ARGS_QWORD == ac ? MDOC_MAX : lookup(tok, p);
   
                 if (MDOC_MAX == ntok) {                  if (MDOC_MAX == ntok) {
                         if ( ! dword(mdoc, line, lastarg, p, DELIM_MAX))                          if ( ! dword(mdoc, line, lastarg, p, DELIM_MAX,
                               MDOC_JOIN & mdoc_macros[tok].flags))
                                 return(0);                                  return(0);
                         continue;                          continue;
                 }                  }
Line 948  in_line(MACRO_PROT_ARGS)
Line 979  in_line(MACRO_PROT_ARGS)
                 if (DELIM_NONE == d)                  if (DELIM_NONE == d)
                         cnt++;                          cnt++;
   
                 if ( ! dword(mdoc, line, la, p, d))                  if ( ! dword(mdoc, line, la, p, d,
                       MDOC_JOIN & mdoc_macros[tok].flags))
                         return(0);                          return(0);
   
                 /*                  /*
Line 1067  blk_full(MACRO_PROT_ARGS)
Line 1099  blk_full(MACRO_PROT_ARGS)
                 if ( ! mdoc_body_alloc(mdoc, line, ppos, tok))                  if ( ! mdoc_body_alloc(mdoc, line, ppos, tok))
                         return(0);                          return(0);
                 body = mdoc->last;                  body = mdoc->last;
         }          }
   
           if (MDOC_Bk == tok)
                   mdoc->flags |= MDOC_KEEP;
   
         ac = ARGS_ERROR;          ac = ARGS_ERROR;
   
         for ( ; ; ) {          for ( ; ; ) {
Line 1112  blk_full(MACRO_PROT_ARGS)
Line 1147  blk_full(MACRO_PROT_ARGS)
                                 ARGS_PPHRASE != ac &&                                  ARGS_PPHRASE != ac &&
                                 ARGS_QWORD != ac &&                                  ARGS_QWORD != ac &&
                                 DELIM_OPEN == mdoc_isdelim(p)) {                                  DELIM_OPEN == mdoc_isdelim(p)) {
                         if ( ! dword(mdoc, line, la, p, DELIM_OPEN))                          if ( ! dword(mdoc, line, la, p, DELIM_OPEN, 0))
                                 return(0);                                  return(0);
                         continue;                          continue;
                 }                  }
Line 1165  blk_full(MACRO_PROT_ARGS)
Line 1200  blk_full(MACRO_PROT_ARGS)
                         MDOC_MAX : lookup(tok, p);                          MDOC_MAX : lookup(tok, p);
   
                 if (MDOC_MAX == ntok) {                  if (MDOC_MAX == ntok) {
                         if ( ! dword(mdoc, line, la, p, DELIM_MAX))                          if ( ! dword(mdoc, line, la, p, DELIM_MAX,
                               MDOC_JOIN & mdoc_macros[tok].flags))
                                 return(0);                                  return(0);
                         continue;                          continue;
                 }                  }
Line 1276  blk_part_imp(MACRO_PROT_ARGS)
Line 1312  blk_part_imp(MACRO_PROT_ARGS)
   
                 if (NULL == body && ARGS_QWORD != ac &&                  if (NULL == body && ARGS_QWORD != ac &&
                                 DELIM_OPEN == mdoc_isdelim(p)) {                                  DELIM_OPEN == mdoc_isdelim(p)) {
                         if ( ! dword(mdoc, line, la, p, DELIM_OPEN))                          if ( ! dword(mdoc, line, la, p, DELIM_OPEN, 0))
                                 return(0);                                  return(0);
                         continue;                          continue;
                 }                  }
   
                 if (NULL == body) {                  if (NULL == body) {
                        if ( ! mdoc_body_alloc(mdoc, line, ppos, tok))                         if ( ! mdoc_body_alloc(mdoc, line, ppos, tok))
Line 1290  blk_part_imp(MACRO_PROT_ARGS)
Line 1326  blk_part_imp(MACRO_PROT_ARGS)
                 ntok = ARGS_QWORD == ac ? MDOC_MAX : lookup(tok, p);                  ntok = ARGS_QWORD == ac ? MDOC_MAX : lookup(tok, p);
   
                 if (MDOC_MAX == ntok) {                  if (MDOC_MAX == ntok) {
                         if ( ! dword(mdoc, line, la, p, DELIM_MAX))                          if ( ! dword(mdoc, line, la, p, DELIM_MAX,
                               MDOC_JOIN & mdoc_macros[tok].flags))
                                 return(0);                                  return(0);
                         continue;                          continue;
                 }                  }
Line 1416  blk_part_exp(MACRO_PROT_ARGS)
Line 1453  blk_part_exp(MACRO_PROT_ARGS)
                 if (NULL == head && ARGS_QWORD != ac &&                  if (NULL == head && ARGS_QWORD != ac &&
                                 DELIM_OPEN == mdoc_isdelim(p)) {                                  DELIM_OPEN == mdoc_isdelim(p)) {
                         assert(NULL == body);                          assert(NULL == body);
                         if ( ! dword(mdoc, line, la, p, DELIM_OPEN))                          if ( ! dword(mdoc, line, la, p, DELIM_OPEN, 0))
                                 return(0);                                  return(0);
                         continue;                          continue;
                 }                  }
   
                 if (NULL == head) {                  if (NULL == head) {
                         assert(NULL == body);                          assert(NULL == body);
Line 1437  blk_part_exp(MACRO_PROT_ARGS)
Line 1474  blk_part_exp(MACRO_PROT_ARGS)
                         assert(head);                          assert(head);
                         /* No check whether it's a macro! */                          /* No check whether it's a macro! */
                         if (MDOC_Eo == tok)                          if (MDOC_Eo == tok)
                                 if ( ! dword(mdoc, line, la, p, DELIM_MAX))                                  if ( ! dword(mdoc, line, la, p, DELIM_MAX, 0))
                                         return(0);                                          return(0);
   
                         if ( ! rew_sub(MDOC_HEAD, mdoc, tok, line, ppos))                          if ( ! rew_sub(MDOC_HEAD, mdoc, tok, line, ppos))
Line 1455  blk_part_exp(MACRO_PROT_ARGS)
Line 1492  blk_part_exp(MACRO_PROT_ARGS)
                 ntok = ARGS_QWORD == ac ? MDOC_MAX : lookup(tok, p);                  ntok = ARGS_QWORD == ac ? MDOC_MAX : lookup(tok, p);
   
                 if (MDOC_MAX == ntok) {                  if (MDOC_MAX == ntok) {
                         if ( ! dword(mdoc, line, la, p, DELIM_MAX))                          if ( ! dword(mdoc, line, la, p, DELIM_MAX,
                               MDOC_JOIN & mdoc_macros[tok].flags))
                                 return(0);                                  return(0);
                         continue;                          continue;
                 }                  }
Line 1559  in_line_argn(MACRO_PROT_ARGS)
Line 1597  in_line_argn(MACRO_PROT_ARGS)
                 if ( ! (MDOC_IGNDELIM & mdoc_macros[tok].flags) &&                  if ( ! (MDOC_IGNDELIM & mdoc_macros[tok].flags) &&
                                 ARGS_QWORD != ac && 0 == j &&                                  ARGS_QWORD != ac && 0 == j &&
                                 DELIM_OPEN == mdoc_isdelim(p)) {                                  DELIM_OPEN == mdoc_isdelim(p)) {
                         if ( ! dword(mdoc, line, la, p, DELIM_OPEN))                          if ( ! dword(mdoc, line, la, p, DELIM_OPEN, 0))
                                 return(0);                                  return(0);
                         continue;                          continue;
                 } else if (0 == j)                  } else if (0 == j)
Line 1593  in_line_argn(MACRO_PROT_ARGS)
Line 1631  in_line_argn(MACRO_PROT_ARGS)
                         flushed = 1;                          flushed = 1;
                 }                  }
   
                 if ( ! dword(mdoc, line, la, p, DELIM_MAX))                  if ( ! dword(mdoc, line, la, p, DELIM_MAX,
                       MDOC_JOIN & mdoc_macros[tok].flags))
                         return(0);                          return(0);
                 j++;                  j++;
         }          }
Line 1664  in_line_eoln(MACRO_PROT_ARGS)
Line 1703  in_line_eoln(MACRO_PROT_ARGS)
                 ntok = ARGS_QWORD == ac ? MDOC_MAX : lookup(tok, p);                  ntok = ARGS_QWORD == ac ? MDOC_MAX : lookup(tok, p);
   
                 if (MDOC_MAX == ntok) {                  if (MDOC_MAX == ntok) {
                         if ( ! dword(mdoc, line, la, p, DELIM_MAX))                          if ( ! dword(mdoc, line, la, p, DELIM_MAX,
                               MDOC_JOIN & mdoc_macros[tok].flags))
                                 return(0);                                  return(0);
                         continue;                          continue;
                 }                  }
Line 1744  phrase(struct mdoc *mdoc, int line, int ppos, char *bu
Line 1784  phrase(struct mdoc *mdoc, int line, int ppos, char *bu
                 ntok = ARGS_QWORD == ac ? MDOC_MAX : lookup_raw(p);                  ntok = ARGS_QWORD == ac ? MDOC_MAX : lookup_raw(p);
   
                 if (MDOC_MAX == ntok) {                  if (MDOC_MAX == ntok) {
                         if ( ! dword(mdoc, line, la, p, DELIM_MAX))                          if ( ! dword(mdoc, line, la, p, DELIM_MAX, 1))
                                 return(0);                                  return(0);
                         continue;                          continue;
                 }                  }
Line 1795  phrase_ta(MACRO_PROT_ARGS)
Line 1835  phrase_ta(MACRO_PROT_ARGS)
                 ntok = ARGS_QWORD == ac ? MDOC_MAX : lookup_raw(p);                  ntok = ARGS_QWORD == ac ? MDOC_MAX : lookup_raw(p);
   
                 if (MDOC_MAX == ntok) {                  if (MDOC_MAX == ntok) {
                         if ( ! dword(mdoc, line, la, p, DELIM_MAX))                          if ( ! dword(mdoc, line, la, p, DELIM_MAX,
                               MDOC_JOIN & mdoc_macros[tok].flags))
                                 return(0);                                  return(0);
                         continue;                          continue;
                 }                  }

Legend:
Removed from v.1.122  
changed lines
  Added in v.1.123

CVSweb