[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.141 and 1.142

version 1.141, 2014/08/16 19:50:37 version 1.142, 2014/08/21 12:57:17
Line 843  blk_exp_close(MACRO_PROT_ARGS)
Line 843  blk_exp_close(MACRO_PROT_ARGS)
 static int  static int
 in_line(MACRO_PROT_ARGS)  in_line(MACRO_PROT_ARGS)
 {  {
         int              la, scope, cnt, nc, nl;          int              la, scope, cnt, mayopen, nc, nl;
         enum margverr    av;          enum margverr    av;
         enum mdoct       ntok;          enum mdoct       ntok;
         enum margserr    ac;          enum margserr    ac;
Line 894  in_line(MACRO_PROT_ARGS)
Line 894  in_line(MACRO_PROT_ARGS)
                 return(0);                  return(0);
         }          }
   
           mayopen = 1;
         for (cnt = scope = 0;; ) {          for (cnt = scope = 0;; ) {
                 la = *pos;                  la = *pos;
                 ac = mdoc_args(mdoc, line, pos, buf, tok, &p);                  ac = mdoc_args(mdoc, line, pos, buf, tok, &p);
Line 950  in_line(MACRO_PROT_ARGS)
Line 951  in_line(MACRO_PROT_ARGS)
                          * If we encounter closing punctuation, no word                           * If we encounter closing punctuation, no word
                          * has been omitted, no scope is open, and we're                           * has been omitted, no scope is open, and we're
                          * allowed to have an empty element, then start                           * allowed to have an empty element, then start
                          * a new scope.  `Ar', `Fl', and `Li', only do                           * a new scope.
                          * this once per invocation.  There may be more  
                          * of these (all of them?).  
                          */                           */
                         if (0 == cnt && (nc || MDOC_Li == tok) &&                          if ((d == DELIM_CLOSE ||
                             DELIM_CLOSE == d && ! scope) {                               (d == DELIM_MIDDLE && tok == MDOC_Fl)) &&
                               (nc || tok == MDOC_Li) &&
                               !scope && !cnt && mayopen) {
                                 if ( ! mdoc_elem_alloc(mdoc,                                  if ( ! mdoc_elem_alloc(mdoc,
                                     line, ppos, tok, arg))                                      line, ppos, tok, arg))
                                         return(0);                                          return(0);
                                 if (MDOC_Ar == tok || MDOC_Li == tok ||  
                                     MDOC_Fl == tok)  
                                         cnt++;  
                                 scope = 1;                                  scope = 1;
                                   cnt++;
                                   if (MDOC_Li == tok || MDOC_Nm == tok)
                                           mayopen = 0;
                         }                          }
                         /*                          /*
                          * Close out our scope, if one is open, before                           * Close out our scope, if one is open, before
Line 971  in_line(MACRO_PROT_ARGS)
Line 972  in_line(MACRO_PROT_ARGS)
                         if (scope && ! rew_elem(mdoc, tok))                          if (scope && ! rew_elem(mdoc, tok))
                                 return(0);                                  return(0);
                         scope = 0;                          scope = 0;
                 } else if ( ! scope) {                  } else if (mayopen && !scope) {
                         if ( ! mdoc_elem_alloc(mdoc, line, ppos, tok, arg))                          if ( ! mdoc_elem_alloc(mdoc, line, ppos, tok, arg))
                                 return(0);                                  return(0);
                         scope = 1;                          scope = 1;
                 }  
   
                 if (DELIM_NONE == d)  
                         cnt++;                          cnt++;
                   }
   
                 if ( ! dword(mdoc, line, la, p, d,                  if ( ! dword(mdoc, line, la, p, d,
                     MDOC_JOIN & mdoc_macros[tok].flags))                      MDOC_JOIN & mdoc_macros[tok].flags))

Legend:
Removed from v.1.141  
changed lines
  Added in v.1.142

CVSweb