summaryrefslogtreecommitdiffstats
path: root/man_validate.c
Commit message (Collapse)AuthorAgeFilesLines
* Make empty sections and parts (SH, SS, RS) only produce a warning if itKristaps Dzonsons2011-03-221-2/+4
| | | | has no children. Noted by Brad, added to TODO by schwarze@.
* libmdoc.h and libman.h were including mdoc.h and man.h, respectively.Kristaps Dzonsons2011-03-221-0/+1
| | | | | Don't have them do that (includes in header files = faugh), and have individual files directly include these files.
* Consolidate messages. Have all parse-time messages (in libmdoc,Kristaps Dzonsons2011-03-201-9/+12
| | | | | | | | | libroff, etc., etc.) route into mandoc_msg() and mandoc_vmsg(), for the time being in libmandoc.h. This requires struct mparse to be passed into the allocation routines instead of mandocmsg and a void pointer. Then, move some of the functionality of the old mmsg() into read.c's mparse_mmsg() (check against wlevel and setting of file_status) and use main.c's mmsg() as simply a printing tool.
* Clean-up in libman: make all calls to man_*msg not check return value.Kristaps Dzonsons2011-03-171-3/+2
| | | | Also convert man_vmsg to return void.
* Clean up date handling,Ingo Schwarze2011-03-071-23/+15
| | | | | | | | | | | | as a first step to get rid of the frequent petty warnings in this area: - always store dates as strings, not as seconds since the Epoch - for input, try the three most common formats everywhere - for unrecognized format, just pass the date though verbatim - when there is no date at all, still use the current date Originally triggered by a one-line patch from Tim van der Molen, <tbvdm at xs4all dot nl>, which is included here. Feedback and OK on manual parts from jmc@. "please check this in" kristaps@
* Allow -man to process EQN as well. Also fix a segfault in missing caseKristaps Dzonsons2011-02-091-0/+2
| | | | statements in the post-handler for EQN in -mdoc and -man.
* Add initial libmdoc and libman top-most machinery for accepting TBLKristaps Dzonsons2011-02-061-0/+2
| | | | | directives. For now this will just ignore them (except for -Ttree, which just notes that an EQN's been accepted).
* Refrain from throwing fatal errors forIngo Schwarze2011-01-171-33/+23
| | | | | | | * .br .sp .nf .fi .na with arguments - just skip the arguments * .TH lacking arguments - use empty strings instead like groff * .TH with excessive arguments - skip those Reminded by joerg@, ok kristaps@.
* Downgrade -man message of ignored empty paragraph to MANDOC_IGNPAR. TheKristaps Dzonsons2011-01-121-30/+19
| | | | | | | | | | | change in man_macro.c was from an assertion caused by a subtle problem: (1) macro is removed, causing m->last to be m->last->parent; (2) by jumping to the m->last->parent after post-validation, the original m->last->parent is skipped; (3) the rewinder climbs to the root of the tree and aborts. The original issue recorded in the TODO by schwarze@, reminded by Brad Smith.
* Make out-of-context `fi' invocations not cause an error, but just aKristaps Dzonsons2011-01-121-1/+1
| | | | warning. From a TODO by schwarze@, originally noted by Brad Smith.
* Add -man support for tables. Like -mdoc, this consists of anKristaps Dzonsons2011-01-011-3/+11
| | | | | | | external-facing function man_addspan() (this required shuffling around the descope routine) and hooks elsewhere. Also fixed mdoc.c's post-validation of tables.
* Remove `i' and `r' macro handlers. These macros, originally part of theKristaps Dzonsons2010-12-081-2/+0
| | | | | | | | me package, aren't recognised by "groff -mandoc" so we don't need to do so either. Discussed on tech@ with schwarze@. While at it, remove references to `b' in man.7. As far as I know, this was never supported anyway.
* Add support for `ft' macro found in groff(7). Based on a patch byKristaps Dzonsons2010-12-061-0/+55
| | | | | schwarze@, but without the -T[x]html handling, which structurally does not work. Also add man.7 documentation (not in original patch).
* Make return(man_nmsg(...)) by a simple declaration.Kristaps Dzonsons2010-12-061-18/+20
| | | | | | Make non-uppercase warning only occur once. Make scope-open-on-error warning only occur once.
* Allow HP/IP/etc. to have no arguments, as they're optional. From a field-Kristaps Dzonsons2010-12-061-3/+1
| | | | tested patch by schwarze@.
* Remove `Sp', `Vb', and `Ve' (as per schwarze@'s changes in OpenBSD),Kristaps Dzonsons2010-12-051-4/+0
| | | | which are now accomodated for the new libroff modifications.
* Move all man_action.c routines into man_validate.cKristaps Dzonsons2010-11-301-8/+191
|
* Quiesce Linux header-inclusion warnings.Kristaps Dzonsons2010-10-111-0/+1
|
* Implement a simple, consistent user interface for error handling.Ingo Schwarze2010-08-201-6/+2
| | | | | | | | | | | | | | | | | We now have sufficient practical experience to know what we want, so this is intended to be final: - provide -Wlevel (warning, error or fatal) to select what you care about - provide -Wstop to stop after parsing a file with warnings you care about - provide consistent exit status codes for those warnings you care about - fully document what warnings, errors and fatal errors mean - remove all other cruft from the user interface, less is more: - remove all -f knobs along with the whole -f option - remove the old -Werror because calling warnings "fatal" is silly - always finish parsing each file, unless fatal errors prevent that This commit also includes a couple of related simplifications behind the scenes regarding error handling. Feedback and OK kristaps@; Joerg Sonnenberger (NetBSD) and Sascha Wildner (DragonFly BSD) agree with the general direction.
* Sync to OpenBSD: add missing Copyright years.Ingo Schwarze2010-07-311-1/+1
| | | | | I checked that substantial changes were committed to these files during these years.
* Added `in' macro support for -man -Tascii. This is not yet supported inKristaps Dzonsons2010-07-221-4/+5
| | | | -Thtml (I'm surprised to note that neither is LITERAL mode).
* Strip non-graphable input characters from input. The manualsKristaps Dzonsons2010-07-201-19/+25
| | | | | | | | | specifically say that this is not allowed, and were it allowed, output would be inconsistent across output media (-Tps will puke, non-your-charset terminals will puke, etc.). With this done, simplify check_text() to only check escapes and for tabs. Add in a new tab warning, too.
* Notes: this must be done later. \b in the input will cause havoc.Kristaps Dzonsons2010-06-281-0/+5
|
* Churn as I finish email address migration kth.se -> bsd.lv.Kristaps Dzonsons2010-06-191-1/+1
|
* Squash bug noted by Ulrich Spoerlein where "-" were being converted toKristaps Dzonsons2010-06-091-3/+3
| | | | | | | | | ASCII_HYPH, as per normal, but were screwing up mandoc_special(). Fixed by making mandoc_special() first check isspace() instead of ! isgraph(), then normalise its string as it passes out. This require de-constifying some validation routines not already de-constified (those in libman), but that's ok, because I'd like to be pushing actions into validation routines to save on space and redundant calculations.
* Smarten BADCHAR check to allow ASCII_HYPH.Kristaps Dzonsons2010-05-251-1/+1
| | | | Fix index.sgml not to puke (the relevant section will be re-written for the release anyway, but I hate seeing errors).
* Enable the unified error/warning enumeration in mandoc.h that'sKristaps Dzonsons2010-05-171-29/+38
| | | | | | | | | | | stringified in main.c. Allow `An' to handle an argument and child (with a warning). Allow `Rv' and `Ex' to work without a prior `Nm' as groff does (with a warning). Allow inconsistent column syntax to only raise a warning.
* Add support for .AT. Properly implement .UC. Add regress tests.Joerg Sonnenberger2010-05-171-0/+1
|
* Remove `am', `ami', `de', `dei', and `.' from -man, as they're now in the ↵Kristaps Dzonsons2010-05-151-23/+0
| | | | roff preprocessor.
* Pull `ig' out of -man and leave it the roff preparser.Kristaps Dzonsons2010-05-151-3/+1
|
* Removed restriction on integer manual sections in -man.Kristaps Dzonsons2010-05-151-1/+1
|
* Pulled back in mysterious lost le1 <-> eq0 for Sp macro.Kristaps Dzonsons2010-05-141-1/+1
|
* Remove -fno-ign-chars as well-argued by Ingo Schwarze. Patch by Ingo ↵Kristaps Dzonsons2010-05-091-3/+1
| | | | Schwarze, too.
* Modified version of Ingo Schwarze's patch so that -man doesn't puke when a ↵Kristaps Dzonsons2010-04-031-2/+13
| | | | TH isn't specified.
* Final (?) fix to issue pointed out by Sascha Wildner: roff instructions ↵Kristaps Dzonsons2010-03-291-1/+1
| | | | clobbering prior scope rules and line modes.
* Fixed re-adjustment of scope in exiting roff instructions (libman).Kristaps Dzonsons2010-03-271-2/+21
| | | | | | Added title-case check for (libman). Fixed premature closure of roff instruction scope (libman). Added documentation of ignored roff macros to man(3).
* Using man_node_delete() instead of man_node_free()/man_node_freelist() and ↵Kristaps Dzonsons2010-03-241-0/+26
| | | | | | | friends (much simpler). Split blk_imp() into blk_exp() (explicit macros), blk_dotted() (roff macros), and the original. Added de, dei, am, ami, and ig roff macros (for now, these are discarded within the parse).
* Support for pod2man standard header macros (Vb, Ve, Sp). Based largely on a ↵Kristaps Dzonsons2010-03-231-2/+5
| | | | set of patches by Ingo Schwarze.
* Accomodate (libman) for next-line macros followed by non-text macros `na', ↵Kristaps Dzonsons2010-03-221-3/+3
| | | | | | `sp', and `br'. Based on a patch by Ingo Schwarze.
* Big check-in of compatibility layer. This should work on most major ↵Kristaps Dzonsons2010-01-011-0/+4
| | | | architectures. Thanks to Joerg Sonnenberger.
* Added mandoc_a2time() for proper date conversion.Kristaps Dzonsons2009-11-021-1/+1
| | | | | Fitted TH and Dd handlers to use mandoc_a2time(). Documented date syntax for -man, fixed documentation for -mdoc.
* Added `PD' to -man (doesn't do anything, yet).Kristaps Dzonsons2009-10-241-0/+1
|
* Removed number-check for `sp' in -Tman, as nroff accepts non-numerics as a ↵Kristaps Dzonsons2009-10-181-34/+3
| | | | single vspace.
* Added `UC' libman macro (has no effect).Kristaps Dzonsons2009-08-221-0/+1
| | | | | Corrected `UC' and `DT' not to print their arguments. Noted that `UC' and `DT' shouldn't be used.
* `RS' warns if empty body.Kristaps Dzonsons2009-08-211-1/+13
|
* Open explicit scope on libman exit now only generates warning.Kristaps Dzonsons2009-08-211-23/+11
| | | | Consecutive ELINE scopes are now pruned (with a warning).
* Added `DT' macro (pointed out by joerg@netbsd.org).Kristaps Dzonsons2009-08-201-1/+2
|
* libman checks for open explicit scopes on exit.Kristaps Dzonsons2009-08-191-2/+0
|
* Added RS/RE macro pair (had to adjust closing rules, sec/ssec/rs/par).Kristaps Dzonsons2009-08-191-0/+4
|
* Fixed missing check for open ELINE scope in BLINE macro.Kristaps Dzonsons2009-08-181-6/+8
|