summaryrefslogtreecommitdiffstats
path: root/roff_validate.c
Commit message (Collapse)AuthorAgeFilesLines
* Because mandoc_aux.h and mandoc.h use __attribute__, all files thatIngo Schwarze2020-06-221-1/+3
| | | | | | | | include mandoc_aux.h or mandoc.h need to include config.h, too. It is suspected that for example IRIX needs this, or it is likely to throw errors in these files because the system compiler doesn't understand __attribute__. Issue reported by Kazuo Kuroi <kazuo at irixnet dot org>.
* Introduce the concept of nodes that are semantically transparent:Ingo Schwarze2020-02-271-3/+3
| | | | | | | | | | | | | | they are skipped when looking for previous or following high-level macros. Examples include roff(7) .ft, .ll, and .ta, mdoc(7) .Sm and .Tg, and man(7) .DT and .PD. Use this concept for a variety of improved decisions in various validators and formatters. While here, * remove a few const qualifiers on struct arguments that caused trouble; * get rid of some more Yoda notation in the vicinity; * and apply some other stylistic improvements in the vicinity. I found this class of issues while considering .Tg patches from kn@.
* oops, one change ROFF_NOFILL -> NODE_NOFILL was forgotten in rev. 1.17Ingo Schwarze2018-12-311-1/+1
|
* Use the new flag NODE_NOFILL in the validators, which is sometimesIngo Schwarze2018-12-311-1/+1
| | | | | | simpler and always more robust. In particular, move the nesting warnings for .EX and .EE from man_state(), where they were misplaced, to the man(7) validator.
* Move parsing of the .nf and .fi (fill mode) requests from the man(7)Ingo Schwarze2018-12-311-9/+18
| | | | | | parser to the roff(7) parser. As a side effect, .nf and .fi are now also parsed in mdoc(7) input, though the mdoc(7) formatters still ignore most of their effect.
* Yet another round of improvements to manual font selection.Ingo Schwarze2018-12-161-24/+2
| | | | | | | | | Unify handling of \f and .ft. Support \f4 (bold+italic). Support ".ft BI" and ".ft CW" for terminal output. Support the .ft request in HTML output. Reject the bogus fonts \f(C1, \f(C2, \f(C3, and \f(CP. In regress.pl, only strip leading whitespace in math mode.
* Almost mechanical diff to remove the "struct mparse *" argumentIngo Schwarze2018-12-141-8/+7
| | | | | | | | from mandoc_msg(), where it is no longer used. While here, rename mandoc_vmsg() to mandoc_msg() and retire the old version: There is really no point in having another function merely to save "%s" in a few places. Minus 140 lines of code.
* Major cleanup; may imply minor changes in edge cases of error reporting.Ingo Schwarze2018-12-141-1/+1
| | | | | | | | | | | Finally, drop support for the run-time configurable mandocmsg() callback. It was over-engineered from the start, never used for anything in a decade, and repeatedly caused maintenance headaches. Consolidate reporting infrastructure into two files, mandoc.h and mandoc_msg.c, mopping up the bits and pieces that were scattered around main.c, read.c, mandoc_parse.h, libmandoc.h, the prototypes of four parsing-related functions, and both parser structs.
* During validation, drop .br before a text line starting with aIngo Schwarze2018-12-041-0/+8
| | | | | | | | | blank, rather than teaching each formatter individually to ignore the .br in such situations. That's simpler and also results in better diagnostics. Mark Harris <mark dot hsj at gmail dot com> reported that -T html got confused in particular.
* Clean up the validation of .Pp, .PP, .sp, and .br. Make sure allIngo Schwarze2018-12-041-2/+58
| | | | | | | | | | | | | | combinations are handled, and are handled in a systematic manner. This resolves some erratic duplicate handling, handles a number of missing cases, and improves diagnostics in various respects. Move validation of .br and .sp to the roff validation module rather than doing that twice in the mdoc and man validation modules. Move the node relinking function to the roff library where it belongs. In validation functions, only look at the node itself, at previous nodes, and at descendants, not at following nodes or ancestors, such that only nodes are inspected which are already validated.
* The groff man-ext macros define fonts CB, CI, and CR,Ingo Schwarze2018-08-101-3/+5
| | | | | and some groff manual pages actually use them in .ft requests. It's easy enough to handle these .ft requests in mandoc, too.
* Naive implementation of the roff(7) .po (page offset) request.Ingo Schwarze2017-06-141-0/+1
| | | | | | This clearly works when .po is called on the top level, but might not be sophisticated enough if people call .po inside indentation-changing contexts, but i haven't seen that in manual pages (yet :).
* implement roff(7) .rj (right justify) requestIngo Schwarze2017-06-141-0/+1
|
* Minimal implementation of the roff(7) .ce request (center a numberIngo Schwarze2017-06-061-0/+1
| | | | | of input lines without filling). Contrary to groff, high-level macros abort .ce mode for now.
* Implement the roff(7) .mc (right margin character) request.Ingo Schwarze2017-06-041-1/+2
| | | | | | The Tcl/Tk manual pages use this extensively. Delete the TERM_MAXMARGIN hack, it breaks .mc inside .nf; instead, implement a proper TERMP_BRNEVER flag.
* Basic implementation of the roff(7) .ti (temporary indent) request.Ingo Schwarze2017-05-081-0/+1
| | | | Needed by about four dozen ports (thanks to naddy@ for the research).
* Basic implementation of the roff(7) .ta (define tab stops) request.Ingo Schwarze2017-05-071-0/+1
| | | | | | This is the first feature made possible by the parser reorganization. Improves the formatting of the SYNOPSIS in many Xenocara GL manuals. Also important for ports, as reported by many, including naddy@.
* Move .sp to the roff modules. Enough infrastructure is in placeIngo Schwarze2017-05-051-0/+1
| | | | now that this actually saves code: -70 LOC.
* move .ll to the roff modulesIngo Schwarze2017-05-051-0/+1
|
* Move handling of the roff(7) .ft request from the man(7)Ingo Schwarze2017-05-051-0/+89
modules to the new roff(7) modules. As a side effect, mdoc(7) now handles .ft, too. Of course, do not use that.