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

Diff for /mandoc/mdoc_macro.c between version 1.209 and 1.210

version 1.209, 2016/08/20 17:59:34 version 1.210, 2017/01/10 13:47:00
Line 216  mdoc_endparse(struct roff_man *mdoc)
Line 216  mdoc_endparse(struct roff_man *mdoc)
   
         /* Scan for open explicit scopes. */          /* Scan for open explicit scopes. */
   
         n = mdoc->last->flags & MDOC_VALID ?          n = mdoc->last->flags & NODE_VALID ?
             mdoc->last->parent : mdoc->last;              mdoc->last->parent : mdoc->last;
   
         for ( ; n; n = n->parent)          for ( ; n; n = n->parent)
Line 264  static void
Line 264  static void
 rew_last(struct roff_man *mdoc, const struct roff_node *to)  rew_last(struct roff_man *mdoc, const struct roff_node *to)
 {  {
   
         if (to->flags & MDOC_VALID)          if (to->flags & NODE_VALID)
                 return;                  return;
   
         while (mdoc->last != to) {          while (mdoc->last != to) {
                 mdoc_state(mdoc, mdoc->last);                  mdoc_state(mdoc, mdoc->last);
                 mdoc->last->flags |= MDOC_VALID | MDOC_ENDED;                  mdoc->last->flags |= NODE_VALID | NODE_ENDED;
                 mdoc->last = mdoc->last->parent;                  mdoc->last = mdoc->last->parent;
         }          }
         mdoc_state(mdoc, mdoc->last);          mdoc_state(mdoc, mdoc->last);
         mdoc->last->flags |= MDOC_VALID | MDOC_ENDED;          mdoc->last->flags |= NODE_VALID | NODE_ENDED;
         mdoc->next = ROFF_NEXT_SIBLING;          mdoc->next = ROFF_NEXT_SIBLING;
 }  }
   
Line 298  rew_pending(struct roff_man *mdoc, const struct roff_n
Line 298  rew_pending(struct roff_man *mdoc, const struct roff_n
                         default:                          default:
                                 return;                                  return;
                         }                          }
                         if ( ! (n->flags & MDOC_BROKEN))                          if ( ! (n->flags & NODE_BROKEN))
                                 return;                                  return;
                 } else                  } else
                         n = mdoc->last;                          n = mdoc->last;
