[BACK]Return to mdoc_term.c CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / mandoc

Diff for /mandoc/mdoc_term.c between version 1.164 and 1.165

version 1.164, 2010/07/01 15:38:56 version 1.165, 2010/07/01 22:56:17
Line 336  print_mdoc_node(DECL_ARGS)
Line 336  print_mdoc_node(DECL_ARGS)
   
         term_fontpopq(p, font);          term_fontpopq(p, font);
   
         if (MDOC_TEXT != n->type &&          if (MDOC_TEXT != n->type && termacts[n->tok].post &&
             termacts[n->tok].post &&                          ! (MDOC_ENDED & n->flags)) {
             ! (MDOC_ENDED & n->flags)) {                  (void)(*termacts[n->tok].post)(p, &npair, m, n);
                 (*termacts[n->tok].post)(p, &npair, m, n);  
   
                 /*                  /*
                  * Explicit end tokens not only call the post                   * Explicit end tokens not only call the post
                  * handler, but also tell the respective block                   * handler, but also tell the respective block
                  * that it must not call the post handler again.                   * that it must not call the post handler again.
                  */                   */
                 if (n->end)                  if (ENDBODY_NOT != n->end)
                         n->pending->flags |= MDOC_ENDED;                          n->pending->flags |= MDOC_ENDED;
   
                 /*                  /*
Line 574  print_bvspace(struct termp *p, 
Line 573  print_bvspace(struct termp *p, 
   
         term_newln(p);          term_newln(p);
   
         if (MDOC_Bd == bl->tok && bl->data.Bd.comp)          if (MDOC_Bd == bl->tok && bl->data.Bd->comp)
                 return;                  return;
         if (MDOC_Bl == bl->tok && bl->data.Bl.comp)          if (MDOC_Bl == bl->tok && bl->data.Bl->comp)
                 return;                  return;
   
         /* Do not vspace directly after Ss/Sh. */          /* Do not vspace directly after Ss/Sh. */
Line 595  print_bvspace(struct termp *p, 
Line 594  print_bvspace(struct termp *p, 
   
         /* A `-column' does not assert vspace within the list. */          /* A `-column' does not assert vspace within the list. */
   
         if (MDOC_Bl == bl->tok && LIST_column == bl->data.Bl.type)          if (MDOC_Bl == bl->tok && LIST_column == bl->data.Bl->type)
                 if (n->prev && MDOC_It == n->prev->tok)                  if (n->prev && MDOC_It == n->prev->tok)
                         return;                          return;
   
         /* A `-diag' without body does not vspace. */          /* A `-diag' without body does not vspace. */
   
         if (MDOC_Bl == bl->tok && LIST_diag == bl->data.Bl.type)          if (MDOC_Bl == bl->tok && LIST_diag == bl->data.Bl->type)
                 if (n->prev && MDOC_It == n->prev->tok) {                  if (n->prev && MDOC_It == n->prev->tok) {
                         assert(n->prev->body);                          assert(n->prev->body);
                         if (NULL == n->prev->body->child)                          if (NULL == n->prev->body->child)
Line 655  termp_it_pre(DECL_ARGS)
Line 654  termp_it_pre(DECL_ARGS)
         }          }
   
         bl = n->parent->parent->parent;          bl = n->parent->parent->parent;
         type = bl->data.Bl.type;          assert(bl->data.Bl);
           type = bl->data.Bl->type;
   
         /*          /*
          * First calculate width and offset.  This is pretty easy unless           * First calculate width and offset.  This is pretty easy unless
Line 665  termp_it_pre(DECL_ARGS)
Line 665  termp_it_pre(DECL_ARGS)
   
         width = offset = 0;          width = offset = 0;
   
         if (bl->data.Bl.offs)          if (bl->data.Bl->offs)
                 offset = a2offs(p, bl->data.Bl.offs);                  offset = a2offs(p, bl->data.Bl->offs);
   
         switch (type) {          switch (type) {
         case (LIST_column):          case (LIST_column):
Line 716  termp_it_pre(DECL_ARGS)
Line 716  termp_it_pre(DECL_ARGS)
                 width = a2width(p, bl->args->argv[col].value[i]) + dcol;                  width = a2width(p, bl->args->argv[col].value[i]) + dcol;
                 break;                  break;
         default:          default:
                 if (NULL == bl->data.Bl.width)                  if (NULL == bl->data.Bl->width)
                         break;                          break;
   
                 /*                  /*
Line 724  termp_it_pre(DECL_ARGS)
Line 724  termp_it_pre(DECL_ARGS)
                  * number for buffering single arguments.  See the above                   * number for buffering single arguments.  See the above
                  * handling for column for how this changes.                   * handling for column for how this changes.
                  */                   */
                 assert(bl->data.Bl.width);                  assert(bl->data.Bl->width);
                 width = a2width(p, bl->data.Bl.width) + term_len(p, 2);                  width = a2width(p, bl->data.Bl->width) + term_len(p, 2);
                 break;                  break;
         }          }
   
Line 987  termp_it_post(DECL_ARGS)
Line 987  termp_it_post(DECL_ARGS)
         if (MDOC_BLOCK == n->type)          if (MDOC_BLOCK == n->type)
                 return;                  return;
   
         type = n->parent->parent->parent->data.Bl.type;          type = n->parent->parent->parent->data.Bl->type;
   
         switch (type) {          switch (type) {
         case (LIST_item):          case (LIST_item):
Line 1648  termp_bd_pre(DECL_ARGS)
Line 1648  termp_bd_pre(DECL_ARGS)
         } else if (MDOC_HEAD == n->type)          } else if (MDOC_HEAD == n->type)
                 return(0);                  return(0);
   
         if (n->data.Bd.offs)          assert(n->data.Bd);
                 p->offset += a2offs(p, n->data.Bd.offs);          if (n->data.Bd->offs)
                   p->offset += a2offs(p, n->data.Bd->offs);
   
         /*          /*
          * If -ragged or -filled are specified, the block does nothing           * If -ragged or -filled are specified, the block does nothing
Line 1659  termp_bd_pre(DECL_ARGS)
Line 1660  termp_bd_pre(DECL_ARGS)
          * lines are allowed.           * lines are allowed.
          */           */
   
         if (DISP_literal != n->data.Bd.type &&          if (DISP_literal != n->data.Bd->type &&
                         DISP_unfilled != n->data.Bd.type)                          DISP_unfilled != n->data.Bd->type)
                 return(1);                  return(1);
   
         tabwidth = p->tabwidth;          tabwidth = p->tabwidth;
Line 1697  termp_bd_post(DECL_ARGS)
Line 1698  termp_bd_post(DECL_ARGS)
         rm = p->rmargin;          rm = p->rmargin;
         rmax = p->maxrmargin;          rmax = p->maxrmargin;
   
         if (DISP_literal == n->data.Bd.type ||          assert(n->data.Bd);
                         DISP_unfilled == n->data.Bd.type)          if (DISP_literal == n->data.Bd->type ||
                           DISP_unfilled == n->data.Bd->type)
                 p->rmargin = p->maxrmargin = TERM_MAXMARGIN;                  p->rmargin = p->maxrmargin = TERM_MAXMARGIN;
   
         p->flags |= TERMP_NOSPACE;          p->flags |= TERMP_NOSPACE;

Legend:
Removed from v.1.164  
changed lines
  Added in v.1.165

CVSweb