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

Diff for /mandoc/Attic/macro.c between version 1.30 and 1.34

version 1.30, 2009/01/09 14:45:44 version 1.34, 2009/01/12 17:26:42
Line 68  rewind_last(struct mdoc *mdoc, struct mdoc_node *to)
Line 68  rewind_last(struct mdoc *mdoc, struct mdoc_node *to)
                         return(0);                          return(0);
                 if ( ! mdoc_action_post(mdoc))                  if ( ! mdoc_action_post(mdoc))
                         return(0);                          return(0);
                   mdoc_msg(mdoc, "rewound to %s",
                                   mdoc_macronames[mdoc->last->tok]);
                 return(1);                  return(1);
         }          }
   
Line 78  rewind_last(struct mdoc *mdoc, struct mdoc_node *to)
Line 80  rewind_last(struct mdoc *mdoc, struct mdoc_node *to)
                         return(0);                          return(0);
                 if ( ! mdoc_action_post(mdoc))                  if ( ! mdoc_action_post(mdoc))
                         return(0);                          return(0);
                   mdoc_msg(mdoc, "rewound to %s",
                                   mdoc_macronames[mdoc->last->tok]);
         } while (mdoc->last != to);          } while (mdoc->last != to);
   
         return(1);          return(1);
Line 93  rewind_elem(struct mdoc *mdoc, int tok)
Line 97  rewind_elem(struct mdoc *mdoc, int tok)
         if (MDOC_ELEM != n->type)          if (MDOC_ELEM != n->type)
                 n = n->parent;                  n = n->parent;
         assert(MDOC_ELEM == n->type);          assert(MDOC_ELEM == n->type);
         assert(tok == n->data.elem.tok);          assert(tok == n->tok);
   
         return(rewind_last(mdoc, n));          return(rewind_last(mdoc, n));
 }  }
Line 109  rewind_body(struct mdoc *mdoc, int tok)
Line 113  rewind_body(struct mdoc *mdoc, int tok)
   
         /* LINTED */          /* LINTED */
         for (n = mdoc->last; n; n = n->parent) {          for (n = mdoc->last; n; n = n->parent) {
                 if (MDOC_BODY != n->type)                  t = n->tok;
                         continue;                  if (MDOC_BODY == n->type && tok == t)
                 if (tok == (t = n->data.head.tok))  
                         break;                          break;
                 if ( ! (MDOC_EXPLICIT & mdoc_macros[t].flags))                  if (MDOC_NESTED & mdoc_macros[t].flags)
                         continue;                          continue;
                 return(mdoc_verr(mdoc, n, ERR_SCOPE_BREAK));                  return(mdoc_verr(mdoc, n, ERR_SCOPE_BREAK));
         }          }
Line 133  rewind_head(struct mdoc *mdoc, int tok)
Line 136  rewind_head(struct mdoc *mdoc, int tok)
   
         /* LINTED */          /* LINTED */
         for (n = mdoc->last; n; n = n->parent) {          for (n = mdoc->last; n; n = n->parent) {
                 if (MDOC_HEAD != n->type)                  t = n->tok;
                         continue;                  if (MDOC_HEAD == n->type && tok == t)
                 if (tok == (t = n->data.head.tok))  
                         break;                          break;
                 if ( ! (MDOC_EXPLICIT & mdoc_macros[t].flags))                  if (MDOC_NESTED & mdoc_macros[t].flags)
                         continue;                          continue;
                 return(mdoc_verr(mdoc, n, ERR_SCOPE_BREAK));                  return(mdoc_verr(mdoc, n, ERR_SCOPE_BREAK));
         }          }
