-/* $Id: ascii.in,v 1.2 2009/03/19 11:49:00 kristaps Exp $ */
+/* $Id: ascii.in,v 1.3 2009/03/19 18:30:26 kristaps Exp $ */
/*
* Copyright (c) 2009 Kristaps Dzonsons <kristaps@openbsd.org>
*
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)
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)
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)
-/* $Id: main.c,v 1.3 2009/03/19 16:40:49 kristaps Exp $ */
+/* $Id: main.c,v 1.4 2009/03/19 18:30:26 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@openbsd.org>
*
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)
-.\" $Id: mandoc.1,v 1.1 2009/03/19 16:17:27 kristaps Exp $
+.\" $Id: mandoc.1,v 1.2 2009/03/19 18:30:26 kristaps Exp $
.\"
.\" Copyright (c) 2009 Kristaps Dzonsons <kristaps@openbsd.org>
.\"
.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
-.\" $Id: mdoc.7,v 1.7 2009/03/19 11:49:00 kristaps Exp $
+.\" $Id: mdoc.7,v 1.8 2009/03/19 18:30:26 kristaps Exp $
.\"
.\" Copyright (c) 2009 Kristaps Dzonsons <kristaps@openbsd.org>
.\"
.Pq space
.It \\.
.Pq period
+.It \\(r!
+.Pq upside-down exclamation
+.It \\(r?
+.Pq upside-down question
.El
.\" PARAGRAPH
.Pp
.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
.Pq grave accent
.It \\(aa
.Pq accute accent
+.It \\(a"
+.Pq umlaut accent
.It \\(ad
.Pq dieresis accent
.It \\(a~
.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