summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--mdoc_strings.c11
-rw-r--r--mdoc_validate.c12
2 files changed, 12 insertions, 11 deletions
diff --git a/mdoc_strings.c b/mdoc_strings.c
index ba9701ef..58106391 100644
--- a/mdoc_strings.c
+++ b/mdoc_strings.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_strings.c,v 1.5 2009/06/15 09:38:37 kristaps Exp $ */
+/* $Id: mdoc_strings.c,v 1.6 2009/06/17 09:41:00 kristaps Exp $ */
/*
* Copyright (c) 2008 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -24,15 +24,10 @@
#include "libmdoc.h"
-/*
- * Various string-literal operations: converting scalars to and from
- * strings, etc.
- */
-
struct mdoc_secname {
- const char *name;
+ const char *name; /* Name of section. */
int flag;
-#define MSECNAME_META (1 << 0)
+#define MSECNAME_META (1 << 0)/* Logical section (not real). */
};
/* Section names corresponding to mdoc_sec. */
diff --git a/mdoc_validate.c b/mdoc_validate.c
index 1be571a8..205e918f 100644
--- a/mdoc_validate.c
+++ b/mdoc_validate.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_validate.c,v 1.10 2009/06/16 19:45:51 kristaps Exp $ */
+/* $Id: mdoc_validate.c,v 1.11 2009/06/17 09:41:00 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -53,6 +53,7 @@ enum mwarn {
WNOWIDTH,
WMISSWIDTH,
WESCAPE,
+ WDEPESC,
WDEPCOL,
WWRONGMSEC,
WSECOOO,
@@ -478,6 +479,9 @@ pwarn(struct mdoc *m, int line, int pos, enum mwarn type)
case (WESCAPE):
p = "invalid escape sequence";
break;
+ case (WDEPESC):
+ p = "deprecated special-character escape";
+ break;
case (WNOLINE):
p = "suggested no line arguments";
break;
@@ -717,8 +721,6 @@ check_text(struct mdoc *mdoc, int line, int pos, const char *p)
{
size_t c;
- /* FIXME: indicate deprecated escapes \*(xx and \*x. */
-
for ( ; *p; p++) {
if ('\t' == *p) {
if ( ! (MDOC_LITERAL & mdoc->flags))
@@ -733,6 +735,10 @@ check_text(struct mdoc *mdoc, int line, int pos, const char *p)
c = mdoc_isescape(p);
if (c) {
+ /* See if form is deprecated. */
+ if ('*' == p[1])
+ if ( ! pwarn(mdoc, line, pos, WDEPESC))
+ return(0);
p += (int)c - 1;
continue;
}