version 1.41, 2015/02/13 18:44:04 |
version 1.42, 2015/02/14 10:35:02 |
Line 135 static const char fmts[FMT__MAX] = { |
|
Line 135 static const char fmts[FMT__MAX] = { |
|
'Z' /* FMT_NULL */ |
'Z' /* FMT_NULL */ |
}; |
}; |
|
|
static int last; |
static unsigned char last; |
|
|
|
|
static void |
static void |
Line 1395 ordinary(struct state *st, const char *buf, size_t sta |
|
Line 1395 ordinary(struct state *st, const char *buf, size_t sta |
|
&start, end, &opstack)) |
&start, end, &opstack)) |
continue; |
continue; |
|
|
/* |
/* Merely buffer non-whitespace. */ |
* On whitespace, flush the output buffer |
|
* and allow breaking to a macro line. |
|
* Otherwise, merely buffer text. |
|
*/ |
|
|
|
last = buf[start++]; |
last = buf[start++]; |
if (' ' != last) { |
if ( ! isspace(last)) { |
outbuf_addchar(st); |
outbuf_addchar(st); |
continue; |
continue; |
} |
} |
|
|
if ( ! strcmp(st->outbuf + st->outbuflen - 2, "()") && |
/* Detect function names. */ |
|
|
|
if (st->outbuflen > 2 && |
|
')' == st->outbuf[st->outbuflen - 1] && |
|
'(' == st->outbuf[st->outbuflen - 2] && |
dict_get(st->outbuf, st->outbuflen - 2) == |
dict_get(st->outbuf, st->outbuflen - 2) == |
MDOC_Fo) { |
MDOC_Fo) { |
st->outbuflen -= 2; |
st->outbuflen -= 2; |
st->outbuf[st->outbuflen] = '\0'; |
st->outbuf[st->outbuflen] = '\0'; |
mdoc_newln(st); |
mdoc_newln(st); |
fputs(".Fn ", stdout); |
fputs(".Fn ", stdout); |
outbuf_flush(st); |
st->oust = OUST_MAC; |
mdoc_newln(st); |
|
continue; |
|
} |
} |
|
|
|
/* |
|
* On whitespace, flush the output buffer |
|
* and allow breaking to a macro line. |
|
*/ |
|
|
outbuf_flush(st); |
outbuf_flush(st); |
if (OUST_MAC == st->oust) |
|
|
/* |
|
* End macro lines, and |
|
* end text lines at the end of sentences. |
|
*/ |
|
|
|
if (OUST_MAC == st->oust || (start > 3 && |
|
('.' == buf[start - 2] || |
|
'!' == buf[start - 2] || |
|
'?' == buf[start - 2]) && |
|
islower((unsigned char)buf[start - 3]) && |
|
islower((unsigned char)buf[start - 4]))) |
mdoc_newln(st); |
mdoc_newln(st); |
else |
|
st->wantws = 1; |
/* Advance to the next word. */ |
|
|
|
while (isspace((unsigned char)buf[start])) |
|
start++; |
|
st->wantws = 1; |
} |
} |
|
|
if (start < end - 1 && '<' == buf[start + 1] && |
if (start < end - 1 && '<' == buf[start + 1] && |