[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.337 and 1.338

version 1.337, 2017/01/10 12:53:07 version 1.338, 2017/01/10 13:47:00
Line 319  print_mdoc_node(DECL_ARGS)
Line 319  print_mdoc_node(DECL_ARGS)
         chld = 1;          chld = 1;
         offset = p->offset;          offset = p->offset;
         rmargin = p->rmargin;          rmargin = p->rmargin;
         n->flags &= ~MDOC_ENDED;          n->flags &= ~NODE_ENDED;
         n->prev_font = p->fonti;          n->prev_font = p->fonti;
   
         memset(&npair, 0, sizeof(struct termpair));          memset(&npair, 0, sizeof(struct termpair));
Line 330  print_mdoc_node(DECL_ARGS)
Line 330  print_mdoc_node(DECL_ARGS)
          * invoked in a prior line, revert it to PREKEEP.           * invoked in a prior line, revert it to PREKEEP.
          */           */
   
         if (p->flags & TERMP_KEEP && n->flags & MDOC_LINE) {          if (p->flags & TERMP_KEEP && n->flags & NODE_LINE) {
                 p->flags &= ~TERMP_KEEP;                  p->flags &= ~TERMP_KEEP;
                 p->flags |= TERMP_PREKEEP;                  p->flags |= TERMP_PREKEEP;
         }          }
Line 342  print_mdoc_node(DECL_ARGS)
Line 342  print_mdoc_node(DECL_ARGS)
   
         switch (n->type) {          switch (n->type) {
         case ROFFT_TEXT:          case ROFFT_TEXT:
                 if (' ' == *n->string && MDOC_LINE & n->flags)                  if (' ' == *n->string && NODE_LINE & n->flags)
                         term_newln(p);                          term_newln(p);
                 if (MDOC_DELIMC & n->flags)                  if (NODE_DELIMC & n->flags)
                         p->flags |= TERMP_NOSPACE;                          p->flags |= TERMP_NOSPACE;
                 term_word(p, n->string);                  term_word(p, n->string);
                 if (MDOC_DELIMO & n->flags)                  if (NODE_DELIMO & n->flags)
                         p->flags |= TERMP_NOSPACE;                          p->flags |= TERMP_NOSPACE;
                 break;                  break;
         case ROFFT_EQN:          case ROFFT_EQN:
                 if ( ! (n->flags & MDOC_LINE))                  if ( ! (n->flags & NODE_LINE))
                         p->flags |= TERMP_NOSPACE;                          p->flags |= TERMP_NOSPACE;
                 term_eqn(p, n->eqn);                  term_eqn(p, n->eqn);
                 if (n->next != NULL && ! (n->next->flags & MDOC_LINE))                  if (n->next != NULL && ! (n->next->flags & NODE_LINE))
                         p->flags |= TERMP_NOSPACE;                          p->flags |= TERMP_NOSPACE;
                 break;                  break;
         case ROFFT_TBL:          case ROFFT_TBL:
Line 384  print_mdoc_node(DECL_ARGS)
Line 384  print_mdoc_node(DECL_ARGS)
         case ROFFT_EQN:          case ROFFT_EQN:
                 break;                  break;
         default:          default:
                 if ( ! termacts[n->tok].post || MDOC_ENDED & n->flags)                  if ( ! termacts[n->tok].post || NODE_ENDED & n->flags)
                         break;                          break;
                 (void)(*termacts[n->tok].post)(p, &npair, meta, n);                  (void)(*termacts[n->tok].post)(p, &npair, meta, n);
   
Line 394  print_mdoc_node(DECL_ARGS)
Line 394  print_mdoc_node(DECL_ARGS)
                  * that it must not call the post handler again.                   * that it must not call the post handler again.
                  */                   */
                 if (ENDBODY_NOT != n->end)                  if (ENDBODY_NOT != n->end)
                         n->body->flags |= MDOC_ENDED;                          n->body->flags |= NODE_ENDED;
   
                 /*                  /*
                  * End of line terminating an implicit block                   * End of line terminating an implicit block
Line 406  print_mdoc_node(DECL_ARGS)
Line 406  print_mdoc_node(DECL_ARGS)
                 break;                  break;
         }          }
   
         if (MDOC_EOS & n->flags)          if (NODE_EOS & n->flags)
                 p->flags |= TERMP_SENTENCE;                  p->flags |= TERMP_SENTENCE;
   
         if (MDOC_ll != n->tok) {          if (MDOC_ll != n->tok) {
Line 1051  termp_fl_pre(DECL_ARGS)
Line 1051  termp_fl_pre(DECL_ARGS)
         if (!(n->child == NULL &&          if (!(n->child == NULL &&
             (n->next == NULL ||              (n->next == NULL ||
              n->next->type == ROFFT_TEXT ||               n->next->type == ROFFT_TEXT ||
              n->next->flags & MDOC_LINE)))               n->next->flags & NODE_LINE)))
                 p->flags |= TERMP_NOSPACE;                  p->flags |= TERMP_NOSPACE;
   
         return 1;          return 1;
Line 1096  static int
Line 1096  static int
 termp_ns_pre(DECL_ARGS)  termp_ns_pre(DECL_ARGS)
 {  {
   
         if ( ! (MDOC_LINE & n->flags))          if ( ! (NODE_LINE & n->flags))
                 p->flags |= TERMP_NOSPACE;                  p->flags |= TERMP_NOSPACE;
         return 1;          return 1;
 }  }
Line 1262  synopsis_pre(struct termp *p, const struct roff_node *
Line 1262  synopsis_pre(struct termp *p, const struct roff_node *
          * Obviously, if we're not in a SYNOPSIS or no prior macros           * Obviously, if we're not in a SYNOPSIS or no prior macros
          * exist, do nothing.           * exist, do nothing.
          */           */
         if (NULL == n->prev || ! (MDOC_SYNPRETTY & n->flags))          if (NULL == n->prev || ! (NODE_SYNPRETTY & n->flags))
                 return;                  return;
   
         /*          /*
Line 1411  static void
Line 1411  static void
 termp_lb_post(DECL_ARGS)  termp_lb_post(DECL_ARGS)
 {  {
   
         if (SEC_LIBRARY == n->sec && MDOC_LINE & n->flags)          if (SEC_LIBRARY == n->sec && NODE_LINE & n->flags)
                 term_newln(p);                  term_newln(p);
 }  }
   
Line 1439  static int
Line 1439  static int
 termp_ft_pre(DECL_ARGS)  termp_ft_pre(DECL_ARGS)
 {  {
   
         /* NB: MDOC_LINE does not effect this! */          /* NB: NODE_LINE does not effect this! */
         synopsis_pre(p, n);          synopsis_pre(p, n);
         term_fontpush(p, TERMFONT_UNDER);          term_fontpush(p, TERMFONT_UNDER);
         return 1;          return 1;
Line 1451  termp_fn_pre(DECL_ARGS)
Line 1451  termp_fn_pre(DECL_ARGS)
         size_t           rmargin = 0;          size_t           rmargin = 0;
         int              pretty;          int              pretty;
   
         pretty = MDOC_SYNPRETTY & n->flags;          pretty = NODE_SYNPRETTY & n->flags;
   
         synopsis_pre(p, n);          synopsis_pre(p, n);
   
Line 1617  termp_bd_pre(DECL_ARGS)
Line 1617  termp_bd_pre(DECL_ARGS)
                         break;                          break;
                 }                  }
                 if (p->flags & TERMP_NONEWLINE ||                  if (p->flags & TERMP_NONEWLINE ||
                     (nn->next && ! (nn->next->flags & MDOC_LINE)))                      (nn->next && ! (nn->next->flags & NODE_LINE)))
                         continue;                          continue;
                 term_flushln(p);                  term_flushln(p);
                 p->flags |= TERMP_NOSPACE;                  p->flags |= TERMP_NOSPACE;
Line 1718  static void
Line 1718  static void
 termp_pf_post(DECL_ARGS)  termp_pf_post(DECL_ARGS)
 {  {
   
         if ( ! (n->next == NULL || n->next->flags & MDOC_LINE))          if ( ! (n->next == NULL || n->next->flags & NODE_LINE))
                 p->flags |= TERMP_NOSPACE;                  p->flags |= TERMP_NOSPACE;
 }  }
   
Line 1773  termp_in_pre(DECL_ARGS)
Line 1773  termp_in_pre(DECL_ARGS)
   
         synopsis_pre(p, n);          synopsis_pre(p, n);
   
         if (MDOC_SYNPRETTY & n->flags && MDOC_LINE & n->flags) {          if (NODE_SYNPRETTY & n->flags && NODE_LINE & n->flags) {
                 term_fontpush(p, TERMFONT_BOLD);                  term_fontpush(p, TERMFONT_BOLD);
                 term_word(p, "#include");                  term_word(p, "#include");
                 term_word(p, "<");                  term_word(p, "<");
Line 1790  static void
Line 1790  static void
 termp_in_post(DECL_ARGS)  termp_in_post(DECL_ARGS)
 {  {
   
         if (MDOC_SYNPRETTY & n->flags)          if (NODE_SYNPRETTY & n->flags)
                 term_fontpush(p, TERMFONT_BOLD);                  term_fontpush(p, TERMFONT_BOLD);
   
         p->flags |= TERMP_NOSPACE;          p->flags |= TERMP_NOSPACE;
         term_word(p, ">");          term_word(p, ">");
   
         if (MDOC_SYNPRETTY & n->flags)          if (NODE_SYNPRETTY & n->flags)
                 term_fontpop(p);                  term_fontpop(p);
 }  }
   
Line 2003  termp_fo_pre(DECL_ARGS)
Line 2003  termp_fo_pre(DECL_ARGS)
         size_t           rmargin = 0;          size_t           rmargin = 0;
         int              pretty;          int              pretty;
   
         pretty = MDOC_SYNPRETTY & n->flags;          pretty = NODE_SYNPRETTY & n->flags;
   
         if (n->type == ROFFT_BLOCK) {          if (n->type == ROFFT_BLOCK) {
                 synopsis_pre(p, n);                  synopsis_pre(p, n);
Line 2049  termp_fo_post(DECL_ARGS)
Line 2049  termp_fo_post(DECL_ARGS)
         p->flags |= TERMP_NOSPACE;          p->flags |= TERMP_NOSPACE;
         term_word(p, ")");          term_word(p, ")");
   
         if (MDOC_SYNPRETTY & n->flags) {          if (NODE_SYNPRETTY & n->flags) {
                 p->flags |= TERMP_NOSPACE;                  p->flags |= TERMP_NOSPACE;
                 term_word(p, ";");                  term_word(p, ";");
                 term_flushln(p);                  term_flushln(p);

Legend:
Removed from v.1.337  
changed lines
  Added in v.1.338

CVSweb