[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.259 and 1.263

version 1.259, 2014/02/16 12:33:39 version 1.263, 2014/04/08 07:13:12
Line 104  static int   termp_ft_pre(DECL_ARGS);
Line 104  static int   termp_ft_pre(DECL_ARGS);
 static  int       termp_in_pre(DECL_ARGS);  static  int       termp_in_pre(DECL_ARGS);
 static  int       termp_it_pre(DECL_ARGS);  static  int       termp_it_pre(DECL_ARGS);
 static  int       termp_li_pre(DECL_ARGS);  static  int       termp_li_pre(DECL_ARGS);
   static  int       termp_ll_pre(DECL_ARGS);
 static  int       termp_lk_pre(DECL_ARGS);  static  int       termp_lk_pre(DECL_ARGS);
 static  int       termp_nd_pre(DECL_ARGS);  static  int       termp_nd_pre(DECL_ARGS);
 static  int       termp_nm_pre(DECL_ARGS);  static  int       termp_nm_pre(DECL_ARGS);
Line 244  static const struct termact termacts[MDOC_MAX] = {
Line 245  static const struct termact termacts[MDOC_MAX] = {
         { termp_sp_pre, NULL }, /* sp */          { termp_sp_pre, NULL }, /* sp */
         { NULL, termp____post }, /* %U */          { NULL, termp____post }, /* %U */
         { NULL, NULL }, /* Ta */          { NULL, NULL }, /* Ta */
           { termp_ll_pre, NULL }, /* ll */
 };  };
   
   
Line 384  print_mdoc_node(DECL_ARGS)
Line 386  print_mdoc_node(DECL_ARGS)
         if (MDOC_EOS & n->flags)          if (MDOC_EOS & n->flags)
                 p->flags |= TERMP_SENTENCE;                  p->flags |= TERMP_SENTENCE;
   
         p->offset = offset;          if (MDOC_ll != n->tok) {
         p->rmargin = rmargin;                  p->offset = offset;
                   p->rmargin = rmargin;
           }
 }  }
   
   
Line 615  print_bvspace(struct termp *p, 
Line 619  print_bvspace(struct termp *p, 
   
 /* ARGSUSED */  /* ARGSUSED */
 static int  static int
   termp_ll_pre(DECL_ARGS)
   {
   
           term_setwidth(p, n->nchild ? n->child->string : NULL);
           return(0);
   }
   
   
   /* ARGSUSED */
   static int
 termp_it_pre(DECL_ARGS)  termp_it_pre(DECL_ARGS)
 {  {
         const struct mdoc_node *bl, *nn;          const struct mdoc_node *bl, *nn;
Line 805  termp_it_pre(DECL_ARGS)
Line 819  termp_it_pre(DECL_ARGS)
                                  MDOC_Bd == n->next->child->tok))                                   MDOC_Bd == n->next->child->tok))
                         break;                          break;
   
                 p->flags |= TERMP_NOBREAK | TERMP_HANG;                  p->flags |= TERMP_NOBREAK | TERMP_BRIND | TERMP_HANG;
                 p->trailspace = 1;                  p->trailspace = 1;
                 break;                  break;
         case (LIST_tag):          case (LIST_tag):
                 if (MDOC_HEAD != n->type)                  if (MDOC_HEAD != n->type)
                         break;                          break;
   
                 p->flags |= TERMP_NOBREAK;                  p->flags |= TERMP_NOBREAK | TERMP_BRIND;
                 p->trailspace = 2;                  p->trailspace = 2;
   
                 if (NULL == n->next || NULL == n->next->child)                  if (NULL == n->next || NULL == n->next->child)
Line 834  termp_it_pre(DECL_ARGS)
Line 848  termp_it_pre(DECL_ARGS)
         case (LIST_diag):          case (LIST_diag):
                 if (MDOC_HEAD != n->type)                  if (MDOC_HEAD != n->type)
                         break;                          break;
                 p->flags |= TERMP_NOBREAK;                  p->flags |= TERMP_NOBREAK | TERMP_BRIND;
                 p->trailspace = 1;                  p->trailspace = 1;
                 break;                  break;
         default:          default:
Line 988  termp_it_post(DECL_ARGS)
Line 1002  termp_it_post(DECL_ARGS)
          * has munged them in the meanwhile.           * has munged them in the meanwhile.
          */           */
   
         p->flags &= ~TERMP_DANGLE;          p->flags &= ~(TERMP_NOBREAK | TERMP_BRIND |
         p->flags &= ~TERMP_NOBREAK;                          TERMP_DANGLE | TERMP_HANG);
         p->flags &= ~TERMP_HANG;  
         p->trailspace = 0;          p->trailspace = 0;
 }  }
   