Line 309  rew_pending(struct roff_man *mdoc, const struct roff_n
Line 309  rew_pending(struct roff_man *mdoc, const struct roff_n
   
                         if (n->type == ROFFT_BLOCK ||                          if (n->type == ROFFT_BLOCK ||
                             n->type == ROFFT_HEAD) {                              n->type == ROFFT_HEAD) {
                                 if (n->flags & MDOC_ENDED)                                  if (n->flags & NODE_ENDED)
                                         break;                                          break;
                                 else                                  else
                                         return;                                          return;
Line 390  find_pending(struct roff_man *mdoc, int tok, int line,
Line 390  find_pending(struct roff_man *mdoc, int tok, int line,
   
         irc = 0;          irc = 0;
         for (n = mdoc->last; n != NULL && n != target; n = n->parent) {          for (n = mdoc->last; n != NULL && n != target; n = n->parent) {
                 if (n->flags & MDOC_ENDED) {                  if (n->flags & NODE_ENDED) {
                         if ( ! (n->flags & MDOC_VALID))                          if ( ! (n->flags & NODE_VALID))
                                 n->flags |= MDOC_BROKEN;                                  n->flags |= NODE_BROKEN;
                         continue;                          continue;
                 }                  }
                 if (n->type == ROFFT_BLOCK &&                  if (n->type == ROFFT_BLOCK &&
                     mdoc_macros[n->tok].flags & MDOC_EXPLICIT) {                      mdoc_macros[n->tok].flags & MDOC_EXPLICIT) {
                         irc = 1;                          irc = 1;
                         n->flags = MDOC_BROKEN;                          n->flags = NODE_BROKEN;
                         if (target->type == ROFFT_HEAD)                          if (target->type == ROFFT_HEAD)
                                 target->flags = MDOC_ENDED;                                  target->flags = NODE_ENDED;
                         else if ( ! (target->flags & MDOC_ENDED)) {                          else if ( ! (target->flags & NODE_ENDED)) {
                                 mandoc_vmsg(MANDOCERR_BLK_NEST,                                  mandoc_vmsg(MANDOCERR_BLK_NEST,
                                     mdoc->parse, line, ppos,                                      mdoc->parse, line, ppos,
                                     "%s breaks %s", mdoc_macronames[tok],                                      "%s breaks %s", mdoc_macronames[tok],
Line 444  dword(struct roff_man *mdoc, int line, int col, const 
Line 444  dword(struct roff_man *mdoc, int line, int col, const 
          */           */
   
         if (d == DELIM_OPEN)          if (d == DELIM_OPEN)
                 mdoc->last->flags |= MDOC_DELIMO;                  mdoc->last->flags |= NODE_DELIMO;
         else if (d == DELIM_CLOSE &&          else if (d == DELIM_CLOSE &&
             ! (mdoc->flags & MDOC_NODELIMC) &&              ! (mdoc->flags & MDOC_NODELIMC) &&
             mdoc->last->parent->tok != MDOC_Fd)              mdoc->last->parent->tok != MDOC_Fd)
                 mdoc->last->flags |= MDOC_DELIMC;                  mdoc->last->flags |= NODE_DELIMC;
         mdoc->flags &= ~MDOC_NODELIMC;          mdoc->flags &= ~MDOC_NODELIMC;
 }  }
   
Line 481  append_delims(struct roff_man *mdoc, int line, int *po
Line 481  append_delims(struct roff_man *mdoc, int line, int *po
                  */                   */
   
                 if (mandoc_eos(p, strlen(p)))                  if (mandoc_eos(p, strlen(p)))
                         mdoc->last->flags |= MDOC_EOS;                          mdoc->last->flags |= NODE_EOS;
         }          }
 }  }
   
Line 554  blk_exp_close(MACRO_PROT_ARGS)
Line 554  blk_exp_close(MACRO_PROT_ARGS)
         atok = rew_alt(tok);          atok = rew_alt(tok);
         body = NULL;          body = NULL;
         for (n = mdoc->last; n; n = n->parent) {          for (n = mdoc->last; n; n = n->parent) {
                 if (n->flags & MDOC_ENDED || n->tok != atok ||                  if (n->flags & NODE_ENDED || n->tok != atok ||
                     n->type != ROFFT_BODY || n->end != ENDBODY_NOT)                      n->type != ROFFT_BODY || n->end != ENDBODY_NOT)
                         continue;                          continue;
                 body = n;                  body = n;
Line 568  blk_exp_close(MACRO_PROT_ARGS)
Line 568  blk_exp_close(MACRO_PROT_ARGS)
   
         endbody = itblk = later = NULL;          endbody = itblk = later = NULL;
         for (n = mdoc->last; n; n = n->parent) {          for (n = mdoc->last; n; n = n->parent) {
                 if (n->flags & MDOC_ENDED) {                  if (n->flags & NODE_ENDED) {
                         if ( ! (n->flags & MDOC_VALID))                          if ( ! (n->flags & NODE_VALID))
                                 n->flags |= MDOC_BROKEN;                                  n->flags |= NODE_BROKEN;
                         continue;                          continue;
                 }                  }
   
Line 620  blk_exp_close(MACRO_PROT_ARGS)
Line 620  blk_exp_close(MACRO_PROT_ARGS)
                             atok, body, ENDBODY_SPACE);                              atok, body, ENDBODY_SPACE);
   
                         if (tok == MDOC_El)                          if (tok == MDOC_El)
                                 itblk->flags |= MDOC_ENDED | MDOC_BROKEN;                                  itblk->flags |= NODE_ENDED | NODE_BROKEN;
   
                         /*                          /*
                          * If a block closing macro taking arguments                           * If a block closing macro taking arguments
Line 642  blk_exp_close(MACRO_PROT_ARGS)
Line 642  blk_exp_close(MACRO_PROT_ARGS)
   
                 /* Breaking an open sub block. */                  /* Breaking an open sub block. */
   
                 n->flags |= MDOC_BROKEN;                  n->flags |= NODE_BROKEN;
                 if (later == NULL)                  if (later == NULL)
                         later = n;                          later = n;
         }          }
Line 706  blk_exp_close(MACRO_PROT_ARGS)
Line 706  blk_exp_close(MACRO_PROT_ARGS)
         }          }
   
         if (n != NULL) {          if (n != NULL) {
                 if (ntok != TOKEN_NONE && n->flags & MDOC_BROKEN) {                  if (ntok != TOKEN_NONE && n->flags & NODE_BROKEN) {
                         target = n;                          target = n;
                         do                          do
                                 target = target->parent;                                  target = target->parent;
                         while ( ! (target->flags & MDOC_ENDED));                          while ( ! (target->flags & NODE_ENDED));
                         pending = find_pending(mdoc, ntok, line, ppos,                          pending = find_pending(mdoc, ntok, line, ppos,
                             target);                              target);
                 } else                  } else
Line 769  in_line(MACRO_PROT_ARGS)
Line 769  in_line(MACRO_PROT_ARGS)
   
                 if (ac == ARGS_EOLN) {                  if (ac == ARGS_EOLN) {
                         if (d == DELIM_OPEN)                          if (d == DELIM_OPEN)
                                 mdoc->last->flags &= ~MDOC_DELIMO;                                  mdoc->last->flags &= ~NODE_DELIMO;
                         break;                          break;
                 }                  }
   
Line 863  in_line(MACRO_PROT_ARGS)
Line 863  in_line(MACRO_PROT_ARGS)
                  */                   */
   
                 if (firstarg && d == DELIM_CLOSE && !nc)                  if (firstarg && d == DELIM_CLOSE && !nc)
                         mdoc->last->flags &= ~MDOC_DELIMC;                          mdoc->last->flags &= ~NODE_DELIMC;
                 firstarg = 0;                  firstarg = 0;
   
                 /*                  /*
Line 926  blk_full(MACRO_PROT_ARGS)
Line 926  blk_full(MACRO_PROT_ARGS)
   
                 blk = NULL;                  blk = NULL;
                 for (n = mdoc->last; n != NULL; n = n->parent) {                  for (n = mdoc->last; n != NULL; n = n->parent) {
                         if (n->flags & MDOC_ENDED) {                          if (n->flags & NODE_ENDED) {
                                 if ( ! (n->flags & MDOC_VALID))                                  if ( ! (n->flags & NODE_VALID))
                                         n->flags |= MDOC_BROKEN;                                          n->flags |= NODE_BROKEN;
                                 continue;                                  continue;
                         }                          }
                         if (n->type != ROFFT_BLOCK)                          if (n->type != ROFFT_BLOCK)
Line 1129  blk_full(MACRO_PROT_ARGS)
Line 1129  blk_full(MACRO_PROT_ARGS)
                         break;                          break;
         }          }
   
         if (blk->flags & MDOC_VALID)          if (blk->flags & NODE_VALID)
                 return;                  return;
         if (head == NULL)          if (head == NULL)
                 head = roff_head_alloc(mdoc, line, ppos, tok);                  head = roff_head_alloc(mdoc, line, ppos, tok);
Line 1464  phrase_ta(MACRO_PROT_ARGS)
Line 1464  phrase_ta(MACRO_PROT_ARGS)
   
         body = NULL;          body = NULL;
         for (n = mdoc->last; n != NULL; n = n->parent) {          for (n = mdoc->last; n != NULL; n = n->parent) {
                 if (n->flags & MDOC_ENDED)                  if (n->flags & NODE_ENDED)
                         continue;                          continue;
                 if (n->tok == MDOC_It && n->type == ROFFT_BODY)                  if (n->tok == MDOC_It && n->type == ROFFT_BODY)
                         body = n;                          body = n;

Legend:
Removed from v.1.209  
changed lines
  Added in v.1.210

CVSweb