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

Diff for /mandoc/mdoc_man.c between version 1.81 and 1.85

version 1.81, 2014/12/24 23:32:42 version 1.85, 2015/02/06 03:38:45
Line 1 
Line 1 
 /*      $Id$ */  /*      $Id$ */
 /*  /*
  * Copyright (c) 2011, 2012, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org>   * Copyright (c) 2011-2015 Ingo Schwarze <schwarze@openbsd.org>
  *   *
  * Permission to use, copy, modify, and distribute this software for any   * Permission to use, copy, modify, and distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above   * purpose with or without fee is hereby granted, provided that the above
Line 879  static int
Line 879  static int
 pre_aq(DECL_ARGS)  pre_aq(DECL_ARGS)
 {  {
   
         print_word(n->parent->prev != NULL &&          print_word(n->nchild == 1 &&
             n->parent->prev->tok == MDOC_An ?  "<" : "\\(la");              n->child->tok == MDOC_Mt ?  "<" : "\\(la");
         outflags &= ~MMAN_spc;          outflags &= ~MMAN_spc;
         return(1);          return(1);
 }  }
Line 890  post_aq(DECL_ARGS)
Line 890  post_aq(DECL_ARGS)
 {  {
   
         outflags &= ~(MMAN_spc | MMAN_nl);          outflags &= ~(MMAN_spc | MMAN_nl);
         print_word(n->parent->prev != NULL &&          print_word(n->nchild == 1 &&
             n->parent->prev->tok == MDOC_An ?  ">" : "\\(ra");              n->child->tok == MDOC_Mt ?  ">" : "\\(ra");
 }  }
   
 static int  static int
Line 1006  pre_bl(DECL_ARGS)
Line 1006  pre_bl(DECL_ARGS)
                 return(1);                  return(1);
         }          }
   
         print_line(".TS", MMAN_nl);          if (n->nchild) {
         for (icol = 0; icol < n->norm->Bl.ncols; icol++)                  print_line(".TS", MMAN_nl);
                 print_word("l");                  for (icol = 0; icol < n->norm->Bl.ncols; icol++)
         print_word(".");                          print_word("l");
                   print_word(".");
           }
         outflags |= MMAN_nl;          outflags |= MMAN_nl;
         return(1);          return(1);
 }  }
Line 1020  post_bl(DECL_ARGS)
Line 1022  post_bl(DECL_ARGS)
   
         switch (n->norm->Bl.type) {          switch (n->norm->Bl.type) {
         case LIST_column:          case LIST_column:
                 print_line(".TE", 0);                  if (n->nchild)
                           print_line(".TE", 0);
                 break;                  break;
         case LIST_enum:          case LIST_enum:
                 n->norm->Bl.count = 0;                  n->norm->Bl.count = 0;
Line 1131  static int
Line 1134  static int
 pre_eo(DECL_ARGS)  pre_eo(DECL_ARGS)
 {  {
   
         outflags &= ~(MMAN_spc | MMAN_nl);          if (n->end == ENDBODY_NOT &&
               n->parent->head->child == NULL &&
               n->child != NULL &&
               n->child->end != ENDBODY_NOT)
                   print_word("\\&");
           else if (n->end != ENDBODY_NOT ? n->child != NULL :
               n->parent->head->child != NULL &&
               (n->parent->body->child != NULL ||
                n->parent->tail->child != NULL))
                   outflags &= ~(MMAN_spc | MMAN_nl);
         return(1);          return(1);
 }  }
   
 static void  static void
 post_eo(DECL_ARGS)  post_eo(DECL_ARGS)
 {  {
           int      body, tail;
   
         if (n->end != ENDBODY_SPACE)          if (n->end != ENDBODY_NOT) {
                   outflags |= MMAN_spc;
                   return;
           }
   
           body = n->child != NULL || n->parent->head->child != NULL;
           tail = n->parent->tail != NULL && n->parent->tail->child != NULL;
   
           if (body && tail)
                 outflags &= ~MMAN_spc;                  outflags &= ~MMAN_spc;
           else if ( ! (body || tail))
                   print_word("\\&");
           else if ( ! tail)
                   outflags |= MMAN_spc;
 }  }
   
 static int  static int
Line 1259  pre_fo(DECL_ARGS)
Line 1284  pre_fo(DECL_ARGS)
                 pre_syn(n);                  pre_syn(n);
                 break;                  break;
         case MDOC_HEAD:          case MDOC_HEAD:
                   if (n->child == NULL)
                           return(0);
                 if (MDOC_SYNPRETTY & n->flags)                  if (MDOC_SYNPRETTY & n->flags)
                         print_block(".HP 4n", MMAN_nl);                          print_block(".HP 4n", MMAN_nl);
                 font_push('B');                  font_push('B');
                 break;                  break;
         case MDOC_BODY:          case MDOC_BODY:
                 outflags &= ~MMAN_spc;                  outflags &= ~(MMAN_spc | MMAN_nl);
                 print_word("(");                  print_word("(");
                 outflags &= ~MMAN_spc;                  outflags &= ~MMAN_spc;
                 break;                  break;
Line 1280  post_fo(DECL_ARGS)
Line 1307  post_fo(DECL_ARGS)
   
         switch (n->type) {          switch (n->type) {
         case MDOC_HEAD:          case MDOC_HEAD:
                 font_pop();                  if (n->child != NULL)
                           font_pop();
                 break;                  break;
         case MDOC_BODY:          case MDOC_BODY:
                 post_fn(meta, n);                  post_fn(meta, n);

Legend:
Removed from v.1.81  
changed lines
  Added in v.1.85

CVSweb