[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.129 and 1.137

version 1.129, 2010/05/24 21:34:16 version 1.137, 2010/06/04 21:05:39
Line 260  static const struct termact termacts[MDOC_MAX] = {
Line 260  static const struct termact termacts[MDOC_MAX] = {
         { termp_sp_pre, NULL }, /* br */          { termp_sp_pre, NULL }, /* br */
         { termp_sp_pre, NULL }, /* sp */          { termp_sp_pre, NULL }, /* sp */
         { termp_under_pre, termp____post }, /* %U */          { termp_under_pre, termp____post }, /* %U */
           { NULL, NULL }, /* Ta */
 };  };
   
   
Line 700  termp_it_pre(DECL_ARGS)
Line 701  termp_it_pre(DECL_ARGS)
   
         switch (type) {          switch (type) {
         case (LIST_column):          case (LIST_column):
                 if (MDOC_BODY == n->type)                  if (MDOC_HEAD == n->type)
                         break;                          break;
                 /*                  /*
                  * Imitate groff's column handling:                   * Imitate groff's column handling:
Line 715  termp_it_pre(DECL_ARGS)
Line 716  termp_it_pre(DECL_ARGS)
                 /* LINTED */                  /* LINTED */
                 dcol = ncols < 5 ? 4 : ncols == 5 ? 3 : 1;                  dcol = ncols < 5 ? 4 : ncols == 5 ? 3 : 1;
   
                   /*
                    * Calculate the offset by applying all prior MDOC_BODY,
                    * so we stop at the MDOC_HEAD (NULL == nn->prev).
                    */
   
                 for (i = 0, nn = n->prev;                  for (i = 0, nn = n->prev;
                                 nn && i < (int)ncols;                                  nn->prev && i < (int)ncols;
                                 nn = nn->prev, i++)                                  nn = nn->prev, i++)
                         offset += dcol + a2width                          offset += dcol + a2width
                                 (&bl->args->argv[vals[2]], i);                                  (&bl->args->argv[vals[2]], i);
Line 869  termp_it_pre(DECL_ARGS)
Line 875  termp_it_pre(DECL_ARGS)
                         p->flags |= TERMP_DANGLE;                          p->flags |= TERMP_DANGLE;
                 break;                  break;
         case (LIST_column):          case (LIST_column):
                 if (MDOC_HEAD == n->type) {                  if (MDOC_HEAD == n->type)
                         assert(n->next);                          break;
                         if (MDOC_BODY == n->next->type)  
                                 p->flags &= ~TERMP_NOBREAK;                  if (NULL == n->next)
                         else                          p->flags &= ~TERMP_NOBREAK;
                                 p->flags |= TERMP_NOBREAK;                  else
                         if (n->prev)                          p->flags |= TERMP_NOBREAK;
                                 p->flags |= TERMP_NOLPAD;  
                 }                  assert(n->prev);
                   if (MDOC_BODY == n->prev->type)
                           p->flags |= TERMP_NOLPAD;
   
                 break;                  break;
         case (LIST_diag):          case (LIST_diag):
                 if (MDOC_HEAD == n->type)                  if (MDOC_HEAD == n->type)
Line 929  termp_it_pre(DECL_ARGS)
Line 938  termp_it_pre(DECL_ARGS)
                  * XXX - this behaviour is not documented: the                   * XXX - this behaviour is not documented: the
                  * right-most column is filled to the right margin.                   * right-most column is filled to the right margin.
                  */                   */
                 if (MDOC_HEAD == n->type &&                  if (MDOC_HEAD == n->type)
                                 MDOC_BODY == n->next->type &&                          break;
                                 p->rmargin < p->maxrmargin)                  if (NULL == n->next && p->rmargin < p->maxrmargin)
                         p->rmargin = p->maxrmargin;                          p->rmargin = p->maxrmargin;
                 break;                  break;
         default:          default:
Line 985  termp_it_pre(DECL_ARGS)
Line 994  termp_it_pre(DECL_ARGS)
                         return(0);                          return(0);
                 break;                  break;
         case (LIST_column):          case (LIST_column):
                 if (MDOC_BODY == n->type)                  if (MDOC_HEAD == n->type)
                         return(0);                          return(0);
                 break;                  break;
         default:          default:
Line 1014  termp_it_post(DECL_ARGS)
Line 1023  termp_it_post(DECL_ARGS)
                 /* FALLTHROUGH */                  /* FALLTHROUGH */
         case (LIST_inset):          case (LIST_inset):
                 if (MDOC_BODY == n->type)                  if (MDOC_BODY == n->type)
                         term_flushln(p);                          term_newln(p);
                 break;                  break;
         case (LIST_column):          case (LIST_column):
                 if (MDOC_HEAD == n->type)                  if (MDOC_BODY == n->type)
                         term_flushln(p);                          term_flushln(p);
                 break;                  break;
         default:          default:
                 term_flushln(p);                  term_newln(p);
                 break;                  break;
         }          }
   
Line 1192  termp_rv_pre(DECL_ARGS)
Line 1201  termp_rv_pre(DECL_ARGS)
         term_fontpop(p);          term_fontpop(p);
   
         term_word(p, "is set to indicate the error.");          term_word(p, "is set to indicate the error.");
           p->flags |= TERMP_SENTENCE;
   
         return(0);          return(0);
 }  }
