[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.28 and 1.29

version 1.28, 2010/02/18 02:11:26 version 1.29, 2010/02/26 12:12:24
Line 591 
Line 591 
         }          }
   
         assert(n);          assert(n);
         return(rew_last(m, n));          if ( ! rew_last(m, n))
                   return(0);
   
           /*
            * The current block extends an enclosing block beyond a line break.
            * Now that the current block ends, close the enclosing block, too.
            */
           if ((n = n->pending) != NULL) {
                   assert(MDOC_HEAD == n->type);
                   if ( ! rew_last(m, n))
                           return(0);
                   if ( ! mdoc_body_alloc(m, n->line, n->pos, n->tok))
                           return(0);
           }
           return(1);
 }  }
   
   
Line 855 
Line 869 
 {  {
         int               c, lastarg, reopen, dohead;          int               c, lastarg, reopen, dohead;
         struct mdoc_arg  *arg;          struct mdoc_arg  *arg;
           struct mdoc_node *head, *n;
         char             *p;          char             *p;
   
         /*          /*
Line 900 
Line 915 
   
         if ( ! mdoc_block_alloc(m, line, ppos, tok, arg))          if ( ! mdoc_block_alloc(m, line, ppos, tok, arg))
                 return(0);                  return(0);
           if ( ! mdoc_head_alloc(m, line, ppos, tok))
                   return(0);
           head = m->last;
   
         if (0 == buf[*pos]) {          if (0 == buf[*pos]) {
                 if ( ! mdoc_head_alloc(m, line, ppos, tok))  
                         return(0);  
                 if ( ! rew_sub(MDOC_HEAD, m, tok, line, ppos))                  if ( ! rew_sub(MDOC_HEAD, m, tok, line, ppos))
                         return(0);                          return(0);
                 if ( ! mdoc_body_alloc(m, line, ppos, tok))                  if ( ! mdoc_body_alloc(m, line, ppos, tok))
Line 911 
Line 927 
                 return(1);                  return(1);
         }          }
   
         if ( ! mdoc_head_alloc(m, line, ppos, tok))  
                 return(0);  
   
         /* Immediately close out head and enter body, if applicable. */          /* Immediately close out head and enter body, if applicable. */
   
         if (0 == dohead) {          if (0 == dohead) {
Line 935 
Line 948 
                         assert(dohead);                          assert(dohead);
                         if (reopen && ! mdoc_head_alloc(m, line, ppos, tok))                          if (reopen && ! mdoc_head_alloc(m, line, ppos, tok))
                                 return(0);                                  return(0);
                           head = m->last;
                         /*                          /*
                          * Phrases are self-contained macro phrases used                           * Phrases are self-contained macro phrases used
                          * in the columnar output of a macro. They need                           * in the columnar output of a macro. They need
Line 966 
Line 980 
         /* If the body's already open, then just return. */          /* If the body's already open, then just return. */
         if (0 == dohead)          if (0 == dohead)
                 return(1);                  return(1);
   
           /*
            * If there is an open sub-block requiring explicit close-out,
            * postpone switching the current block from head to body
            * until the rew_sub() call closing out that sub-block.
            */
           for (n = m->last; n && n != head; n = n->parent) {
                   if (MDOC_BLOCK == n->type &&
                       MDOC_EXPLICIT & mdoc_macros[n->tok].flags) {
                           n->pending = head;
                           return(1);
                   }
           }
   
         if ( ! rew_sub(MDOC_HEAD, m, tok, line, ppos))          if ( ! rew_sub(MDOC_HEAD, m, tok, line, ppos))
                 return(0);                  return(0);

Legend:
Removed from v.1.28  
changed lines
  Added in v.1.29