diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-06-17 09:41:00 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-06-17 09:41:00 +0000 |
commit | aa8ebdeebdc3218708b91a72e0b499258a3e5cef (patch) | |
tree | 9289cc60fcdaae8923bb814a216143646c215e13 | |
parent | fdc3fdd6a6ddbc503a53564a3b4f607a0e7ca8c3 (diff) | |
download | mandoc-aa8ebdeebdc3218708b91a72e0b499258a3e5cef.tar.gz |
Noted deprecation of \*( and \* special-character escapes.
Minor clean-ups.
-rw-r--r-- | mdoc_strings.c | 9 | ||||
-rw-r--r-- | 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; } |