Line 1224  termp_ex_pre(DECL_ARGS)
Line 1234  termp_ex_pre(DECL_ARGS)
                 term_word(p, "utility exits");                  term_word(p, "utility exits");
   
         term_word(p, "0 on success, and >0 if an error occurs.");          term_word(p, "0 on success, and >0 if an error occurs.");
           p->flags |= TERMP_SENTENCE;
   
         return(0);          return(0);
 }  }
Line 1347  static void
Line 1358  static void
 termp_fd_post(DECL_ARGS)  termp_fd_post(DECL_ARGS)
 {  {
   
         if (n->sec != SEC_SYNOPSIS || ! (MDOC_LINE & n->flags))  
                 return;  
   
         term_newln(p);          term_newln(p);
         if (n->next && MDOC_Fd != n->next->tok)  
                 term_vspace(p);  
 }  }
   
   
Line 1425  termp_bt_pre(DECL_ARGS)
Line 1431  termp_bt_pre(DECL_ARGS)
 {  {
   
         term_word(p, "is currently in beta test.");          term_word(p, "is currently in beta test.");
           p->flags |= TERMP_SENTENCE;
         return(0);          return(0);
 }  }
   
Line 1445  termp_ud_pre(DECL_ARGS)
Line 1452  termp_ud_pre(DECL_ARGS)
 {  {
   
         term_word(p, "currently under development.");          term_word(p, "currently under development.");
           p->flags |= TERMP_SENTENCE;
         return(0);          return(0);
 }  }
   
Line 1633  termp_bd_pre(DECL_ARGS)
Line 1641  termp_bd_pre(DECL_ARGS)
         for (nn = n->child; nn; nn = nn->next) {          for (nn = n->child; nn; nn = nn->next) {
                 p->flags |= TERMP_NOSPACE;                  p->flags |= TERMP_NOSPACE;
                 print_mdoc_node(p, pair, m, nn);                  print_mdoc_node(p, pair, m, nn);
                 if (NULL == nn->next)                  if (NULL == nn->prev ||
                         continue;                      nn->prev->line < nn->line ||
                 if (nn->prev && nn->prev->line < nn->line)                      NULL == nn->next)
                         term_flushln(p);                          term_flushln(p);
                 else if (NULL == nn->prev)  
                         term_flushln(p);  
         }          }
         p->tabwidth = tabwidth;          p->tabwidth = tabwidth;
   
Line 1668  termp_bd_post(DECL_ARGS)
Line 1674  termp_bd_post(DECL_ARGS)
                 p->rmargin = p->maxrmargin = TERM_MAXMARGIN;                  p->rmargin = p->maxrmargin = TERM_MAXMARGIN;
   
         p->flags |= TERMP_NOSPACE;          p->flags |= TERMP_NOSPACE;
         term_flushln(p);          term_newln(p);
   
         p->rmargin = rm;          p->rmargin = rm;
         p->maxrmargin = rmax;          p->maxrmargin = rmax;
Line 1861  termp_in_post(DECL_ARGS)
Line 1867  termp_in_post(DECL_ARGS)
         term_word(p, ">");          term_word(p, ">");
         term_fontpop(p);          term_fontpop(p);
   
         if (SEC_SYNOPSIS != n->sec && ! (MDOC_LINE & n->flags))          if (SEC_SYNOPSIS != n->sec || ! (MDOC_LINE & n->flags))
                 return;                  return;
   
         term_newln(p);          term_newln(p);

Legend:
Removed from v.1.129  
changed lines
  Added in v.1.137

CVSweb