[BACK]Return to mdoc.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / mandoc

Diff for /src/usr.bin/mandoc/mdoc.c between version 1.47 and 1.48

version 1.47, 2010/05/14 14:47:44 version 1.48, 2010/05/14 19:52:43
Line 120 
Line 120 
         /* LINTED */          /* LINTED */
         "Dx",           "%Q",           "br",           "sp",          "Dx",           "%Q",           "br",           "sp",
         /* LINTED */          /* LINTED */
         "%U",           "eos"          "%U"
         };          };
   
 const   char *const __mdoc_argnames[MDOC_ARG_MAX] = {  const   char *const __mdoc_argnames[MDOC_ARG_MAX] = {
Line 688 
Line 688 
         }          }
   
         /* Allocate the whole word. */          /* Allocate the whole word. */
   
         if ( ! mdoc_word_alloc(m, line, 0, buf))          if ( ! mdoc_word_alloc(m, line, 0, buf))
                 return(0);                  return(0);
   
         /*          /*
          * Mark the end of a sentence.  Only works when you respect           * End-of-sentence check.  If the last character is an unescaped
          * Jason's rule: "new sentence, new line".           * EOS character, then flag the node as being the end of a
            * sentence.  The front-end will know how to interpret this.
          */           */
         if ('.' == buf[i-1] || '!' == buf[i-1] || '?' == buf[i-1]) {  
                 m->next = MDOC_NEXT_SIBLING;  
                 if ( ! mdoc_elem_alloc(m, line, i, MDOC_eos, NULL))  
                         return(0);  
         }  
   
         m->next = MDOC_NEXT_SIBLING;          assert(i);
   
           if (mandoc_eos(buf, (size_t)i))
                   m->last->flags |= MDOC_EOS;
   
         return(1);          return(1);
 }  }
   
Line 727 
Line 728 
         enum mdoct      tok;          enum mdoct      tok;
         int             i, j, sv;          int             i, j, sv;
         char            mac[5];          char            mac[5];
         struct mdoc_node *n;  
         char             *t;  
   
         /* Empty lines are ignored. */          /* Empty lines are ignored. */
   
Line 798 
Line 797 
          */           */
         if ( ! mdoc_macro(m, tok, ln, sv, &i, buf))          if ( ! mdoc_macro(m, tok, ln, sv, &i, buf))
                 goto err;                  goto err;
   
         /*  
          * Mark the end of a sentence, but be careful not to insert  
          * markers into reference blocks and after ellipses in  
          * function definitions.  
          */  
         n = m->last;  
         if (n->child)  
                 n = n->child;  
         while (n->next)  
                 n = n->next;  
         if (MDOC_TEXT == n->type &&  
             MDOC_Fn != n->parent->tok &&  
             MDOC_Rs != m->last->parent->tok) {  
                 t = n->string;  
                 while (t[0] && t[1])  
                         t++;  
                 if ('.' == *t || '!' == *t || '?' == *t) {  
                         if ( ! mdoc_elem_alloc(m, ln, i, MDOC_eos, NULL))  
                                 return(0);  
                         m->next = MDOC_NEXT_SIBLING;  
                 }  
         }  
   
         return(1);          return(1);
   

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