diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-05-09 21:19:42 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-05-09 21:19:42 +0000 |
commit | a1130d850b6f9f84a04057f2c37e005aae7f83db (patch) | |
tree | 83e4125fc534f68a780b1129cf8ac2112b75940f | |
parent | 56404f5192e3e5565fa8807435d1791a07f41b80 (diff) | |
download | mandoc-a1130d850b6f9f84a04057f2c37e005aae7f83db.tar.gz |
Remove -fno-ign-chars as well-argued by Ingo Schwarze. Patch by Ingo Schwarze, too.
-rw-r--r-- | index.sgml | 7 | ||||
-rw-r--r-- | main.c | 28 | ||||
-rw-r--r-- | man.h | 1 | ||||
-rw-r--r-- | man_validate.c | 4 | ||||
-rw-r--r-- | mandoc.1 | 7 | ||||
-rw-r--r-- | mdoc.h | 1 | ||||
-rw-r--r-- | mdoc_validate.c | 15 |
7 files changed, 21 insertions, 42 deletions
@@ -241,6 +241,13 @@ <TR> <TD VALIGN="top"><SPAN CLASS="date">09-05-2010</SPAN></TD> <TD VALIGN="top"> + Fixed handling of <Q>\*(Ba</Q> escape. Backed out <SPAN + CLASS="flag">-fno-ign-chars</SPAN> (pointless complexity). + Version: <SPAN CLASS="rev">1.9.24</SPAN>. + </TR> + <TR> + <TD VALIGN="top"><SPAN CLASS="date">09-05-2010</SPAN></TD> + <TD VALIGN="top"> Rolled back break-at-hyphen. <SPAN CLASS="flag">-DUGLY</SPAN> is now the default (no feature splits!). Free-form text is not de-chunked any more: lines are passed whole-sale into the front-end, including whitespace. Added mailing @@ -75,7 +75,6 @@ struct curparse { #define FL_IGN_SCOPE (1 << 0) /* Ignore scope errors. */ #define FL_NIGN_ESCAPE (1 << 1) /* Don't ignore bad escapes. */ #define FL_NIGN_MACRO (1 << 2) /* Don't ignore bad macros. */ -#define FL_NIGN_CHARS (1 << 3) /* Don't ignore bad chars. */ #define FL_IGN_ERRORS (1 << 4) /* Ignore failed parse. */ enum intt inttype; /* Input parsers... */ struct man *man; @@ -91,8 +90,7 @@ struct curparse { }; #define FL_STRICT FL_NIGN_ESCAPE | \ - FL_NIGN_MACRO | \ - FL_NIGN_CHARS + FL_NIGN_MACRO static int foptions(int *, char *); static int toptions(struct curparse *, char *); @@ -246,12 +244,10 @@ man_init(struct curparse *curp) /* Defaults from mandoc.1. */ - pflags = MAN_IGN_MACRO | MAN_IGN_ESCAPE | MAN_IGN_CHARS; + pflags = MAN_IGN_MACRO | MAN_IGN_ESCAPE; if (curp->fflags & FL_NIGN_MACRO) pflags &= ~MAN_IGN_MACRO; - if (curp->fflags & FL_NIGN_CHARS) - pflags &= ~MAN_IGN_CHARS; if (curp->fflags & FL_NIGN_ESCAPE) pflags &= ~MAN_IGN_ESCAPE; @@ -270,7 +266,7 @@ mdoc_init(struct curparse *curp) /* Defaults from mandoc.1. */ - pflags = MDOC_IGN_MACRO | MDOC_IGN_ESCAPE | MDOC_IGN_CHARS; + pflags = MDOC_IGN_MACRO | MDOC_IGN_ESCAPE; if (curp->fflags & FL_IGN_SCOPE) pflags |= MDOC_IGN_SCOPE; @@ -278,8 +274,6 @@ mdoc_init(struct curparse *curp) pflags &= ~MDOC_IGN_ESCAPE; if (curp->fflags & FL_NIGN_MACRO) pflags &= ~MDOC_IGN_MACRO; - if (curp->fflags & FL_NIGN_CHARS) - pflags &= ~MDOC_IGN_CHARS; return(mdoc_alloc(curp, pflags, &mdoccb)); } @@ -590,11 +584,10 @@ foptions(int *fflags, char *arg) toks[0] = "ign-scope"; toks[1] = "no-ign-escape"; toks[2] = "no-ign-macro"; - toks[3] = "no-ign-chars"; - toks[4] = "ign-errors"; - toks[5] = "strict"; - toks[6] = "ign-escape"; - toks[7] = NULL; + toks[3] = "ign-errors"; + toks[4] = "strict"; + toks[5] = "ign-escape"; + toks[6] = NULL; while (*arg) { o = arg; @@ -609,15 +602,12 @@ foptions(int *fflags, char *arg) *fflags |= FL_NIGN_MACRO; break; case (3): - *fflags |= FL_NIGN_CHARS; - break; - case (4): *fflags |= FL_IGN_ERRORS; break; - case (5): + case (4): *fflags |= FL_STRICT; break; - case (6): + case (5): *fflags &= ~FL_NIGN_ESCAPE; break; default: @@ -100,7 +100,6 @@ struct man_node { }; #define MAN_IGN_MACRO (1 << 0) -#define MAN_IGN_CHARS (1 << 1) #define MAN_IGN_ESCAPE (1 << 2) extern const char *const *man_macronames; diff --git a/man_validate.c b/man_validate.c index 75807caf..53ad1e03 100644 --- a/man_validate.c +++ b/man_validate.c @@ -229,9 +229,7 @@ check_text(CHKARGS) if ('\t' == *p || isprint((u_char)*p)) continue; - if (MAN_IGN_CHARS & m->pflags) - return(man_pwarn(m, n->line, pos, WNPRINT)); - return(man_perr(m, n->line, pos, WNPRINT)); + return(man_pwarn(m, n->line, pos, WNPRINT)); } return(1); @@ -192,18 +192,15 @@ When rewinding the scope of a block macro, forces the compiler to ignore scope violations. This can seriously mangle the resulting tree. .Pq mdoc only -.It Fl f Ns Cm no-ign-chars -Do not ignore disallowed characters. .It Fl f Ns Cm no-ign-escape Do not ignore invalid escape sequences. .It Fl f Ns Cm no-ign-macro Do not ignore unknown macros at the start of input lines. .It Fl f Ns Cm strict Implies -.Fl f Ns Cm no-ign-escape , -.Fl f Ns Cm no-ign-macro , +.Fl f Ns Cm no-ign-escape and -.Fl f Ns Cm no-ign-chars . +.Fl f Ns Cm no-ign-macro . .El .Ss Output Options For the time being, only @@ -275,7 +275,6 @@ struct mdoc_node { #define MDOC_IGN_SCOPE (1 << 0) /* Ignore scope violations. */ #define MDOC_IGN_ESCAPE (1 << 1) /* Ignore bad escape sequences. */ #define MDOC_IGN_MACRO (1 << 2) /* Ignore unknown macros. */ -#define MDOC_IGN_CHARS (1 << 3) /* Ignore disallowed chars. */ /* Call-backs for parse messages. */ diff --git a/mdoc_validate.c b/mdoc_validate.c index 22db47a8..5390158d 100644 --- a/mdoc_validate.c +++ b/mdoc_validate.c @@ -60,7 +60,6 @@ static int err_child_gt(struct mdoc *, const char *, int); static int warn_child_gt(struct mdoc *, const char *, int); static int err_child_eq(struct mdoc *, const char *, int); static int warn_child_eq(struct mdoc *, const char *, int); -static int warn_print(struct mdoc *, int, int); static int warn_count(struct mdoc *, const char *, int, const char *, int); static int err_count(struct mdoc *, const char *, @@ -323,16 +322,6 @@ mdoc_valid_post(struct mdoc *mdoc) } -static int -warn_print(struct mdoc *m, int ln, int pos) -{ - - if (MDOC_IGN_CHARS & m->pflags) - return(mdoc_pwarn(m, ln, pos, EPRINT)); - return(mdoc_perr(m, ln, pos, EPRINT)); -} - - static inline int warn_count(struct mdoc *m, const char *k, int want, const char *v, int has) @@ -518,10 +507,10 @@ check_text(struct mdoc *mdoc, int line, int pos, const char *p) for ( ; *p; p++, pos++) { if ('\t' == *p) { if ( ! (MDOC_LITERAL & mdoc->flags)) - if ( ! warn_print(mdoc, line, pos)) + if ( ! mdoc_pwarn(mdoc, line, pos, EPRINT)) return(0); } else if ( ! isprint((u_char)*p)) - if ( ! warn_print(mdoc, line, pos)) + if ( ! mdoc_pwarn(mdoc, line, pos, EPRINT)) return(0); if ('\\' != *p) |