diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-03-19 18:30:26 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-03-19 18:30:26 +0000 |
commit | d6927385079d4fc8e93729813362b9123340c85e (patch) | |
tree | ad3b4b516d0465d5e11f62dec51d6427be849fca | |
parent | 677b18213e2f3cdbe7bb2c9df54a0e2488c89714 (diff) | |
download | mandoc-d6927385079d4fc8e93729813362b9123340c85e.tar.gz |
Fixed mandoc read from stdin.
Added some more groff_chars.
-rw-r--r-- | ascii.in | 7 | ||||
-rw-r--r-- | main.c | 34 | ||||
-rw-r--r-- | mandoc.1 | 4 | ||||
-rw-r--r-- | mdoc.7 | 14 |
4 files changed, 48 insertions, 11 deletions
@@ -48,14 +48,18 @@ LINE("Rq", 2, "\'\'", 2) LINE("rq", 2, "\'\'", 2) LINE("oq", 2, "`", 1) LINE("aq", 2, "\'", 1) +LINE("Bq", 2, ",,", 2) +LINE("bq", 2, ",,", 2) LINE("<-", 2, "<-", 2) LINE("->", 2, "->", 2) LINE("<>", 2, "<>", 2) LINE("ua", 2, "^", 1) LINE("da", 2, "v", 1) LINE("bu", 2, "o", 1) +LINE("ci", 2, "O", 1) LINE("Ba", 2, "|", 1) LINE("ba", 2, "|", 1) +LINE("bb", 2, "|", 1) LINE("co", 2, "(C)", 3) LINE("rg", 2, "(R)", 3) LINE("tm", 2, "tm", 2) @@ -164,6 +168,7 @@ LINE("ah", 2, "v", 1) LINE("ao", 2, "o", 1) LINE("ho", 2, ",", 1) LINE("ab", 2, "`", 1) +LINE("a\"", 2, "\"", 1) LINE("a-", 2, "-", 1) LINE("Cs", 2, "x", 1) LINE("Do", 2, "$", 1) @@ -176,3 +181,5 @@ LINE("fi", 2, "fi", 2) LINE("fl", 2, "fl", 2) LINE("Fi", 2, "ffi", 3) LINE("Fl", 2, "ffl", 3) +LINE("r!", 2, "i", 1) +LINE("r?", 2, "c", 1) @@ -165,19 +165,33 @@ main(int argc, char *argv[]) mdoc = mdoc_alloc(&wflags, fflags, &cb); - while (*argv) { - if ( ! file(&line, &linesz, &buf, &bufsz, *argv, mdoc)) - break; - if (outrun && ! (*outrun)(outdata, mdoc)) - break; + /* + * Loop around available files. + */ - /* Reset the parser for another file. */ - mdoc_reset(mdoc); - argv++; + if (NULL == *argv) { + c = fdesc(&line, &linesz, &buf, &bufsz, + "stdin", STDIN_FILENO, mdoc); + rc = 0; + if (c && NULL == outrun) + rc = 1; + else if (c && outrun && (*outrun)(outdata, mdoc)) + rc = 1; + } else { + while (*argv) { + c = file(&line, &linesz, &buf, + &bufsz, *argv, mdoc); + if ( ! c) + break; + if (outrun && ! (*outrun)(outdata, mdoc)) + break; + /* Reset the parser for another file. */ + mdoc_reset(mdoc); + argv++; + } + rc = NULL == *argv; } - rc = NULL == *argv; - if (buf) free(buf); if (line) @@ -72,7 +72,9 @@ arguments may be comma-separated, such as .It Ar infile... Read input from zero or more .Ar infile . -If unspecified, reads from stdin. +If unspecified, reads from stdin. If multiple files are specified, +.Nm +will halt with the first failed parse. .El .\" PARAGRAPH .Pp @@ -117,6 +117,10 @@ Grammatic: .Pq space .It \\. .Pq period +.It \\(r! +.Pq upside-down exclamation +.It \\(r? +.Pq upside-down question .El .\" PARAGRAPH .Pp @@ -162,6 +166,10 @@ Enclosures: .Pq left single-quote .It \\(aq .Pq right single-quote +.It \\(Bq +.Pq right low double-quote +.It \\(bq +.Pq right low single-quote .El .\" PARAGRAPH .Pp @@ -258,6 +266,8 @@ Diacritics and letters: .Pq grave accent .It \\(aa .Pq accute accent +.It \\(a" +.Pq umlaut accent .It \\(ad .Pq dieresis accent .It \\(a~ @@ -420,8 +430,12 @@ Special symbols: .Bl -tag -width 12n -offset "XXXX" -compact .It \\(bu .Pq bullet +.It \\(ci +.Pq circle .It \\(ba .Pq bar +.It \\(bb +.Pq broken bar .It \\(Ba .Pq bar, deprecated .It \\(co |