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

Diff for /src/usr.bin/mandoc/man.c between version 1.83 and 1.84

version 1.83, 2014/07/07 21:35:42 version 1.84, 2014/08/08 15:32:17
Line 64 
Line 64 
 man_node(const struct man *man)  man_node(const struct man *man)
 {  {
   
         assert( ! (MAN_HALT & man->flags));  
         return(man->first);          return(man->first);
 }  }
   
Line 72 
Line 71 
 man_meta(const struct man *man)  man_meta(const struct man *man)
 {  {
   
         assert( ! (MAN_HALT & man->flags));  
         return(&man->meta);          return(&man->meta);
 }  }
   
Line 112 
Line 110 
 man_endparse(struct man *man)  man_endparse(struct man *man)
 {  {
   
         assert( ! (MAN_HALT & man->flags));          return(man_macroend(man));
         if (man_macroend(man))  
                 return(1);  
         man->flags |= MAN_HALT;  
         return(0);  
 }  }
   
 int  int
Line 125 
Line 119 
   
         man->flags |= MAN_NEWLINE;          man->flags |= MAN_NEWLINE;
   
         assert( ! (MAN_HALT & man->flags));  
   
         return (roff_getcontrol(man->roff, buf, &offs) ?          return (roff_getcontrol(man->roff, buf, &offs) ?
             man_pmacro(man, ln, buf, offs) :              man_pmacro(man, ln, buf, offs) :
             man_ptext(man, ln, buf, offs));              man_ptext(man, ln, buf, offs));
Line 348 
Line 340 
 {  {
         struct man_node *n;          struct man_node *n;
   
         assert( ! (MAN_HALT & man->flags));  
   
         n = man_node_alloc(man, ep->ln, ep->pos, MAN_EQN, MAN_MAX);          n = man_node_alloc(man, ep->ln, ep->pos, MAN_EQN, MAN_MAX);
         n->eqn = ep;          n->eqn = ep;
   
Line 365 
Line 355 
 {  {
         struct man_node *n;          struct man_node *n;
   
         assert( ! (MAN_HALT & man->flags));  
   
         n = man_node_alloc(man, sp->line, 0, MAN_TBL, MAN_MAX);          n = man_node_alloc(man, sp->line, 0, MAN_TBL, MAN_MAX);
         n->span = sp;          n->span = sp;
   
Line 474 
Line 462 
 static int  static int
 man_pmacro(struct man *man, int ln, char *buf, int offs)  man_pmacro(struct man *man, int ln, char *buf, int offs)
 {  {
         int              i, ppos;  
         enum mant        tok;  
         char             mac[5];          char             mac[5];
         struct man_node *n;          struct man_node *n;
           enum mant        tok;
           int              i, ppos;
           int              bline;
   
         if ('"' == buf[offs]) {          if ('"' == buf[offs]) {
                 mandoc_msg(MANDOCERR_COMMENT_BAD, man->parse,                  mandoc_msg(MANDOCERR_COMMENT_BAD, man->parse,
Line 577 
Line 566 
                 man->flags &= ~MAN_BLINE;                  man->flags &= ~MAN_BLINE;
         }          }
   
         /*          /* Remember whether we are in next-line scope for a block head. */
          * Save the fact that we're in the next-line for a block.  In  
          * this way, embedded roff instructions can "remember" state  
          * when they exit.  
          */  
   
         if (MAN_BLINE & man->flags)          bline = man->flags & MAN_BLINE;
                 man->flags |= MAN_BPLINE;  
   
         /* Call to handler... */          /* Call to handler... */
   
         assert(man_macros[tok].fp);          assert(man_macros[tok].fp);
         if ( ! (*man_macros[tok].fp)(man, tok, ln, ppos, &offs, buf))          if ( ! (*man_macros[tok].fp)(man, tok, ln, ppos, &offs, buf))
                 goto err;                  return(0);
   
         /* In quick mode (for mandocdb), abort after the NAME section. */          /* In quick mode (for mandocdb), abort after the NAME section. */
   
Line 602 
Line 586 
         }          }
   
         /*          /*
          * We weren't in a block-line scope when entering the           * If we are in a next-line scope for a block head,
          * above-parsed macro, so return.           * close it out now and switch to the body,
            * unless the next-line scope is allowed to continue.
          */           */
   
         if ( ! (MAN_BPLINE & man->flags)) {          if ( ! bline || man->flags & MAN_ELINE ||
                 man->flags &= ~MAN_ILINE;              man_macros[tok].flags & MAN_NSCOPED)
                 return(1);                  return(1);
         }  
         man->flags &= ~MAN_BPLINE;  
   
         /*  
          * If we're in a block scope, then allow this macro to slip by  
          * without closing scope around it.  
          */  
   
         if (MAN_ILINE & man->flags) {  
                 man->flags &= ~MAN_ILINE;  
                 return(1);  
         }  
   
         /*  
          * If we've opened a new next-line element scope, then return  
          * now, as the next line will close out the block scope.  
          */  
   
         if (MAN_ELINE & man->flags)  
                 return(1);  
   
         /* Close out the block scope opened in the prior line.  */  
   
         assert(MAN_BLINE & man->flags);          assert(MAN_BLINE & man->flags);
         man->flags &= ~MAN_BLINE;          man->flags &= ~MAN_BLINE;
   
         if ( ! man_unscope(man, man->last->parent))          if ( ! man_unscope(man, man->last->parent))
                 return(0);                  return(0);
         return(man_body_alloc(man, ln, ppos, man->last->tok));          return(man_body_alloc(man, ln, ppos, man->last->tok));
   
 err:    /* Error out. */  
   
         man->flags |= MAN_HALT;  
         return(0);  
 }  }
   
 /*  /*

Legend:
Removed from v.1.83  
changed lines
  Added in v.1.84