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

Diff for /mandoc/Attic/mdocml.c between version 1.24 and 1.27

version 1.24, 2008/12/23 05:30:49 version 1.27, 2008/12/28 23:07:04
Line 181  buf_begin(struct md_parse *p)
Line 181  buf_begin(struct md_parse *p)
 static void  static void
 print_node(const struct mdoc_node *n, int indent)  print_node(const struct mdoc_node *n, int indent)
 {  {
         const char      *p, *t;          const char       *p, *t;
         int              i, j;          int               i, j;
         size_t           argc;          size_t            argc, sz;
         struct mdoc_arg *argv;          char            **params;
           struct mdoc_arg  *argv;
   
         argv = NULL;          argv = NULL;
         argc = 0;          argc = 0;
           params = NULL;
           sz = 0;
   
         switch (n->type) {          switch (n->type) {
         case (MDOC_TEXT):          case (MDOC_TEXT):
                 assert(NULL == n->child);                  assert(NULL == n->child);
                 p = "<text>";                  p = n->data.text.string;
                 t = "text";                  t = "text";
                 break;                  break;
         case (MDOC_BODY):          case (MDOC_BODY):
Line 202  print_node(const struct mdoc_node *n, int indent)
Line 205  print_node(const struct mdoc_node *n, int indent)
         case (MDOC_HEAD):          case (MDOC_HEAD):
                 p = mdoc_macronames[n->data.head.tok];                  p = mdoc_macronames[n->data.head.tok];
                 t = "block-head";                  t = "block-head";
                   params = n->data.head.args;
                   sz = n->data.head.sz;
                 break;                  break;
         case (MDOC_ELEM):          case (MDOC_ELEM):
                 assert(NULL == n->child);                  assert(NULL == n->child);
Line 209  print_node(const struct mdoc_node *n, int indent)
Line 214  print_node(const struct mdoc_node *n, int indent)
                 t = "element";                  t = "element";
                 argv = n->data.elem.argv;                  argv = n->data.elem.argv;
                 argc = n->data.elem.argc;                  argc = n->data.elem.argc;
                   params = n->data.elem.args;
                   sz = n->data.elem.sz;
                 break;                  break;
         case (MDOC_BLOCK):          case (MDOC_BLOCK):
                 p = mdoc_macronames[n->data.block.tok];                  p = mdoc_macronames[n->data.block.tok];
Line 231  print_node(const struct mdoc_node *n, int indent)
Line 238  print_node(const struct mdoc_node *n, int indent)
                         (void)printf(" \"%s\"", argv[i].value[j]);                          (void)printf(" \"%s\"", argv[i].value[j]);
         }          }
   
           for (i = 0; i < (int)sz; i++)
                   (void)printf(" \"%s\"", params[i]);
   
         (void)printf("\n");          (void)printf("\n");
   
         if (n->child)          if (n->child)
Line 326  msg_err(void *arg, int tok, int col, enum mdoc_err typ
Line 336  msg_err(void *arg, int tok, int col, enum mdoc_err typ
         case (ERR_SYNTAX_WS):          case (ERR_SYNTAX_WS):
                 lit = "syntax: whitespace in argument";                  lit = "syntax: whitespace in argument";
                 break;                  break;
         case (ERR_SYNTAX_ARGS):          case (ERR_SYNTAX_ARGFORM):
                 fmt = "syntax: macro `%s' arguments malformed";                  fmt = "syntax: macro `%s' arguments malformed";
                 break;                  break;
         case (ERR_SYNTAX_BADARG):          case (ERR_SYNTAX_ARG):
                 fmt = "syntax: unknown argument for macro `%s'";                  fmt = "syntax: unknown argument for macro `%s'";
                 break;                  break;
         case (ERR_SCOPE_BREAK):          case (ERR_SCOPE_BREAK):
Line 339  msg_err(void *arg, int tok, int col, enum mdoc_err typ
Line 349  msg_err(void *arg, int tok, int col, enum mdoc_err typ
         case (ERR_SCOPE_NOCTX):          case (ERR_SCOPE_NOCTX):
                 fmt = "scope: closure macro `%s' has no context";                  fmt = "scope: closure macro `%s' has no context";
                 break;                  break;
           case (ERR_SCOPE_NONEST):
                   fmt = "scope: macro `%s' may not be nested in the current context";
                   break;
         case (ERR_MACRO_NOTSUP):          case (ERR_MACRO_NOTSUP):
                 fmt = "macro `%s' not supported";                  fmt = "macro `%s' not supported";
                 break;                  break;
Line 369  msg_err(void *arg, int tok, int col, enum mdoc_err typ
Line 382  msg_err(void *arg, int tok, int col, enum mdoc_err typ
         case (ERR_SYNTAX_ARGVAL):          case (ERR_SYNTAX_ARGVAL):
                 lit = "syntax: expected value for macro argument";                  lit = "syntax: expected value for macro argument";
                 break;                  break;
           case (ERR_SYNTAX_ARGBAD):
                   lit = "syntax: invalid value for macro argument";
                   break;
         case (ERR_SYNTAX_ARGMANY):          case (ERR_SYNTAX_ARGMANY):
                 lit = "syntax: too many values for macro argument";                  lit = "syntax: too many values for macro argument";
                 break;                  break;
Line 451  msg_warn(void *arg, int tok, int col, enum mdoc_warn t
Line 467  msg_warn(void *arg, int tok, int col, enum mdoc_warn t
         case (WARN_SYNTAX_WS_EOLN):          case (WARN_SYNTAX_WS_EOLN):
                 lit = "syntax: whitespace at end-of-line";                  lit = "syntax: whitespace at end-of-line";
                 break;                  break;
           case (WARN_SYNTAX_QUOTED):
                   lit = "syntax: quotation mark starting string";
                   break;
         case (WARN_SYNTAX_MACLIKE):          case (WARN_SYNTAX_MACLIKE):
                 lit = "syntax: macro-like argument";                  lit = "syntax: macro-like argument";
                 break;                  break;
Line 462  msg_warn(void *arg, int tok, int col, enum mdoc_warn t
Line 481  msg_warn(void *arg, int tok, int col, enum mdoc_warn t
                 break;                  break;
         case (WARN_ARGS_GE1):          case (WARN_ARGS_GE1):
                 fmt = "macro `%s' suggests one or more arguments";                  fmt = "macro `%s' suggests one or more arguments";
                   break;
           case (WARN_ARGS_EQ0):
                   fmt = "macro `%s' suggests zero arguments";
                   break;
           case (WARN_IGN_AFTER_BLK):
                   fmt = "ignore: macro `%s' ignored after block macro";
                   break;
           case (WARN_IGN_BEFORE_BLK):
                   fmt = "ignore: macro before block macro `%s' ignored";
                   break;
           case (WARN_COMPAT_TROFF):
                   fmt = "compat: macro `%s' behaves differently in troff and nroff";
                 break;                  break;
         default:          default:
                 abort();                  abort();

Legend:
Removed from v.1.24  
changed lines
  Added in v.1.27

CVSweb