From aa8ebdeebdc3218708b91a72e0b499258a3e5cef Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Wed, 17 Jun 2009 09:41:00 +0000 Subject: Noted deprecation of \*( and \* special-character escapes. Minor clean-ups. --- mdoc_strings.c | 9 ++------- mdoc_validate.c | 10 ++++++++-- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/mdoc_strings.c b/mdoc_strings.c index 9a715a9e..d1781a98 100644 --- a/mdoc_strings.c +++ b/mdoc_strings.c @@ -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 5bc3bec1..ac42fe45 100644 --- a/mdoc_validate.c +++ b/mdoc_validate.c @@ -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; } -- cgit