source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: Improve and test the messages about empty macros, in particular
@ 2014-07-02 20:19 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2014-07-02 20:19 UTC (permalink / raw)
  To: source

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-07-02 20:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-02 20:19 mdocml: Improve and test the messages about empty macros, in particular schwarze

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).