From: schwarze@mdocml.bsd.lv
To: source@mdocml.bsd.lv
Subject: mdocml: Improve and test the messages about empty macros, in particular
Date: Wed, 2 Jul 2014 16:19:11 -0400 (EDT) [thread overview]
Message-ID: <201407022019.s62KJBYa020892@krisdoz.my.domain> (raw)
Log Message:
-----------
Improve and test the messages about empty macros,
in particular reporting the macro names involved.
Modified Files:
--------------
mdocml:
mandoc.h
mdoc_macro.c
mdoc_validate.c
Revision Data
-------------
Index: mdoc_validate.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_validate.c,v
retrieving revision 1.222
retrieving revision 1.223
diff -Lmdoc_validate.c -Lmdoc_validate.c -u -p -r1.222 -r1.223
--- mdoc_validate.c
+++ mdoc_validate.c
@@ -1729,7 +1729,9 @@ post_st(POST_ARGS)
const char *p;
if (NULL == (ch = mdoc->last->child)) {
- mdoc_nmsg(mdoc, mdoc->last, MANDOCERR_MACROEMPTY);
+ mandoc_msg(MANDOCERR_MACRO_EMPTY, mdoc->parse,
+ mdoc->last->line, mdoc->last->pos,
+ mdoc_macronames[mdoc->last->tok]);
mdoc_node_delete(mdoc, mdoc->last);
return(1);
}
Index: mdoc_macro.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_macro.c,v
retrieving revision 1.134
retrieving revision 1.135
diff -Lmdoc_macro.c -Lmdoc_macro.c -u -p -r1.134 -r1.135
--- mdoc_macro.c
+++ mdoc_macro.c
@@ -919,8 +919,9 @@ in_line(MACRO_PROT_ARGS)
return(0);
} else if ( ! nc && 0 == cnt) {
mdoc_argv_free(arg);
- mdoc_pmsg(mdoc, line, ppos,
- MANDOCERR_MACROEMPTY);
+ mandoc_msg(MANDOCERR_MACRO_EMPTY,
+ mdoc->parse, line, ppos,
+ mdoc_macronames[tok]);
}
if ( ! mdoc_macro(mdoc, ntok, line, la, pos, buf))
@@ -1005,7 +1006,8 @@ in_line(MACRO_PROT_ARGS)
return(0);
} else if ( ! nc && 0 == cnt) {
mdoc_argv_free(arg);
- mdoc_pmsg(mdoc, line, ppos, MANDOCERR_MACROEMPTY);
+ mandoc_msg(MANDOCERR_MACRO_EMPTY, mdoc->parse,
+ line, ppos, mdoc_macronames[tok]);
}
if ( ! nl)
Index: mandoc.h
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mandoc.h,v
retrieving revision 1.129
retrieving revision 1.130
diff -Lmandoc.h -Lmandoc.h -u -p -r1.129 -r1.130
--- mandoc.h
+++ mandoc.h
@@ -84,7 +84,7 @@ enum mandocerr {
MANDOCERR_LINESCOPE, /* line scope broken: macro breaks macro */
/* related to missing macro arguments */
- MANDOCERR_MACROEMPTY, /* skipping empty macro */
+ MANDOCERR_MACRO_EMPTY, /* skipping empty macro: macro */
MANDOCERR_ARGCWARN, /* argument count wrong */
MANDOCERR_DISPTYPE, /* missing display type */
MANDOCERR_LISTFIRST, /* list type must come first */
--
To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv
reply other threads:[~2014-07-02 20:19 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201407022019.s62KJBYa020892@krisdoz.my.domain \
--to=schwarze@mdocml.bsd.lv \
--cc=source@mdocml.bsd.lv \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).