version 1.16, 2009/06/18 20:46:19 |
version 1.18, 2009/07/04 09:01:55 |
|
|
#include <string.h> |
#include <string.h> |
|
|
#include "libmdoc.h" |
#include "libmdoc.h" |
|
#include "libmandoc.h" |
|
|
/* FIXME: .Bl -diag can't have non-text children in HEAD. */ |
/* FIXME: .Bl -diag can't have non-text children in HEAD. */ |
/* TODO: ignoring Pp (it's superfluous in some invocations). */ |
/* TODO: ignoring Pp (it's superfluous in some invocations). */ |
|
|
WNOWIDTH, |
WNOWIDTH, |
WMISSWIDTH, |
WMISSWIDTH, |
WESCAPE, |
WESCAPE, |
WDEPESC, |
|
WDEPCOL, |
WDEPCOL, |
WWRONGMSEC, |
WWRONGMSEC, |
WSECOOO, |
WSECOOO, |
Line 486 pwarn(struct mdoc *m, int line, int pos, enum mwarn ty |
|
Line 486 pwarn(struct mdoc *m, int line, int pos, enum mwarn ty |
|
case (WESCAPE): |
case (WESCAPE): |
p = "invalid escape sequence"; |
p = "invalid escape sequence"; |
break; |
break; |
case (WDEPESC): |
|
p = "deprecated special-character escape"; |
|
break; |
|
case (WNOLINE): |
case (WNOLINE): |
p = "suggested no line arguments"; |
p = "suggested no line arguments"; |
break; |
break; |
Line 712 check_argv(struct mdoc *m, const struct mdoc_node *n, |
|
Line 709 check_argv(struct mdoc *m, const struct mdoc_node *n, |
|
static int |
static int |
check_text(struct mdoc *mdoc, int line, int pos, const char *p) |
check_text(struct mdoc *mdoc, int line, int pos, const char *p) |
{ |
{ |
size_t c; |
int c; |
|
|
for ( ; *p; p++) { |
for ( ; *p; p++, pos++) { |
if ('\t' == *p) { |
if ('\t' == *p) { |
if ( ! (MDOC_LITERAL & mdoc->flags)) |
if ( ! (MDOC_LITERAL & mdoc->flags)) |
if ( ! warn_print(mdoc, line, pos)) |
if ( ! warn_print(mdoc, line, pos)) |
Line 726 check_text(struct mdoc *mdoc, int line, int pos, const |
|
Line 723 check_text(struct mdoc *mdoc, int line, int pos, const |
|
if ('\\' != *p) |
if ('\\' != *p) |
continue; |
continue; |
|
|
c = mdoc_isescape(p); |
c = mandoc_special(p); |
if (c) { |
if (c) { |
/* See if form is deprecated. */ |
p += c - 1; |
if ('*' == p[1]) |
pos += c - 1; |
if ( ! pwarn(mdoc, line, pos, WDEPESC)) |
|
return(0); |
|
p += (int)c - 1; |
|
continue; |
continue; |
} |
} |
if ( ! (MDOC_IGN_ESCAPE & mdoc->pflags)) |
if ( ! (MDOC_IGN_ESCAPE & mdoc->pflags)) |