Line 153  rewind_expblock(struct mdoc *mdoc, int tok)
Line 155  rewind_expblock(struct mdoc *mdoc, int tok)
         struct mdoc_node *n;          struct mdoc_node *n;
         int               t;          int               t;
   
         assert(mdoc->last);          n = mdoc->last ? mdoc->last->parent : NULL;
   
         /* LINTED */          /* LINTED */
         for (n = mdoc->last; n; n = n->parent) {          for ( ; n; n = n->parent) {
                 if (MDOC_BLOCK != n->type)                  t = n->tok;
                         continue;                  if (MDOC_BLOCK == n->type && tok == t)
                 if (tok == (t = n->data.block.tok))  
                         break;                          break;
                 if (MDOC_NESTED & mdoc_macros[t].flags)                  if (MDOC_NESTED & mdoc_macros[t].flags)
                         continue;                          continue;
Line 181  rewind_impblock(struct mdoc *mdoc, int tok)
Line 182  rewind_impblock(struct mdoc *mdoc, int tok)
   
         /* LINTED */          /* LINTED */
         for ( ; n; n = n->parent) {          for ( ; n; n = n->parent) {
                 if (MDOC_BLOCK != n->type)                  t = n->tok;
                         continue;                  if (MDOC_BLOCK == n->type && tok == t)
                 if (tok == (t = n->data.block.tok))  
                         break;                          break;
                 if ( ! (MDOC_EXPLICIT & mdoc_macros[t].flags))                  if ( ! (MDOC_EXPLICIT & mdoc_macros[t].flags))
                         continue;                          continue;
                 if (MDOC_NESTED & mdoc_macros[t].flags)                  if (MDOC_NESTED & mdoc_macros[tok].flags)
                         return(1);                          return(1);
                 return(mdoc_verr(mdoc, n, ERR_SCOPE_BREAK));                  return(mdoc_verr(mdoc, n, ERR_SCOPE_BREAK));
         }          }
Line 293  macro_close_explicit(MACRO_PROT_ARGS)
Line 293  macro_close_explicit(MACRO_PROT_ARGS)
         }          }
   
         if ( ! (MDOC_CALLABLE & mdoc_macros[tok].flags)) {          if ( ! (MDOC_CALLABLE & mdoc_macros[tok].flags)) {
                 if (buf[*pos])                  if (0 == buf[*pos])
                         return(rewind_expblock(mdoc, tt));                          return(rewind_expblock(mdoc, tt));
                 return(mdoc_perr(mdoc, line, ppos, ERR_ARGS_EQ0));                  return(mdoc_perr(mdoc, line, ppos, ERR_ARGS_EQ0));
         }          }
Line 479  macro_text(MACRO_PROT_ARGS)
Line 479  macro_text(MACRO_PROT_ARGS)
 int  int
 macro_scoped(MACRO_PROT_ARGS)  macro_scoped(MACRO_PROT_ARGS)
 {  {
         int               c, lastarg, argc, j;          int               c, lastarg, argc, j, fl;
         struct mdoc_arg   argv[MDOC_LINEARG_MAX];          struct mdoc_arg   argv[MDOC_LINEARG_MAX];
         char             *p;          char             *p;
   
Line 529  macro_scoped(MACRO_PROT_ARGS)
Line 529  macro_scoped(MACRO_PROT_ARGS)
                 return(0);                  return(0);
         mdoc->next = MDOC_NEXT_CHILD;          mdoc->next = MDOC_NEXT_CHILD;
   
           fl = ARGS_DELIM;
           if (MDOC_TABSEP & mdoc_macros[tok].flags)
                   fl |= ARGS_TABSEP;
   
         for (j = 0; j < MDOC_LINEARG_MAX; j++) {          for (j = 0; j < MDOC_LINEARG_MAX; j++) {
                 lastarg = *pos;                  lastarg = *pos;
                 c = mdoc_args(mdoc, line, pos, buf, ARGS_DELIM, &p);                  c = mdoc_args(mdoc, line, pos, buf, fl, &p);
   
                 if (ARGS_ERROR == c)                  if (ARGS_ERROR == c)
                         return(0);                          return(0);

Legend:
Removed from v.1.30  
changed lines
  Added in v.1.34

CVSweb