Tweak regression so it doesn't puke on the groff behaviour (allowing
open scopes to migrate across tabs) that we probably won't support and
is well-known.
Migrate `Bl -column' phrases to be MDOC_BODY instead of MDOC_HEAD. This
will make it easy for re-entrant parsing of `Ta' macros to fit in with
standard closure rules.
Added some more regressions for `Bl -column'. Note that one should
fail, as documented in the TODO file.
Final word on lac/ac. Document flow as it relates to phrasing, as I'll
be changing this around and want a record in CVS of what was happening
beforehand.
First in several iterative patches in getting complex -column lists
supported (which works but is tricky enough that it should be broken
down into digestable parts). This simply moves around the propogation
of ARGS_PEND into one recognised by phrase().
Give libroff an extremely simple table-lookup instead of iterating over
each and every macro. The table keys on the first character then walks
a chain. Good enough for now.
Adding `Ar' regression for empty-prior-closing-punctuation checkin.
NOTE: this will not work on old groff, which forgets to print `file ...'
when encountering an empty Ar node.
Commit of patch floated on discuss@ a few days ago: if an in_line scope
has not been opened and closing punctuation is encountered AND the macro
is marked as accepting no-content (or `Li'), then open an empty scope.
Added regression tests for `Fl' and `Li' testing this behaviour.
Also, squeeze hyph0.in tests into the last characters of each line so
that groff doesn't hyphenate and break the test.
Smarten BADCHAR check to allow ASCII_HYPH.
Fix index.sgml not to puke (the relevant section will be re-written for the release anyway, but I hate seeing errors).
Modified version of Ingo Schwarze's patch for hyphen-breaking.
Breakable hyphens are cued in the back-ends (with ASCII_HYPH) and acted
upon in term.c or ignored in html.c.
Also cleaned up XML decl printing (no need for extra vars).
Ingo Schwarze [Mon, 24 May 2010 22:25:58 +0000 (22:25 +0000)]
provide stubs to ignore .ds, .rm and .tr,
which occur in the standard pod2man preamble;
from OpenBSD;
"sounds good" joerg@, "can be checked in" kristaps@
Ingo Schwarze [Mon, 24 May 2010 21:51:20 +0000 (21:51 +0000)]
sync to OpenBSD:
save the visual cursor position in term_flushln()
and use that to avoid multiple blank lines in nested lists while
still putting subsequent empty list tags each on their own line;
"go ahead" kristaps@
Ingo Schwarze [Mon, 24 May 2010 21:34:16 +0000 (21:34 +0000)]
Handle literal tab characters both in literal context (.Bd -literal)
and outside. In literal context, tab stops are at each eigth column;
outside, they are at each fifth column.
from OpenBSD mdoc_term.c rev. 1.75;
"commit" kristaps@
Ingo Schwarze [Mon, 24 May 2010 13:39:47 +0000 (13:39 +0000)]
rewrite the main mdoc text parser, mdoc_ptext(),
making it easier to understand and fixing various bugs:
* correctly strip whitespace from the end of text lines
* issue consistent warnings regarding trailing spaces and tabs
* escaped backslashes no longer escape the following character
ok kristaps@
Increase performance by stashing the list type in struct mdoc_node.
This will eventually be used so that mdoc_macro can known whether to
dump list line arguments into the body (`Bl -column' overflowing).
Remove a2list() and arg_listtype() because of this.
Ingo Schwarze [Mon, 17 May 2010 02:03:49 +0000 (02:03 +0000)]
The function term_flushln() had effectively forked in OpenBSD.
This is the bsd.lv part of the main step to bring it back in sync.
At the same time, this prevents trailing whitespace in the output:
We delay writing blanks until we are sure printable characters follow.
This is achieved by
* remembering the end of the word instead of its length
* and not using vbl any longer for the control of line breaking
* such that vbl can sum up all kinds of white space
* before writing a word, printing all the blanks collected in vbl
* within the word, adding NBSP chars to vbl, then continuing with the word
* after the word, adding blanks to vbl, then starting the next word
Full support for ie/el. This completes the initial roff support.
Added test files for ie/el.
Using `if 0' as a baseline for "false" roff instructions instead of `if t'.
libroff now is aware of which sub-nodes should be interpreted even in a
conditional-negative context so as to preserve structural integrity.
Initial "rules" (deny/allow) are now inherited for future work in
evaluating conditionals.
Support for the general case of `if', which will boil out into other
constructs: single-level and multi-level blocks; nested, varied-level
blocks; recalculating buffer (begin) boundaries pushed correctly into
the back-ends, and so on. This will allow, once conditions are turned
on, for things like `.ie n .TH FOO 1' then `.el .Dd Mdocdate'. Read
it and weep.
Allow roff_parseln() to be re-run.
Allow roff_parseln() to manipulate the line buffer offset. This is used
in situations like `.ie n .TH FOO 1' or `.ie n .ie n', where the line
buffer offset is recalculated then the roff parser re-run.
Fix mdoc_parseln() and man_parseln() to accept the initial line offset.
WARNING: backed-out ALL roff macros whilst accomodating for how roff
handles multi-line conditionals (in short, re-running the parser).
Add mandoc.h, which will eventually replace compilers' inner enum errors with unified ones.
Add initial roff pre-processor shim, a compiler sitting outside of the other compilers that processes pure roff instructions.
Fixed memory leak introduced in last checkin of man_action TH parsing (only if TH is called again, which never happens anyway).
Fixed my email address in man_action.c and msec.c.
Removed superfluous <time.h> inclusion in msec.c.
LIBRARY can also occur in section 9.
All manual sections (unknown, 3p, 3f, etc.) correctly handled by -mdoc.
Useful warning printed if unknown manual section.
Checking for manual sections (e.g., LIBRARY) checks only first character, so 3p, 3f, etc. are free.
Ingo Schwarze [Sat, 15 May 2010 08:54:04 +0000 (08:54 +0000)]
Distinguish OPEN, MIDDLE and CLOSE delimiters (using an enum).
Only OPEN are drawn before the beginning of a macro;
this is new, before this, MIDDLE ('|') were drawn in front, too.
Only CLOSE are pushed after the end of a macro (as before).
ok kristaps@
More EOS: append_delims() fitted with EOS detection, so ANY macro with appended delimiters will properly EOS.
Fixed mandoc_eos() to accept sentence punctuation followed by close-delim buffers.