summaryrefslogtreecommitdiff
path: root/regress/usr.bin/mandoc/roff
AgeCommit message (Collapse)Author
2015-02-21Escape quotes when expanding macro arguments.Ingo Schwarze
This fixes a bug naddy@ found in plan9/rc(1).
2015-02-17Let .it accept numerical expressions, not just numerical constants.Ingo Schwarze
For .it, ignore scaling units in roff_getnum(). Inside parentheses, skip whitespace after a sign in roff_getnum(). Parse and ignore unary plus in roff_getnum(). As a bonus, get rid of the only call to mandoc_strntoi() in roff.c.
2015-02-06replace the last legacy generic message type, "argument count wrong",Ingo Schwarze
by more specific messages, improving diagnostics for .cc .tr .Bl -column
2015-02-06better diagnostics about excess arguments to .PD .ft .spIngo Schwarze
2015-02-06better error reporting for .br .fi .nf with argumentsIngo Schwarze
2015-02-03Make the mandoc test suite completely silent.Ingo Schwarze
Not even i looked at the 966 mandoc command lines and the 787 diff command lines it was spewing, and it was almost unusable without REGRESS_FAIL_EARLY because any errors got lost among all the noise. If you want to debug the Makefiles, use "make -dl". If you want to see the -Tman TODOs, use "grep -RF SKIP_TMAN".
2015-01-23Wonders of roff(7): Integer numbers in numerical expressions can carryIngo Schwarze
scaling units, and some manuals (e.g. in devel/grcs) actually use that, so let's support it. Missing feature reported by naddy@.
2015-01-21Rudimentary implementation of the roff(7) \o escape sequence (overstrike).Ingo Schwarze
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).
2015-01-07Bugfix: When the invocation of a user-defined macro follows a roffIngo Schwarze
conditional request on the same input line, don't skip the first few bytes of its content.
2015-01-01Fix a read buffer overrun triggered by trailing \s- or trailing \s+Ingo Schwarze
without the required subsequent argument; found by jsg@ with afl.
2015-01-01The roff(7) language is Turing-complete, even the part implementedIngo Schwarze
in mandoc(1). So practice some recursive programming to make sure it doesn't get broken.
2014-12-30Test the weird construct of a user-defined macro starting (but notIngo Schwarze
ending!) the definition of another user defined macro. Mandoc already handles this correctly, make sure it won't get broken.
2014-12-23support negative horizontal widths in man(7);Ingo Schwarze
minus twenty lines of code in spite of enhanced functionality
2014-12-23some scaling unit fixes:Ingo Schwarze
- .sp with an invalid argument is .sp 1v, not .sp 0v - in man(1), trailing garbage doesn't make scaling units invalid
2014-12-23Fix vertical scaling. Obviously, nobody ever had a serious look at this.Ingo Schwarze
Basic units, centimeters, points, ens, ems, and the rounding algorithm were all wrong, only inches, pica, and the default vertical span worked.
2014-12-18Don't let the modulo operator divide by zero.Ingo Schwarze
Found by jsg@ with afl.
2014-12-16When a numerical condition errors out after consuming at least oneIngo Schwarze
character of input, treat it as false, do not retry it as a string comparison condition. This also fixes a read buffer overrun that happened when the numerical condition advanced to the end of the input line before erroring out, found by jsg@ with afl.
2014-12-15Empty conditions count as false.Ingo Schwarze
When negated, they still count as false. Found when investigating crashes jsg@ found with afl. Not completely fixing the crashes yet.
2014-12-04fix handling of roff requests having a default scale other than "n",Ingo Schwarze
in particular .sp which uses "v", when the scale is not specified; cures groff-mandoc differences in about a dozen Xenocara manuals
2014-12-03test backslash handling because it was on my todo list;Ingo Schwarze
fortunately, it already seems to work
2014-12-02Fix the implementation and documentation of \c (continue text input line).Ingo Schwarze
In particular, make it work in no-fill mode, too. Reminded by Carsten dot Kunze at arcor dot de (Heirloom roff).
2014-11-21We repeatedly observed assertion crashes in the low-level terminalIngo Schwarze
output handler because the high level terminal formatters could be tricked into setting the left margin further to the right than the right margin. Today, jsg@ found more of these with afl. Change the internal interface between both levels, aiming for simplicity and robustness of the code. Treat both margins as *independent* settings: Now, termp.offset is the requested left margin, and termp.rmargin is the available space. Let the lower level cope with that case of insufficient space. Obviously, high level code that does centering or flush right still has to do careful checks, so i did a full audit of margin settings in the terminal formatters. Fixes crashes caused by excessively long title or date strings in the man(7) footer, operating system or date strings in the mdoc(7) footer, volume strings in the man(7) or mdoc(7) header, and a few cases related to some non-prologue macros.
2014-11-19Escape sequences terminate high-level macro names, and when doing so,Ingo Schwarze
they are ignored, just in the same way as for request names and for low-level macro names. This also cures a warning in the pod2man(1) preamble.
2014-11-10more tests found in my treeIngo Schwarze
2014-11-10adapt to the changed rendering of \(buIngo Schwarze
2014-10-28some new and/or updated regression tests for -Tascii, -Tutf8Ingo Schwarze
and -Thtml rendering of character escape sequences
2014-08-26inevitable churn caused by the section title changeIngo Schwarze
2014-08-14fix date that got changed by MdocdateIngo Schwarze
and no longer matches the desired output
2014-08-14new regression tests collected during recent workIngo Schwarze
2014-08-14add missing NOPTS argumentsIngo Schwarze
2014-08-11start catching up with recent code changes, but no new files yetIngo Schwarze
2014-07-07Clean up ERROR messages related to document structure and macros:Ingo Schwarze
Hierarchical naming and mention macro names in messages.
2014-07-07implement .dei and .amiIngo Schwarze
2014-07-06Clean up messages related to plain text and to escape sequences.Ingo Schwarze
* Mention invalid escape sequences and string names, and fallbacks. * Hierarchical naming.
2014-07-05Cleanup with respect to bad macro arguments.Ingo Schwarze
* Fix .Sm with invalid arg: move arg out and toggle mode. * Promote "unknown standard" from WARNING to ERROR, it loses information. * Delete MANDOCERR_BADWIDTH, it would only indicate a mandoc(1) bug. * Do not report MANDOCERR_BL_LATETYPE when there is no type at all. * Mention macro names, arguments and fallbacks.
2014-07-04Clean up messages regarding excess arguments:Ingo Schwarze
* Downgrade ".Bf -emphasis Em" from FATAL to WARNING. * Mention the macros, the arguments, and the fallbacks. * Hierarchical naming. Also fix the handling of excess .It head arguments in -Tman.
2014-07-03MANDOCERR_NOARGS reported three completely unrelated classes of problems.Ingo Schwarze
Split the roff(7) parts out of it and report the request names for these cases.
2014-07-01Add a test to catch .el\{ breakage; roff.c rev. 1.88Ingo Schwarze
2014-06-29Use the freshly improved roff_getname() functionIngo Schwarze
for the main roff request parsing routine, roff_parse(). In request or macro invocations, escape sequences now terminate the request or macro name; what follows is treated as arguments. Besides, the names of user-defined macros can now contain backslashes (eek!).
2014-06-29Major roff_getname() cleanup.Ingo Schwarze
* Return the name even if it is terminated by an escape sequence, not a blank. * Skip the full escape sequence using mandoc_escape(), not just the first byte. * Make it non-destructive, return the length instead of writing a '\0'. * Let .ds and .as cope with the above changes to the internal interface. * Fix .rm and .rr to accept an escape sequence as the end of a name. * Fix .nr and .rr to not set/delete a register with an empty name.
2014-06-20Infrastructure for regression tests of mandoc messages.Ingo Schwarze
Even though messages are not going to be as stable as formatted output, that is, even though the *.out_lint files are expected to change now and then, from now on, i want to be able to catch unintended changes in messages.
2014-04-08Fully implement the \B (validate numerical expression) andIngo Schwarze
partially implement the \w (measure text width) escape sequence in a way that makes them usable in numerical expressions and in conditional requests, similar to how \n (interpolate number register) and \* (expand user-defined string) are implemented. This lets mandoc(1) handle the baroque low-level roff code found at the beginning of the ggrep(1) manual. Thanks to pascal@ for the report.
2014-04-07We already supported (outer) user-defined strings containing referencesIngo Schwarze
to other (inner) user-defined strings in their values, such that the inner ones get expanded at expansion time of the outer ones (delayed evaluation). Now we also support specifying the name of an (outer) user-defined string to expand using the expanded values of some other (inner) user-defined strings (indirect reference).
2014-04-07Almost complete implementation of roff(7) numerical expressions.Ingo Schwarze
Support all binary operators except ';' (scale conversion). Fully support chained operations and nested parentheses. Use this for the .nr, .if, and .ie requests. While here, fix parsing of integer numbers in roff_getnum().
2014-04-05Implement the roff(7) .rr (remove register) request.Ingo Schwarze
As reported by sthen@, the perl-5.18 pod2man(1) preamble thinks cool kids use that in manuals. I hope *you* know better.
2014-03-30Support relative arguments to .ll (increase or decrease line length).Ingo Schwarze
2014-03-30Implement the roff(7) .ll (line length) request.Ingo Schwarze
Found by naddy@ in the textproc/enchant(1) port. Of course, do not use this in new manuals.
2014-03-30make -Tascii explicit, to be safe when -Tlocale becomes the defaultIngo Schwarze
2014-03-08Improve .if/.ie condition handling.Ingo Schwarze
* Support string comparisons. * Support negation not only for numerical, but for all conditions. * Switch the `o' condition from false to true. * Handle the `c', `d', and `r' conditions as false for now. * Use int for boolean data instead of rolling our own "enum roffrule"; needed such that we can use the standard ! and == operators. Havard Eidnes reported via the NetBSD bug tracking system that some Tcl*(3) manuals need this, and Thomas Klausner <wiz at NetBSD> forwarded the report to me. This doesn't make the crazy Tcl*(3) macrology maze happy yet, but brings us a bit closer.
2014-03-07In roff_cond_sub(), make sure that the incorrect input sequence `\\}',Ingo Schwarze
when found on a macro line, does not close a conditional block. The companion function roff_cond_text() already did this correctly, but make the code more readable without functional change. While here, report the correct column number in related error messages.