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

Diff for /mandoc/roff.c between version 1.48 and 1.50

version 1.48, 2008/12/07 14:38:57 version 1.50, 2008/12/07 22:40:18
Line 640  roffspecial(struct rofftree *tree, int tok, const char
Line 640  roffspecial(struct rofftree *tree, int tok, const char
                         break;                          break;
                 roff_err(tree, start, "invalid `At' arg");                  roff_err(tree, start, "invalid `At' arg");
                 return(0);                  return(0);
   
           case (ROFF_Xr):
                   /* FALLTHROUGH */
           case (ROFF_Fn):
                   if (0 != sz)
                           break;
                   roff_err(tree, start, "`%s' expects at least "
                                   "one arg", toknames[tok]);
                   return(0);
   
         case (ROFF_Nm):          case (ROFF_Nm):
                 if (0 == sz) {                  if (0 == sz) {
Line 692  roffspecial(struct rofftree *tree, int tok, const char
Line 701  roffspecial(struct rofftree *tree, int tok, const char
                 break;                  break;
         }          }
   
         return((*tree->cb.roffspecial)(tree->arg, tok,          return((*tree->cb.roffspecial)(tree->arg, tok, tree->cur,
                                 tree->cur, argc, argv, ordp));                                  argc, argv, (const char **)ordp));
 }  }
   
   
Line 1109  roff_layout(ROFFCALL_ARGS) 
Line 1118  roff_layout(ROFFCALL_ARGS) 
          * the layout body is everything following until termination.           * the layout body is everything following until termination.
          */           */
   
         if ( ! (*tree->cb.roffblkin)(tree->arg, tok, argcp, argvp))          if ( ! (*tree->cb.roffblkin)(tree->arg, tok, argcp,
                                   (const char **)argvp))
                 return(0);                  return(0);
         if (NULL == *argv)          if (NULL == *argv)
                 return((*tree->cb.roffblkbodyin)                  return((*tree->cb.roffblkbodyin)
                                 (tree->arg, tok, argcp, argvp));                                  (tree->arg, tok, argcp,
                                    (const char **)argvp));
   
         if ( ! (*tree->cb.roffblkheadin)(tree->arg, tok, argcp, argvp))          if ( ! (*tree->cb.roffblkheadin)(tree->arg, tok, argcp,
                                   (const char **)argvp))
                 return(0);                  return(0);
   
         /*          /*
Line 1132  roff_layout(ROFFCALL_ARGS) 
Line 1144  roff_layout(ROFFCALL_ARGS) 
                 if ( ! (*tree->cb.roffblkheadout)(tree->arg, tok))                  if ( ! (*tree->cb.roffblkheadout)(tree->arg, tok))
                         return(0);                          return(0);
                 return((*tree->cb.roffblkbodyin)                  return((*tree->cb.roffblkbodyin)
                                 (tree->arg, tok, argcp, argvp));                                  (tree->arg, tok, argcp,
                                    (const char **)argvp));
         }          }
   
         /*          /*
Line 1163  roff_layout(ROFFCALL_ARGS) 
Line 1176  roff_layout(ROFFCALL_ARGS) 
                 if ( ! (*tree->cb.roffblkheadout)(tree->arg, tok))                  if ( ! (*tree->cb.roffblkheadout)(tree->arg, tok))
                         return(0);                          return(0);
                 return((*tree->cb.roffblkbodyin)                  return((*tree->cb.roffblkbodyin)
                                 (tree->arg, tok, argcp, argvp));                                  (tree->arg, tok, argcp,
                                    (const char **)argvp));
         }          }
   
         /*          /*
Line 1177  roff_layout(ROFFCALL_ARGS) 
Line 1191  roff_layout(ROFFCALL_ARGS) 
         if ( ! (*tree->cb.roffblkheadout)(tree->arg, tok))          if ( ! (*tree->cb.roffblkheadout)(tree->arg, tok))
                 return(0);                  return(0);
         return((*tree->cb.roffblkbodyin)          return((*tree->cb.roffblkbodyin)
                         (tree->arg, tok, argcp, argvp));                          (tree->arg, tok, argcp,
                            (const char **)argvp));
 }  }
   
   
Line 1201  roff_ordered(ROFFCALL_ARGS) 
Line 1216  roff_ordered(ROFFCALL_ARGS) 
         if ( ! roffparseopts(tree, tok, &argv, argcp, argvp))          if ( ! roffparseopts(tree, tok, &argv, argcp, argvp))
                 return(0);                  return(0);
   
         if (NULL == *argv)          if (NULL == *argv) {
                   ordp[0] = NULL;
                 return(roffspecial(tree, tok, p, argcp,                  return(roffspecial(tree, tok, p, argcp,
                                         (const char **)argvp, 0, ordp));                                          (const char **)argvp, 0, ordp));
           }
   
         i = 0;          i = 0;
         while (*argv && i < ROFF_MAXLINEARG) {          while (*argv && i < ROFF_MAXLINEARG) {
Line 1262  roff_text(ROFFCALL_ARGS) 
Line 1279  roff_text(ROFFCALL_ARGS) 
   
         if ( ! roffparseopts(tree, tok, &argv, argcp, argvp))          if ( ! roffparseopts(tree, tok, &argv, argcp, argvp))
                 return(0);                  return(0);
         if ( ! (*tree->cb.roffin)(tree->arg, tok, argcp, argvp))          if ( ! (*tree->cb.roffin)(tree->arg, tok, argcp,
                                   (const char **)argvp))
                 return(0);                  return(0);
         if (NULL == *argv)          if (NULL == *argv)
                 return((*tree->cb.roffout)(tree->arg, tok));                  return((*tree->cb.roffout)(tree->arg, tok));
Line 1281  roff_text(ROFFCALL_ARGS) 
Line 1299  roff_text(ROFFCALL_ARGS) 
          * terminating punctuation.  If we encounter it and all           * terminating punctuation.  If we encounter it and all
          * subsequent tokens are punctuation, then stop processing (the           * subsequent tokens are punctuation, then stop processing (the
          * line-dominant macro will print these tokens after closure).           * line-dominant macro will print these tokens after closure).
            * If the punctuation is followed by non-punctuation, then close
            * and re-open our scope, then continue.
          */           */
   
         i = 0;          i = 0;
Line 1312  roff_text(ROFFCALL_ARGS) 
Line 1332  roff_text(ROFFCALL_ARGS) 
                                 break;                                  break;
   
                 if (argv[j]) {                  if (argv[j]) {
                           if (ROFF_LSCOPE & tokens[tok].flags) {
                                   if ( ! roffdata(tree, 0, *argv++))
                                           return(0);
                                   continue;
                           }
                           if ( ! (*tree->cb.roffout)(tree->arg, tok))
                                   return(0);
                         if ( ! roffdata(tree, 0, *argv++))                          if ( ! roffdata(tree, 0, *argv++))
                                 return(0);                                  return(0);
                           if ( ! (*tree->cb.roffin)(tree->arg, tok,
                                                   argcp,
                                                   (const char **)argvp))
                                   return(0);
   
                           i = 0;
                         continue;                          continue;
                 }                  }
   

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

CVSweb