X-Git-Url: https://git.cameronkatri.com/mandoc.git/blobdiff_plain/9d89dc957fdca4edae24c0b070474ec19997ffbb..1d26ffbd16140a752b2adcc259c2957382a4becc:/mdocml.c?ds=inline diff --git a/mdocml.c b/mdocml.c index 57932a93..5fd51990 100644 --- a/mdocml.c +++ b/mdocml.c @@ -1,4 +1,4 @@ -/* $Id: mdocml.c,v 1.31 2009/01/01 20:40:16 kristaps Exp $ */ +/* $Id: mdocml.c,v 1.35 2009/01/05 17:57:08 kristaps Exp $ */ /* * Copyright (c) 2008 Kristaps Dzonsons * @@ -206,8 +206,11 @@ print_node(const struct mdoc_node *n, int indent) p = mdoc_macronames[n->data.head.tok]; t = "block-head"; break; + case (MDOC_TAIL): + p = mdoc_macronames[n->data.tail.tok]; + t = "block-tail"; + break; case (MDOC_ELEM): - assert(NULL == n->child); p = mdoc_macronames[n->data.elem.tok]; t = "element"; argv = n->data.elem.argv; @@ -325,6 +328,9 @@ msg_err(void *arg, int tok, int col, enum mdoc_err type) fmt = lit = NULL; switch (type) { + case (ERR_SYNTAX_NOTEXT): + lit = "syntax: context-free text disallowed"; + break; case (ERR_SYNTAX_QUOTE): lit = "syntax: disallowed argument quotation"; break; @@ -354,7 +360,7 @@ msg_err(void *arg, int tok, int col, enum mdoc_err type) fmt = "scope: macro `%s' may not be nested in the current context"; break; case (ERR_MACRO_NOTSUP): - fmt = "macro `%s' not supported"; + lit = "macro not supported"; break; case (ERR_MACRO_NOTCALL): fmt = "macro `%s' not callable"; @@ -398,8 +404,17 @@ msg_err(void *arg, int tok, int col, enum mdoc_err type) case (ERR_SYNTAX_ARGMANY): lit = "syntax: too many values for macro argument"; break; - case (ERR_CHILD_HEAD): - lit = "scope context expects block-header child"; + case (ERR_SYNTAX_CHILDHEAD): + lit = "syntax: expected only block-header section"; + break; + case (ERR_SYNTAX_CHILDBODY): + lit = "syntax: expected only a block-body section"; + break; + case (ERR_SYNTAX_EMPTYHEAD): + lit = "syntax: block-header section may not be empty"; + break; + case (ERR_SYNTAX_EMPTYBODY): + lit = "syntax: block-body section may not be empty"; break; default: abort(); @@ -489,6 +504,9 @@ msg_warn(void *arg, int tok, int col, enum mdoc_warn type) case (WARN_SYNTAX_ARGLIKE): lit = "syntax: argument-like value"; break; + case (WARN_SYNTAX_EMPTYBODY): + lit = "syntax: empty block-body section"; + break; case (WARN_SEC_OO): lit = "section is out of conventional order"; break;