[BACK]Return to mdoc_macro.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / mandoc

Diff for /src/usr.bin/mandoc/mdoc_macro.c between version 1.58 and 1.59

version 1.58, 2010/10/16 13:38:29 version 1.59, 2010/10/24 18:15:43
Line 30 
Line 30 
         REWIND_NONE,          REWIND_NONE,
         REWIND_THIS,          REWIND_THIS,
         REWIND_MORE,          REWIND_MORE,
           REWIND_FORCE,
         REWIND_LATER,          REWIND_LATER,
         REWIND_ERROR          REWIND_ERROR
 };  };
Line 324 
Line 325 
  *   inside *p, so there is no need to rewind anything at all.   *   inside *p, so there is no need to rewind anything at all.
  * REWIND_THIS: *p matches tok, so rewind *p and nothing else.   * REWIND_THIS: *p matches tok, so rewind *p and nothing else.
  * REWIND_MORE: *p is implicit, rewind it and keep searching for tok.   * REWIND_MORE: *p is implicit, rewind it and keep searching for tok.
    * REWIND_FORCE: *p is explicit, but tok is full, force rewinding *p.
  * REWIND_LATER: *p is explicit and still open, postpone rewinding.   * REWIND_LATER: *p is explicit and still open, postpone rewinding.
  * REWIND_ERROR: No tok block is open at all.   * REWIND_ERROR: No tok block is open at all.
  */   */
Line 417 
Line 419 
                 return(REWIND_MORE);                  return(REWIND_MORE);
   
         /*          /*
          * Partial blocks allow delayed rewinding by default.           * By default, closing out full blocks
            * forces closing of broken explicit blocks,
            * while closing out partial blocks
            * allows delayed rewinding by default.
          */           */
         if (&blk_full != mdoc_macros[tok].fp)          return (&blk_full == mdoc_macros[tok].fp ?
                 return (REWIND_LATER);              REWIND_FORCE : REWIND_LATER);
   
         /*  
          * Full blocks can only be rewound when matching  
          * or when there is an explicit rule.  
          */  
         return(REWIND_ERROR);  
 }  }
   
   
Line 517 
Line 516 
         /*          /*
          * Found no matching block for tok.           * Found no matching block for tok.
          * Are you trying to close a block that is not open?           * Are you trying to close a block that is not open?
          * XXX Make this non-fatal.  
          */           */
         mdoc_pmsg(m, line, ppos, MANDOCERR_SYNTNOSCOPE);  
         return(0);          return(0);
 }  }
   
Line 537 
Line 534 
                         return(1);                          return(1);
                 case (REWIND_THIS):                  case (REWIND_THIS):
                         break;                          break;
                   case (REWIND_FORCE):
                           mdoc_vmsg(m, MANDOCERR_SCOPEBROKEN, line, ppos,
                               "%s breaks %s", mdoc_macronames[tok],
                               mdoc_macronames[n->tok]);
                           /* FALLTHROUGH */
                 case (REWIND_MORE):                  case (REWIND_MORE):
                         n = n->parent;                          n = n->parent;
                         continue;                          continue;
                 case (REWIND_LATER):                  case (REWIND_LATER):
                         return(make_pending(n, tok, m, line, ppos));                          if (make_pending(n, tok, m, line, ppos) ||
                               MDOC_BLOCK != t)
                                   return(1);
                           /* FALLTHROUGH */
                 case (REWIND_ERROR):                  case (REWIND_ERROR):
                         /* XXX Make this non-fatal. */                          mdoc_pmsg(m, line, ppos, MANDOCERR_NOSCOPE);
                         mdoc_vmsg(m, MANDOCERR_SCOPEFATAL, line, ppos,                          return(1);
                             "%s cannot break %s", mdoc_macronames[tok],  
                             mdoc_macronames[n->tok]);  
                         return 0;  
                 }                  }
                 break;                  break;
         }          }
Line 675 
Line 677 
                          * postpone closing out the current block                           * postpone closing out the current block
                          * until the rew_sub() closing out the sub-block.                           * until the rew_sub() closing out the sub-block.
                          */                           */
                         if ( ! make_pending(later, tok, m, line, ppos))                          make_pending(later, tok, m, line, ppos);
                                 return(0);  
   
                         /*                          /*
                          * Mark the place where the formatting - but not                           * Mark the place where the formatting - but not
Line 1282 
Line 1283 
                     MDOC_EXPLICIT & mdoc_macros[n->tok].flags &&                      MDOC_EXPLICIT & mdoc_macros[n->tok].flags &&
                     ! (MDOC_VALID & n->flags)) {                      ! (MDOC_VALID & n->flags)) {
                         assert( ! (MDOC_ACTED & n->flags));                          assert( ! (MDOC_ACTED & n->flags));
                         if ( ! make_pending(n, tok, m, line, ppos))                          make_pending(n, tok, m, line, ppos);
                                 return(0);  
                         if ( ! mdoc_endbody_alloc(m, line, ppos,                          if ( ! mdoc_endbody_alloc(m, line, ppos,
                             tok, body, ENDBODY_NOSPACE))                              tok, body, ENDBODY_NOSPACE))
                                 return(0);                                  return(0);

Legend:
Removed from v.1.58  
changed lines
  Added in v.1.59