[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.87 and 1.88

version 1.87, 2010/07/01 14:28:12 version 1.88, 2010/07/01 15:38:56
Line 97  const struct mdoc_macro __mdoc_macros[MDOC_MAX] = {
Line 97  const struct mdoc_macro __mdoc_macros[MDOC_MAX] = {
         { 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 }, /* Li */
         { blk_full, 0 }, /* Nd */          { blk_full, 0 }, /* Nd */
         { in_line, 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 */
Line 392  rew_dohalt(enum mdoct tok, enum mdoc_type type, 
Line 392  rew_dohalt(enum mdoct tok, enum mdoc_type type, 
                 if (MDOC_Op == p->tok)                  if (MDOC_Op == p->tok)
                         return(REWIND_MORE);                          return(REWIND_MORE);
                 break;                  break;
           case (MDOC_Nm):
                   return(REWIND_NONE);
         case (MDOC_Nd):          case (MDOC_Nd):
                 /* FALLTHROUGH */                  /* FALLTHROUGH */
         case (MDOC_Ss):          case (MDOC_Ss):
Line 409  rew_dohalt(enum mdoct tok, enum mdoc_type type, 
Line 411  rew_dohalt(enum mdoct tok, enum mdoc_type type, 
   
         /*          /*
          * Default block rewinding rules.           * Default block rewinding rules.
          * In particular, always skip block end markers.           * In particular, always skip block end markers,
            * and let all blocks rewind Nm children.
          */           */
         if (ENDBODY_NOT != p->end || (MDOC_BLOCK == p->type &&          if (ENDBODY_NOT != p->end || MDOC_Nm == p->tok ||
               (MDOC_BLOCK == p->type &&
             ! (MDOC_EXPLICIT & mdoc_macros[tok].flags)))              ! (MDOC_EXPLICIT & mdoc_macros[tok].flags)))
                 return(REWIND_MORE);                  return(REWIND_MORE);
   
Line 507  make_pending(struct mdoc_node *broken, enum mdoct tok,
Line 511  make_pending(struct mdoc_node *broken, enum mdoct tok,
                         taker->pending = broken->pending;                          taker->pending = broken->pending;
                 }                  }
                 broken->pending = breaker;                  broken->pending = breaker;
                 mdoc_vmsg(m, MANDOCERR_SCOPE, line, ppos, "%s breaks %s",                  mdoc_vmsg(m, MANDOCERR_SCOPENEST, line, ppos,
                     mdoc_macronames[tok], mdoc_macronames[broken->tok]);                      "%s breaks %s", mdoc_macronames[tok],
                       mdoc_macronames[broken->tok]);
                 return(1);                  return(1);
         }          }
   
Line 542  rew_sub(enum mdoc_type t, struct mdoc *m, 
Line 547  rew_sub(enum mdoc_type t, struct mdoc *m, 
                         return(make_pending(n, tok, m, line, ppos));                          return(make_pending(n, tok, m, line, ppos));
                 case (REWIND_ERROR):                  case (REWIND_ERROR):
                         /* XXX Make this non-fatal. */                          /* XXX Make this non-fatal. */
                         mdoc_pmsg(m, line, ppos, MANDOCERR_SYNTNOSCOPE);                          mdoc_vmsg(m, MANDOCERR_SCOPEFATAL, line, ppos,
                               "%s cannot break %s", mdoc_macronames[tok],
                               mdoc_macronames[n->tok]);
                         return 0;                          return 0;
                 }                  }
                 break;                  break;
Line 653  blk_exp_close(MACRO_PROT_ARGS)
Line 660  blk_exp_close(MACRO_PROT_ARGS)
                         continue;                          continue;
                 }                  }
   
                 if (MDOC_BLOCK != n->type)                  if (MDOC_BLOCK != n->type || MDOC_Nm == n->tok)
                         continue;                          continue;
                 if (atok == n->tok) {                  if (atok == n->tok) {
                         assert(body);                          assert(body);
Line 1290  blk_part_imp(MACRO_PROT_ARGS)
Line 1297  blk_part_imp(MACRO_PROT_ARGS)
          * is ugly behaviour nodding its head to OpenBSD's overwhelming           * is ugly behaviour nodding its head to OpenBSD's overwhelming
          * crufty use of `Op' breakage.           * crufty use of `Op' breakage.
          */           */
         if (n != body && ! mdoc_vmsg(m, MANDOCERR_SCOPE, line, ppos,          if (n != body && ! mdoc_vmsg(m, MANDOCERR_SCOPENEST,
             "%s broken", mdoc_macronames[tok]))              line, ppos, "%s broken", mdoc_macronames[tok]))
                 return(0);                  return(0);
   
         if (n && ! rew_sub(MDOC_BODY, m, tok, line, ppos))          if (n && ! rew_sub(MDOC_BODY, m, tok, line, ppos))
Line 1647  ctx_synopsis(MACRO_PROT_ARGS)
Line 1654  ctx_synopsis(MACRO_PROT_ARGS)
          * up formatting the block scope, then child nodes will inherit           * up formatting the block scope, then child nodes will inherit
          * the formatting.  Be careful.           * the formatting.  Be careful.
          */           */
           if (MDOC_Nm == tok)
                   return(blk_full(m, tok, line, ppos, pos, buf));
           assert(MDOC_Vt == tok);
         return(blk_part_imp(m, tok, line, ppos, pos, buf));          return(blk_part_imp(m, tok, line, ppos, pos, buf));
 }  }
   

Legend:
Removed from v.1.87  
changed lines
  Added in v.1.88

CVSweb