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

Diff for /mandoc/Attic/macro.c between version 1.20 and 1.21

version 1.20, 2009/01/05 12:23:17 version 1.21, 2009/01/05 14:14:04
Line 49  rewind_elem(struct mdoc *mdoc, int ppos, int tok)
Line 49  rewind_elem(struct mdoc *mdoc, int ppos, int tok)
   
         mdoc->last = n;          mdoc->last = n;
         mdoc->next = MDOC_NEXT_SIBLING;          mdoc->next = MDOC_NEXT_SIBLING;
         return(mdoc_valid_post(mdoc, tok, ppos));          if ( ! mdoc_valid_post(mdoc, tok, ppos))
                   return(0);
           return(mdoc_action(mdoc, tok, ppos));
 }  }
   
   
Line 72  rewind_line(struct mdoc *mdoc, int ppos, int tok)
Line 74  rewind_line(struct mdoc *mdoc, int ppos, int tok)
   
         mdoc->last = n ? n : mdoc->last;          mdoc->last = n ? n : mdoc->last;
         mdoc->next = MDOC_NEXT_SIBLING;          mdoc->next = MDOC_NEXT_SIBLING;
           /* XXX - no validation, we do this only for blocks/elements. */
         return(1);          return(1);
 }  }
   
Line 96  rewind_exp(struct mdoc *mdoc, int ppos, int tok, int t
Line 99  rewind_exp(struct mdoc *mdoc, int ppos, int tok, int t
                 return(mdoc_err(mdoc, tok, ppos, ERR_SCOPE_NOCTX));                  return(mdoc_err(mdoc, tok, ppos, ERR_SCOPE_NOCTX));
   
         mdoc->next = MDOC_NEXT_SIBLING;          mdoc->next = MDOC_NEXT_SIBLING;
         return(mdoc_valid_post(mdoc, tok, ppos));          if ( ! mdoc_valid_post(mdoc, tok, ppos))
                   return(0);
           return(mdoc_action(mdoc, tok, ppos));
 }  }
   
   
   static int
   rewind_imp(struct mdoc *mdoc, int ppos, int tok)
   {
           struct mdoc_node *n;
           int               t;
   
           n = mdoc->last ? mdoc->last->parent : NULL;
   
           /* LINTED */
           for ( ; n; n = n->parent) {
                   if (MDOC_BLOCK != n->type)
                           continue;
                   if (tok == (t = n->data.block.tok))
                           break;
                   if ( ! (MDOC_EXPLICIT & mdoc_macros[t].flags))
                           continue;
                   return(mdoc_err(mdoc, tok, ppos, ERR_SCOPE_BREAK));
           }
   
           mdoc->last = n ? n : mdoc->last;
           mdoc->next = MDOC_NEXT_SIBLING;
           if ( ! mdoc_valid_post(mdoc, tok, ppos))
                   return(0);
           return(mdoc_action(mdoc, tok, ppos));
   }
   
   
 /* ARGSUSED */  /* ARGSUSED */
 int  int
 macro_close_explicit(MACRO_PROT_ARGS)  macro_close_explicit(MACRO_PROT_ARGS)
Line 131  macro_close_explicit(MACRO_PROT_ARGS)
Line 163  macro_close_explicit(MACRO_PROT_ARGS)
   
   
 static int  static int
 rewind_imp(struct mdoc *mdoc, int ppos, int tok)  
 {  
         struct mdoc_node *n;  
         int               t;  
   
         n = mdoc->last ? mdoc->last->parent : NULL;  
   
         /* LINTED */  
         for ( ; n; n = n->parent) {  
                 if (MDOC_BLOCK != n->type)  
                         continue;  
                 if (tok == (t = n->data.block.tok))  
                         break;  
                 if ( ! (MDOC_EXPLICIT & mdoc_macros[t].flags))  
                         continue;  
                 return(mdoc_err(mdoc, tok, ppos, ERR_SCOPE_BREAK));  
         }  
   
         mdoc->last = n ? n : mdoc->last;  
         mdoc->next = MDOC_NEXT_SIBLING;  
         return(1);  
         /*return(mdoc_valid_post(mdoc, tok, ppos));*/  
 }  
   
   
 static int  
 append_delims(struct mdoc *mdoc, int tok, int *pos, char *buf)  append_delims(struct mdoc *mdoc, int tok, int *pos, char *buf)
 {  {
         int              c, lastarg;          int              c, lastarg;
Line 542  macro_constant(MACRO_PROT_ARGS)
Line 548  macro_constant(MACRO_PROT_ARGS)
                         break;                          break;
   
                 mdoc_word_alloc(mdoc, lastarg, p);                  mdoc_word_alloc(mdoc, lastarg, p);
                 mdoc->next = MDOC_NEXT_CHILD;                  mdoc->next = MDOC_NEXT_SIBLING;
         }          }
   
         if (MDOC_LINEARG_MAX == sz + argc)          if (MDOC_LINEARG_MAX == sz + argc)

Legend:
Removed from v.1.20  
changed lines
  Added in v.1.21

CVSweb