Line 1015  termp_nm_pre(DECL_ARGS)
Line 1028  termp_nm_pre(DECL_ARGS)
                      MDOC_TEXT == n->prev->child->type ?                       MDOC_TEXT == n->prev->child->type ?
                      term_strlen(p, n->prev->child->string) :                       term_strlen(p, n->prev->child->string) :
                      term_len(p, 5));                       term_len(p, 5));
                   if (p->rmargin < p->offset)
                           p->rmargin = p->offset;
                 return(1);                  return(1);
         }          }
   
Line 1025  termp_nm_pre(DECL_ARGS)
Line 1040  termp_nm_pre(DECL_ARGS)
                 synopsis_pre(p, n->parent);                  synopsis_pre(p, n->parent);
   
         if (MDOC_HEAD == n->type && n->next->child) {          if (MDOC_HEAD == n->type && n->next->child) {
                 p->flags |= TERMP_NOSPACE | TERMP_NOBREAK;                  p->flags |= TERMP_NOSPACE | TERMP_NOBREAK | TERMP_BRIND;
                 p->trailspace = 1;                  p->trailspace = 1;
                 p->rmargin = p->offset + term_len(p, 1);                  p->rmargin = p->offset + term_len(p, 1);
                 if (NULL == n->child) {                  if (NULL == n->child) {
Line 1056  termp_nm_post(DECL_ARGS)
Line 1071  termp_nm_post(DECL_ARGS)
                 p->flags &= ~(TERMP_KEEP | TERMP_PREKEEP);                  p->flags &= ~(TERMP_KEEP | TERMP_PREKEEP);
         } else if (MDOC_HEAD == n->type && n->next->child) {          } else if (MDOC_HEAD == n->type && n->next->child) {
                 term_flushln(p);                  term_flushln(p);
                 p->flags &= ~(TERMP_NOBREAK | TERMP_HANG);                  p->flags &= ~(TERMP_NOBREAK | TERMP_BRIND | TERMP_HANG);
                 p->trailspace = 0;                  p->trailspace = 0;
         } else if (MDOC_BODY == n->type && n->child)          } else if (MDOC_BODY == n->type && n->child)
                 term_flushln(p);                  term_flushln(p);
Line 1545  termp_fn_pre(DECL_ARGS)
Line 1560  termp_fn_pre(DECL_ARGS)
         if (pretty) {          if (pretty) {
                 rmargin = p->rmargin;                  rmargin = p->rmargin;
                 p->rmargin = p->offset + term_len(p, 4);                  p->rmargin = p->offset + term_len(p, 4);
                 p->flags |= TERMP_NOBREAK | TERMP_HANG;                  p->flags |= TERMP_NOBREAK | TERMP_BRIND | TERMP_HANG;
         }          }
   
         assert(MDOC_TEXT == n->type);          assert(MDOC_TEXT == n->type);
Line 1555  termp_fn_pre(DECL_ARGS)
Line 1570  termp_fn_pre(DECL_ARGS)
   
         if (pretty) {          if (pretty) {
                 term_flushln(p);                  term_flushln(p);
                 p->flags &= ~(TERMP_NOBREAK | TERMP_HANG);                  p->flags &= ~(TERMP_NOBREAK | TERMP_BRIND | TERMP_HANG);
                 p->offset = p->rmargin;                  p->offset = p->rmargin;
                 p->rmargin = rmargin;                  p->rmargin = rmargin;
         }          }
Line 2047  termp_fo_pre(DECL_ARGS)
Line 2062  termp_fo_pre(DECL_ARGS)
                 if (pretty) {                  if (pretty) {
                         rmargin = p->rmargin;                          rmargin = p->rmargin;
                         p->rmargin = p->offset + term_len(p, 4);                          p->rmargin = p->offset + term_len(p, 4);
                         p->flags |= TERMP_NOBREAK | TERMP_HANG;                          p->flags |= TERMP_NOBREAK | TERMP_BRIND |
                                           TERMP_HANG;
                 }                  }
                 p->flags |= TERMP_NOSPACE;                  p->flags |= TERMP_NOSPACE;
                 term_word(p, "(");                  term_word(p, "(");
                 p->flags |= TERMP_NOSPACE;                  p->flags |= TERMP_NOSPACE;
                 if (pretty) {                  if (pretty) {
                         term_flushln(p);                          term_flushln(p);
                         p->flags &= ~(TERMP_NOBREAK | TERMP_HANG);                          p->flags &= ~(TERMP_NOBREAK | TERMP_BRIND |
                                           TERMP_HANG);
                         p->offset = p->rmargin;                          p->offset = p->rmargin;
                         p->rmargin = rmargin;                          p->rmargin = rmargin;
                 }                  }

Legend:
Removed from v.1.259  
changed lines
  Added in v.1.263

CVSweb