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

Diff for /docbook2mdoc/macro.c between version 1.14 and 1.18

version 1.14, 2019/04/16 14:26:27 version 1.18, 2019/05/01 17:20:47
Line 28 
Line 28 
  */   */
   
 void  void
 macro_open(struct format *f, const char *name)  para_check(struct format *f)
 {  {
         if (f->parastate == PARA_WANT) {          if (f->parastate != PARA_WANT)
                 if (f->linestate != LINE_NEW) {                  return;
                         putchar('\n');          if (f->linestate != LINE_NEW) {
                         f->linestate = LINE_NEW;                  putchar('\n');
                 }                  f->linestate = LINE_NEW;
                 puts(".Pp");  
         }          }
           puts(".Pp");
           f->parastate = PARA_HAVE;
   }
   
   void
   macro_open(struct format *f, const char *name)
   {
           para_check(f);
         switch (f->linestate) {          switch (f->linestate) {
         case LINE_MACRO:          case LINE_MACRO:
                 if (f->flags & FMT_NOSPC) {                  if (f->flags & FMT_NOSPC) {
Line 49  macro_open(struct format *f, const char *name)
Line 56  macro_open(struct format *f, const char *name)
                 }                  }
                 /* FALLTHROUGH */                  /* FALLTHROUGH */
         case LINE_TEXT:          case LINE_TEXT:
                   if (f->nofill && f->linestate == LINE_TEXT)
                           fputs(" \\c", stdout);
                 putchar('\n');                  putchar('\n');
                 /* FALLTHROUGH */                  /* FALLTHROUGH */
         case LINE_NEW:          case LINE_NEW:
Line 164  void
Line 173  void
 macro_addnode(struct format *f, struct pnode *n, int flags)  macro_addnode(struct format *f, struct pnode *n, int flags)
 {  {
         struct pnode    *nc;          struct pnode    *nc;
         int              quote_now;          int              is_text, quote_now;
   
         assert(f->linestate == LINE_MACRO);          assert(f->linestate == LINE_MACRO);
   
Line 209  macro_addnode(struct format *f, struct pnode *n, int f
Line 218  macro_addnode(struct format *f, struct pnode *n, int f
   
         while (nc != NULL) {          while (nc != NULL) {
                 macro_addnode(f, nc, flags);                  macro_addnode(f, nc, flags);
                   is_text = pnode_class(nc->node) == CLASS_TEXT;
                 nc = TAILQ_NEXT(nc, child);                  nc = TAILQ_NEXT(nc, child);
                 flags |= ARG_SPACE;                  if (nc == NULL || pnode_class(nc->node) != CLASS_TEXT)
                           is_text = 0;
                   if (is_text && (nc->flags & NFLAG_SPC) == 0)
                           flags &= ~ARG_SPACE;
                   else
                           flags |= ARG_SPACE;
         }          }
         if (quote_now)          if (quote_now)
                 putchar('"');                  putchar('"');
Line 233  macro_nodeline(struct format *f, const char *name, str
Line 248  macro_nodeline(struct format *f, const char *name, str
 void  void
 print_text(struct format *f, const char *word, int flags)  print_text(struct format *f, const char *word, int flags)
 {  {
         if (f->parastate == PARA_WANT) {          para_check(f);
                 if (f->linestate != LINE_NEW) {  
                         putchar('\n');  
                         f->linestate = LINE_NEW;  
                 }  
                 puts(".Pp");  
         }  
         switch (f->linestate) {          switch (f->linestate) {
         case LINE_NEW:          case LINE_NEW:
                 break;                  break;

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.18

CVSweb