[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.47 and 1.50

version 1.47, 2010/03/31 07:13:53 version 1.50, 2010/04/05 08:38:37
Line 538  rew_dobreak(enum mdoct tok, const struct mdoc_node *p)
Line 538  rew_dobreak(enum mdoct tok, const struct mdoc_node *p)
                         return(1);                          return(1);
                 break;                  break;
         case (MDOC_Oc):          case (MDOC_Oc):
 #ifdef UGLY  
                 if (MDOC_Op == p->tok)                  if (MDOC_Op == p->tok)
                         return(1);                          return(1);
 #endif  
                 break;                  break;
         default:          default:
                 break;                  break;
Line 820  in_line(MACRO_PROT_ARGS)
Line 818  in_line(MACRO_PROT_ARGS)
                  * the word.                   * the word.
                  */                   */
   
                 d = mdoc_isdelim(p);                  d = ARGS_QWORD == w ? 0 : mdoc_isdelim(p);
   
                 if (ARGS_QWORD != w && d) {                  if (ARGS_QWORD != w && d) {
                         if (0 == lastpunct && ! rew_elem(m, tok))                          if (0 == lastpunct && ! rew_elem(m, tok))
Line 881  blk_full(MACRO_PROT_ARGS)
Line 879  blk_full(MACRO_PROT_ARGS)
         int               c, la;          int               c, la;
         struct mdoc_arg  *arg;          struct mdoc_arg  *arg;
         struct mdoc_node *head; /* save of head macro */          struct mdoc_node *head; /* save of head macro */
           struct mdoc_node *body; /* save of body macro */
   #ifdef  UGLY
         struct mdoc_node *n;          struct mdoc_node *n;
   #endif
         char             *p;          char             *p;
   
         /* Close out prior implicit scope. */          /* Close out prior implicit scope. */
Line 923  blk_full(MACRO_PROT_ARGS)
Line 924  blk_full(MACRO_PROT_ARGS)
         if ( ! mdoc_block_alloc(m, line, ppos, tok, arg))          if ( ! mdoc_block_alloc(m, line, ppos, tok, arg))
                 return(0);                  return(0);
   
         head = NULL;          head = body = NULL;
   
         /*          /*
          * The `Nd' macro has all arguments in its body: it's a hybrid           * The `Nd' macro has all arguments in its body: it's a hybrid
Line 938  blk_full(MACRO_PROT_ARGS)
Line 939  blk_full(MACRO_PROT_ARGS)
                         return(0);                          return(0);
                 if ( ! mdoc_body_alloc(m, line, ppos, tok))                  if ( ! mdoc_body_alloc(m, line, ppos, tok))
                         return(0);                          return(0);
                   body = m->last;
         }          }
   
         for (;;) {          for (;;) {
Line 952  blk_full(MACRO_PROT_ARGS)
Line 954  blk_full(MACRO_PROT_ARGS)
                 /* Don't emit leading punct. for phrases. */                  /* Don't emit leading punct. for phrases. */
   
                 if (NULL == head && ARGS_PHRASE != c &&                  if (NULL == head && ARGS_PHRASE != c &&
                                   ARGS_QWORD != c &&
                                 1 == mdoc_isdelim(p)) {                                  1 == mdoc_isdelim(p)) {
                         if ( ! mdoc_word_alloc(m, line, la, p))                          if ( ! mdoc_word_alloc(m, line, la, p))
                                 return(0);                                  return(0);
Line 994  blk_full(MACRO_PROT_ARGS)
Line 997  blk_full(MACRO_PROT_ARGS)
         if (1 == ppos && ! append_delims(m, line, pos, buf))          if (1 == ppos && ! append_delims(m, line, pos, buf))
                 return(0);                  return(0);
   
         /* See notes on `Nd' hybrid, above. */          /* If we've already opened our body, exit now. */
   
         if (MDOC_Nd == tok)          if (NULL != body)
                 return(1);                  return(1);
   
 #ifdef  UGLY  #ifdef  UGLY
         /*          /*
          * If there is an open sub-block requiring explicit close-out,           * If there is an open (i.e., unvalidated) sub-block requiring
          * postpone switching the current block from head to body until           * explicit close-out, postpone switching the current block from
          * the rew_sub() call closing out that sub-block.           * head to body until the rew_sub() call closing out that
            * sub-block.
          */           */
         for (n = m->last; n && n != head; n = n->parent) {          for (n = m->last; n && n != head; n = n->parent) {
                 if (MDOC_EXPLICIT & mdoc_macros[n->tok].flags &&                  if (MDOC_BLOCK == n->type &&
                                 MDOC_BLOCK == n->type) {                                  MDOC_EXPLICIT & mdoc_macros[n->tok].flags &&
                                   ! (MDOC_VALID & n->flags)) {
                           assert( ! (MDOC_ACTED & n->flags));
                         n->pending = head;                          n->pending = head;
                         return(1);                          return(1);
                 }                  }
Line 1072  blk_part_imp(MACRO_PROT_ARGS)
Line 1078  blk_part_imp(MACRO_PROT_ARGS)
                 if (ARGS_PUNCT == c)                  if (ARGS_PUNCT == c)
                         break;                          break;
   
                 if (NULL == body && 1 == mdoc_isdelim(p)) {                  if (NULL == body && ARGS_QWORD != c &&
                                   1 == mdoc_isdelim(p)) {
                         if ( ! mdoc_word_alloc(m, line, la, p))                          if ( ! mdoc_word_alloc(m, line, la, p))
                                 return(0);                                  return(0);
                         continue;                          continue;
Line 1102  blk_part_imp(MACRO_PROT_ARGS)
Line 1109  blk_part_imp(MACRO_PROT_ARGS)
                 body = m->last;                  body = m->last;
         }          }
   
 #ifdef  UGLY  
         /*          /*
          * If we can't rewind to our body, then our scope has already           * If we can't rewind to our body, then our scope has already
          * been closed by another macro (like `Oc' closing `Op').  This           * been closed by another macro (like `Oc' closing `Op').  This
Line 1112  blk_part_imp(MACRO_PROT_ARGS)
Line 1118  blk_part_imp(MACRO_PROT_ARGS)
         for (n = m->last; n; n = n->parent)          for (n = m->last; n; n = n->parent)
                 if (body == n)                  if (body == n)
                         break;                          break;
 #endif  
   
         if (NULL == n && ! mdoc_nwarn(m, body, EIMPBRK))          if (NULL == n && ! mdoc_nwarn(m, body, EIMPBRK))
                 return(0);                  return(0);
Line 1166  blk_part_exp(MACRO_PROT_ARGS)
Line 1171  blk_part_exp(MACRO_PROT_ARGS)
   
                 /* Flush out leading punctuation. */                  /* Flush out leading punctuation. */
   
                 if (NULL == head && 1 == mdoc_isdelim(p)) {                  if (NULL == head && ARGS_QWORD != c &&
                                   1 == mdoc_isdelim(p)) {
                         assert(NULL == body);                          assert(NULL == body);
                         if ( ! mdoc_word_alloc(m, line, la, p))                          if ( ! mdoc_word_alloc(m, line, la, p))
                                 return(0);                                  return(0);
Line 1302  in_line_argn(MACRO_PROT_ARGS)
Line 1308  in_line_argn(MACRO_PROT_ARGS)
                         break;                          break;
   
                 if ( ! (MDOC_IGNDELIM & mdoc_macros[tok].flags) &&                  if ( ! (MDOC_IGNDELIM & mdoc_macros[tok].flags) &&
                                   ARGS_QWORD != c &&
                                 0 == j && 1 == mdoc_isdelim(p)) {                                  0 == j && 1 == mdoc_isdelim(p)) {
                         if ( ! mdoc_word_alloc(m, line, la, p))                          if ( ! mdoc_word_alloc(m, line, la, p))
                                 return(0);                                  return(0);
Line 1327  in_line_argn(MACRO_PROT_ARGS)
Line 1334  in_line_argn(MACRO_PROT_ARGS)
                 }                  }
   
                 if ( ! (MDOC_IGNDELIM & mdoc_macros[tok].flags) &&                  if ( ! (MDOC_IGNDELIM & mdoc_macros[tok].flags) &&
                                   ARGS_QWORD != c &&
                                 ! flushed && mdoc_isdelim(p)) {                                  ! flushed && mdoc_isdelim(p)) {
                         if ( ! rew_elem(m, tok))                          if ( ! rew_elem(m, tok))
                                 return(0);                                  return(0);

Legend:
Removed from v.1.47  
changed lines
  Added in v.1.50

CVSweb