summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* reduce indentation for better readabilityIngo Schwarze2015-02-031-12/+20
|
* Avoid closing out an explicit block twice when broken by .ItIngo Schwarze2015-02-031-0/+1
| | | | (assertion failure); regression found in jsg@'s afl test case 847.
* minimal support for Heirloom nroffIngo Schwarze2015-02-031-5/+17
|
* Finally delete the kitchensink functions rew_sub() and rew_dohalt().Ingo Schwarze2015-02-031-159/+74
| | | | | | | They were a maintenance and auditing nightmare because if you changed one bit in there, stuff tended to break at seemingly unrelated places. No functional change except getting rid of one bogus error message, but minus 80 lines of code.
* Bring .Pp/.Lp handling inside .Nm blocks closer to groff;Ingo Schwarze2015-02-032-6/+21
| | | | as a bonus, get rid of another call to rew_sub().
* Simplify and reindent make_pending(). No functional changeIngo Schwarze2015-02-021-56/+49
| | | | | | except that some error messages become less confusing. Now the function is almost readable (but still requires nineteen lines of comments for fourteen lines of code).
* Simplify: Do not call rew_dohalt() from make_pending(),Ingo Schwarze2015-02-021-30/+20
| | | | | the calling macro handler already found the breaking block. No functional change except tiny variations in error messages.
* Get rid of all remaining calls to rew_sub() where the target blockIngo Schwarze2015-02-021-65/+36
| | | | | is known. This only leaves three that do actual searching. No functional change, minus 30 lines of code.
* Get rid of all calls to rew_sub() in blk_exp_close(); only ten callsIngo Schwarze2015-02-023-66/+69
| | | | | | remain in other functions. As a bonus, this fixes an assertion failure jsg@ found some time ago with afl (test case 982) and improves minor details in error reporting.
* When a full block macro gets closed out by a mismatchingIngo Schwarze2015-02-021-3/+6
| | | | | | | | | block closure macro it calls, do not attempt to open its body. This can for example happen for (nonsensical) constructions like .Fo .Nm Fc in the SYNOPSIS. Fixing an assertion failure jsg@ found with afl some time ago (test case number 731).
* get rid of rew_sub() in blk_part_imp(); no functional changeIngo Schwarze2015-02-011-2/+13
|
* fix .Eo/.Ec spacingIngo Schwarze2015-02-013-28/+129
|
* Simplify blk_part_exp(), no functional change.Ingo Schwarze2015-02-011-23/+7
| | | | | | * Replace calls to rew_sub() with rew_last() - two less out of 18. * No need to keep track of the body, it's always opened right after the head and never used for anything in this function.
* The function rew_sub() tries to rewind any all all kinds of blocksIngo Schwarze2015-02-011-4/+3
| | | | | | | | | | and elements under any and all circumstances, even handling some bad block nesting now and then. Little surprisingly, this ends up in excessive complexity and has caused many bugs in the past. Start to slowly disentangle this mess by replacing calls to rew_sub() immediately following mdoc_head_alloc() by the much simpler rew_last(). Gets rid of the first two rew_sub() calls out of twenty. No functional change.
* Use relative offsets instead of absolute pointers for the terminalIngo Schwarze2015-01-315-20/+11
| | | | | | font stack. The latter fail after the stack is grown with realloc(). Fixing an assertion failure found by jsg@ with afl some time ago (test case number 51).
* Have pity on the poor stack.Ingo Schwarze2015-01-304-15/+18
| | | | | Replace tail recursion by iteration when walking the syntax trees. No functional change.
* starting a tbl(7) breaks man(7) next-line scope;Ingo Schwarze2015-01-301-58/+65
| | | | triggered by a bug report from jsg@
* Delete the redundant tbl span flags, just inspect the actual dataIngo Schwarze2015-01-306-13/+5
| | | | | | | | where needed, which is less fragile. This fixes a subtle NULL pointer access to tp->tbl.cols: Due to a bug in the man(7) parser, the first span of a table can end up in a .TP head, in which case tblcalc() was never called. Found by jsg@ with afl.
* Abolish struct tbl_head and replace it by an "int col" member inIngo Schwarze2015-01-309-114/+124
| | | | struct tbl_cell. No functional change, minus 40 lines of code.
* Auditing the tbl(7) code for more NULL pointer accesses, i came outIngo Schwarze2015-01-305-67/+50
| | | | | empty-handed; so this is just KNF and some code simplifications, no functional change.
* Make sure every layout line contains at least one cell;Ingo Schwarze2015-01-301-10/+30
| | | | fixing a NULL pointer access in term_tbl() that jsg@ found with afl.
* correctly handle table layout lines starting with a dotIngo Schwarze2015-01-301-1/+1
|
* Radical cleanup of COMPATIBILITY sections:Ingo Schwarze2015-01-296-299/+80
| | | | | | | | Remove lots of lies, dozens of irrelevant implementation details, and all references to groff versions older than 1.17. Move relevant information to the pages where it belongs, and out of mandoc(1) in particular. Add some missing general remarks to roff(7), where it fits the character and purpose of the page much better.
* Clean up eqn(7) error handling:Ingo Schwarze2015-01-284-70/+72
| | | | | | | | * When "define" fails, do not drop the whole equation. * Free memory after "undef". * Use standard mandoc error types instead of rolling our own. * Delete obfuscating EQN_MSG() macro. * Add function prototypes while here.
* * Polish tbl(7) error reporting.Ingo Schwarze2015-01-289-57/+89
| | | | | | * Do not print out macro names in tbl(7) data blocks. * Like with GNU tbl, let empty tables cause a blank line. * Avoid producing empty tables in -Tman.
* For now, it can't be helped that mandoc tbl(7) ignores high-level macros,Ingo Schwarze2015-01-286-27/+27
| | | | | | but stop throwing away their arguments. This fixes information loss in a handful of Xenocara manuals, at the price of a small amount of formatting noise creeping through.
* implement the tbl(7) "center" layout optionIngo Schwarze2015-01-282-3/+18
|
* adjust formatting for the tbl(7) layout 'x' modifier (maximize column)Ingo Schwarze2015-01-281-6/+30
| | | | to match groff for up to six maximized columns
* Multiple parser and formatter fixes for line drawing in tbl(7).Ingo Schwarze2015-01-275-158/+160
| | | | | | | | | | | | * Allow mixing vertical line bars with the layout options of the preceding layout cell. * Correctly combine box options with layout lines. * Correctly print vertical lines in data rows, with the right spacing. * Correctly print cross markers and left and right ends of horizontal lines even if vertical lines differ above and below. * Avoid the bogus error message "no table data cells" when a table data section starts with a horizontal line. No increase in code size.
* Rework tbl(7) layout parsing:Ingo Schwarze2015-01-265-169/+164
| | | | | | | | | | | * Continue parsing even if part of the input is invalid. * Do not require whitespace between cell specifications. * Allow tabs as well as blanks between modifiers. * Mark the 'm' modifier as unsupported. * Parse and ignore the 'p' and 'v' modifiers. * Better warning and error messages. * Get rid of a static buffer. Improved functionality but minus 50 lines of code.
* More improvements regarding tbl(7) options.Ingo Schwarze2015-01-265-87/+78
| | | | | | | | | * Treat "allbox" as an alias for "box" for now. * Parse and ignore the GNU tbl "nowarn" option. * For separation, allow spaces, tabs, and commas only. * Mark eqn(7) within tbl(7) as unsupported. * Simplify the option table. * Improve and sort documentation.
* Improve (or rather, rewrite) tbl(7) option parsing.Ingo Schwarze2015-01-265-184/+152
| | | | | | | | | | | | * Allow the layout to start after the semicolon on the options line. * Ignore leading commas. * Option arguments cannot contain closing parentheses. * Avoid needless UNSUPP messages. * Better ERROR reporting. * Delete unused "linesize" field in struct tbl_opts. * No need for static buffers. * Garbage collect one almost empty wrapper function. Improved functionality, but minus 40 lines of code.
* preserve .PP before .RE; effect found in audio/pms(1)Ingo Schwarze2015-01-241-1/+12
|
* Strangely, ignoring the roff(7) .na request was implemented in the man(7)Ingo Schwarze2015-01-248-13/+5
| | | | | parser. Simplify the code by moving it into the roff(7) parser, also making it work for mdoc(7).
* change .Cm to .Ar for macro argumentsIngo Schwarze2015-01-241-18/+18
|
* Support .RE with an argument; needed for audio/pms(1).Ingo Schwarze2015-01-245-6/+61
|
* new task: escape blank at the beginning of a lineIngo Schwarze2015-01-241-1/+5
|
* improve homebrew cellar config exampleIngo Schwarze2015-01-231-1/+2
|
* While ignoring the .ta (set tab stops) and .ti (temp indent) requestsIngo Schwarze2015-01-232-7/+7
| | | | | | is sometimes harmless, it often causes seriously ugly output, so flag these requests as unsupported rather than ignoring them. Discussed with naddy@.
* Let .Aq/.Ao/.Ac print "<>" instead of the normal "\(la\(ra"Ingo Schwarze2015-01-233-15/+15
| | | | | | when the only child is .Mt, not when the preceding node is .An, to improve robustness. Triggered by a question from Svyatoslav Mishyn <juef at openmailbox dot org> (Crux Linux).
* Wonders of roff(7): Integer numbers in numerical expressions can carryIngo Schwarze2015-01-232-2/+48
| | | | | scaling units, and some manuals (e.g. in devel/grcs) actually use that, so let's support it. Missing feature reported by naddy@.
* Slightly improve \w width measurements:Ingo Schwarze2015-01-221-1/+19
| | | | | | | Count special characters with the same width as ASCII characters and treat all other escape sequences as if they had a width of 0. Certainly not perfect, but a bit better. For example, GNU RCS ci(1) needs this; reported by naddy@.
* Traditional roff(7) explicitly allows certain control charactersIngo Schwarze2015-01-222-7/+10
| | | | | | | in the input stream (SOH, STX, ETX, ENQ, ACK, BEL, BS) for specific purposes (leaders, backspace, delimiters, .tr), but making sure these don't leak through to the output is tricky, so mark them as unsupported for now.
* Don't let a failing mparse_open() clobber the filename pointer;Ingo Schwarze2015-01-221-2/+6
| | | | | fixes error message content and a use after free for .so with non-existent target when -Wall or -Tlint is given.
* improve wording; patch from jmc@Ingo Schwarze2015-01-221-1/+1
|
* Support homebrew-style linking on Mac OS X.Ingo Schwarze2015-01-213-3/+21
| | | | Idea found together with Alexis Hildebrandt <surryhill at gmail dot com>.
* Rudimentary implementation of the roff(7) \o escape sequence (overstrike).Ingo Schwarze2015-01-216-16/+53
| | | | | | This is of some relevance because the pod2man(1) preamble abuses it for the icelandic letter Thorn, instead of simply using \(TP and \(Tp. Missing feature found by sthen@ in DateTime::Locale::is_IS(3p).
* Improve overstriking. When overstriking a wider character with aIngo Schwarze2015-01-211-3/+33
| | | | | | narrower one, center the latter horizontally. After a group of characters printed in the same position, advance by the width of the widest one among them.
* pass empty request lines through to tbl(7); sometimes, they end a layoutIngo Schwarze2015-01-211-10/+9
|
* blank lines in tables do not need special handling; simplifies codeIngo Schwarze2015-01-213-28/+15
| | | | and reduces groff/mandoc differences in OpenBSD base by about 1%