summaryrefslogtreecommitdiffstatshomepage
path: root/macro.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-03-22 19:01:11 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-03-22 19:01:11 +0000
commit7f5e6c325d7501f482f01a516a4bcd4fcde4d255 (patch)
tree82470d31e8b8c11cf36a23770b8151da394dd3ea /macro.c
parent161e91f1e1aba8f876c65a8533432516e2dce548 (diff)
downloadmandoc-7f5e6c325d7501f482f01a516a4bcd4fcde4d255.tar.gz
mandoc-7f5e6c325d7501f482f01a516a4bcd4fcde4d255.tar.zst
mandoc-7f5e6c325d7501f482f01a516a4bcd4fcde4d255.zip
Stripping of Xo/Xc macros in main.c (ifdef STRIP_XO).
Diffstat (limited to 'macro.c')
-rw-r--r--macro.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/macro.c b/macro.c
index 9549004d..6b3e4fe3 100644
--- a/macro.c
+++ b/macro.c
@@ -1,4 +1,4 @@
-/* $Id: macro.c,v 1.76 2009/03/21 09:42:07 kristaps Exp $ */
+/* $Id: macro.c,v 1.77 2009/03/22 19:01:11 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@openbsd.org>
*
@@ -33,6 +33,7 @@
/* FIXME: .Fl, .Ar, .Cd handling of `|'. */
enum mwarn {
+ WIMPBRK,
WMACPARM,
WOBS
};
@@ -236,6 +237,9 @@ pwarn(struct mdoc *mdoc, int line, int pos, enum mwarn type)
p = NULL;
switch (type) {
+ case (WIMPBRK):
+ p = "crufty end-of-line scope violation";
+ break;
case (WMACPARM):
p = "macro-like parameter";
break;
@@ -1058,6 +1062,9 @@ blk_part_imp(MACRO_PROT_ARGS)
if (body == n)
break;
+ if (NULL == n && ! pwarn(mdoc, body->line, body->pos, WIMPBRK))
+ return(0);
+
if (n && ! rew_last(mdoc, body))
return(0);