diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-03-09 13:04:01 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-03-09 13:04:01 +0000 |
commit | 3c250f9844dc2759a6887a574ce490316f7d1939 (patch) | |
tree | e1d3729c8ebbf735e45a2a9bec594ec0e4fe6da7 /mdoc.c | |
parent | f4bf03d97398f8f37ba7e8df8d5a0e3f1b53520c (diff) | |
download | mandoc-3c250f9844dc2759a6887a574ce490316f7d1939.tar.gz |
Added "Input Encoding" section to mdoc*.1.VERSION.1.4.4
Newline-escaped lines are concatenated.
Added -fign-macro option.
Diffstat (limited to 'mdoc.c')
-rw-r--r-- | mdoc.c | 25 |
1 files changed, 20 insertions, 5 deletions
@@ -38,6 +38,7 @@ static int mdoc_node_append(struct mdoc *, static int parsetext(struct mdoc *, int, char *); static int parsemacro(struct mdoc *, int, char *); +static int macrowarn(struct mdoc *, int, const char *); const char *const __mdoc_macronames[MDOC_MAX] = { @@ -495,6 +496,19 @@ parsetext(struct mdoc *mdoc, int line, char *buf) } +static int +macrowarn(struct mdoc *m, int ln, const char *buf) +{ + if ( ! (MDOC_IGN_MACRO & m->pflags)) + return(mdoc_perr(m, ln, 1, "unknown macro: %s%s", + buf, buf[3] ? "..." : "")); + return(mdoc_pwarn(m, ln, 1, WARN_SYNTAX, + "unknown macro: %s%s", + buf, buf[3] ? "..." : "")); +} + + + /* * Parse a macro line, that is, a line beginning with the control * character. @@ -525,14 +539,15 @@ parsemacro(struct mdoc *m, int ln, char *buf) mac[i - 1] = 0; if (i == 5 || i <= 2) { - (void)mdoc_perr(m, ln, 1, "unknown macro: %s%s", - mac, i == 5 ? "..." : ""); - goto err; + if ( ! macrowarn(m, ln, mac)) + goto err; + return(1); } if (MDOC_MAX == (c = mdoc_tokhash_find(m->htab, mac))) { - (void)mdoc_perr(m, ln, 1, "unknown macro: %s", mac); - goto err; + if ( ! macrowarn(m, ln, mac)) + goto err; + return(1); } /* The macro is sane. Jump to the next word. */ |