[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.110 and 1.114

version 1.110, 2011/08/10 14:07:23 version 1.114, 2012/01/02 15:48:05
Line 1 
Line 1 
 /*      $Id$ */  /*      $Id$ */
 /*  /*
  * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>   * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
  * Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org>   * Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org>
  *   *
  * Permission to use, copy, modify, and distribute this software for any   * Permission to use, copy, modify, and distribute this software for any
Line 228  mdoc_macroend(struct mdoc *m)
Line 228  mdoc_macroend(struct mdoc *m)
 static enum mdoct  static enum mdoct
 lookup(enum mdoct from, const char *p)  lookup(enum mdoct from, const char *p)
 {  {
         /* FIXME: make -diag lists be un-PARSED. */  
   
         if ( ! (MDOC_PARSED & mdoc_macros[from].flags))          if ( ! (MDOC_PARSED & mdoc_macros[from].flags))
                 return(MDOC_MAX);                  return(MDOC_MAX);
Line 984  in_line(MACRO_PROT_ARGS)
Line 983  in_line(MACRO_PROT_ARGS)
 static int  static int
 blk_full(MACRO_PROT_ARGS)  blk_full(MACRO_PROT_ARGS)
 {  {
         int               la, nl;          int               la, nl, nparsed;
         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 */          struct mdoc_node *body; /* save of body macro */
Line 995  blk_full(MACRO_PROT_ARGS)
Line 994  blk_full(MACRO_PROT_ARGS)
         enum margverr     av;          enum margverr     av;
         char             *p;          char             *p;
   
           /*
            * Exception: `-diag' lists are not parsed, but lists in general
            * are parsed.
            */
           nparsed = 0;
           if (MDOC_It == tok && NULL != m->last &&
                           MDOC_Bl == m->last->tok &&
                           LIST_diag == m->last->norm->Bl.type)
                   nparsed = 1;
   
         nl = MDOC_NEWLINE & m->flags;          nl = MDOC_NEWLINE & m->flags;
   
         /* Close out prior implicit scope. */          /* Close out prior implicit scope. */
Line 1146  blk_full(MACRO_PROT_ARGS)
Line 1155  blk_full(MACRO_PROT_ARGS)
                         continue;                          continue;
                 }                  }
   
                 ntok = ARGS_QWORD == ac ? MDOC_MAX : lookup(tok, p);                  ntok = nparsed || ARGS_QWORD == ac ?
                           MDOC_MAX : lookup(tok, p);
   
                 if (MDOC_MAX == ntok) {                  if (MDOC_MAX == ntok) {
                         if ( ! dword(m, line, la, p, DELIM_MAX))                          if ( ! dword(m, line, la, p, DELIM_MAX))
Line 1443  blk_part_exp(MACRO_PROT_ARGS)
Line 1453  blk_part_exp(MACRO_PROT_ARGS)
   
         /* Clean-up to leave in a consistent state. */          /* Clean-up to leave in a consistent state. */
   
         if (NULL == head) {          if (NULL == head)
                 if ( ! mdoc_head_alloc(m, line, ppos, tok))                  if ( ! mdoc_head_alloc(m, line, ppos, tok))
                         return(0);                          return(0);
                 head = m->last;  
         }  
   
         if (NULL == body) {          if (NULL == body) {
                 if ( ! rew_sub(MDOC_HEAD, m, tok, line, ppos))                  if ( ! rew_sub(MDOC_HEAD, m, tok, line, ppos))
                         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;  
         }          }
   
         /* Standard appending of delimiters. */          /* Standard appending of delimiters. */
Line 1571  in_line_argn(MACRO_PROT_ARGS)
Line 1578  in_line_argn(MACRO_PROT_ARGS)
                                 return(0);                                  return(0);
                         flushed = 1;                          flushed = 1;
                 }                  }
   
                 /*  
                  * XXX: this is a hack to work around groff's ugliness  
                  * as regards `Xr' and extraneous arguments.  It should  
                  * ideally be deprecated behaviour, but because this is  
                  * code is no here, it's unlikely to be removed.  
                  */  
   
 #ifdef __OpenBSD__  
                 if (MDOC_Xr == tok && j == maxargs) {  
                         if ( ! mdoc_elem_alloc(m, line, la, MDOC_Ns, NULL))  
                                 return(0);  
                         if ( ! rew_elem(m, MDOC_Ns))  
                                 return(0);  
                 }  
 #endif  
   
                 if ( ! dword(m, line, la, p, DELIM_MAX))                  if ( ! dword(m, line, la, p, DELIM_MAX))
                         return(0);                          return(0);

Legend:
Removed from v.1.110  
changed lines
  Added in v.1.114

CVSweb