aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_validate.c
Commit message (Collapse)AuthorAgeFilesLines
* Allow -width for lists to be cached in mdoc_bl. This requires someKristaps Dzonsons2010-06-131-12/+14
| | | | | | trickery because widths may be on-the-fly recalculated. I don't like how these are split between mdoc_action.c and mdoc_validate.c, but for the time being, it'll do.
* Cached `Bl -offset' into mdoc_bl. Removed erroneous "-offset defaultsKristaps Dzonsons2010-06-121-7/+16
| | | | | to 6n if no value is specified" and added regression tests for `Bl' testing against the empty -offset argument.
* Moved `Bl -compact' into cached data. This allowed the removal ofKristaps Dzonsons2010-06-121-13/+14
| | | | scanning the argv list in print_bvspace(), and thus the parent pointer.
* `Bl' is now using a struct instead of a single enum mdoc_list for itsKristaps Dzonsons2010-06-121-13/+14
| | | | cached values. You can probably guess where this is going.
* Removed stipulation that an empty `Bd -offset' will default to 6n. NotKristaps Dzonsons2010-06-121-18/+3
| | | | | | | sure where this came about. Added regression tests to convince myself that this is so. Also consolidated COMPATIBILITY notes regarding `Bd'. Added COMPATIBILITY note to the effect that old groff pukes on `Bd -compact -ragged' (regression test will fail on old groff).
* Cache all of `Bd's resolved arguments into mdoc_bd, which is stashed inKristaps Dzonsons2010-06-121-13/+60
| | | | | | the "data" union in mdoc_node. Allows me to remove some ugly loops in the front-end and duplicate tests in mdoc_action.c. Add a regression test to make sure we're not doing anything bad (more to come).
* Added enum mdoc_disp (similar to enum mdoc_list). Display types are nowKristaps Dzonsons2010-06-121-21/+43
| | | | | | | | | | | only calculated once in mdoc_validate.c. Noted that `Bd -file xxx' is not supported: it now raises a fatal warning. This is noted in mdoc.7. Empty `Bd' now defaults to LIST_ragged, which is not quite what groff does, but close enough (gross just throws away the `Bd' and gets upset when it encounters an `Ed').
* Squash bug noted by Ulrich Spoerlein where "-" were being converted toKristaps Dzonsons2010-06-091-11/+8
| | | | | | | | | 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.
* Consolidated list processing to a single loop in mdoc_validate.c. ThisKristaps Dzonsons2010-06-031-64/+106
| | | | | | | | | | relieves having to repeat running over the argument list in mdoc_action.c and mdoc_validate.c. Default to LIST_item for type-less lists (groff technically doesn't do this: it just ignores the `It' lines altogether). Make MANDOC_LISTTYPE be a recoverable error.
* Cleanup post_bl_head() to use enum mdoc_list (avoid traversing thatKristaps Dzonsons2010-05-311-11/+14
| | | | | | | | list). Reverted MANDOC_COLUMNS to be a bad-bad syntax error: we don't, and apparently never have, allowed mixing of -column syntaxes. This would have segfaulted if encountered.
* Clean up the validation code for `It' macros: use enum mdoc_listKristaps Dzonsons2010-05-311-72/+40
| | | | | instead of iterating over arguments and only scan with `-column', which needs the count of arguments.
* Remove enum mdocargerr from phrase() (unused).Kristaps Dzonsons2010-05-311-1/+2
| | | | | | | | | | | | | | Add `Ta' macro, which is basically a NULL case everywhere but in mdoc_macro.c, where it closes out an existing `It' body scope and opens a new one, then continues parsing as in phrase() (TODO: merge these two?). Fix where scope-breaking was silently just dying instead of printing an error. Fix where trailing `Ta' or tab weren't creating a new MDOC_BODY context. We now support arbitrarily complex `It' contents for `Bl -column'.
* Migrate `Bl -column' phrases to be MDOC_BODY instead of MDOC_HEAD. ThisKristaps Dzonsons2010-05-301-8/+10
| | | | | | | | | | 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. Recorded change of AST BNF in mdoc.3.
* Make check for case a little more intuitive (suggested by joerg@).Kristaps Dzonsons2010-05-301-4/+2
|
* Made `Dt' default to LOCAL and UNKNOWN instead of local and unknown (note case).Kristaps Dzonsons2010-05-301-4/+25
| | | | | | | | Have `Dt' default to UNKNOWN if it's an empty string. Raise a warning if `Dt' title isn't capitalised. Sync'd `Dt' documentation with reality.
* Documented `Ud'.Kristaps Dzonsons2010-05-261-6/+17
| | | | | | | | | | | Proper EOS handling for `Rv', `Ex', `Ud', and `Bt'. Both `Bt' and `Ud' now warn about and discard line arguments (reported by Ulrich Spoerlein). Collapsed posts_xr into posts_wtext (harmless: they're the same thing). Added regressions for `Ud' and `Bt'.
* Fixed `Lb' to be in_line (reported by Ulrich Spoerlein).Kristaps Dzonsons2010-05-261-3/+2
| | | | | | | | | Added `Lb' documentation to mdoc.7. Removed harmless but superfluous pre_lb check (was just NULL entries). Added regressions for `Lb' (NOTE that these will only run on new groff, as old groff doesn't support `Lb' at all).
* Smarten BADCHAR check to allow ASCII_HYPH.Kristaps Dzonsons2010-05-251-2/+2
| | | | Fix index.sgml not to puke (the relevant section will be re-written for the release anyway, but I hate seeing errors).
* Lifted 64-byte max width for Sh (now BUFSIZ).Kristaps Dzonsons2010-05-241-4/+5
|
* Increase performance by stashing the list type in struct mdoc_node.Kristaps Dzonsons2010-05-171-19/+11
| | | | | | | 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.
* Enable the unified error/warning enumeration in mandoc.h that'sKristaps Dzonsons2010-05-171-99/+149
| | | | | | | | | | | 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.
* LIBRARY can also occur in section 9.Kristaps Dzonsons2010-05-151-10/+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.
* Remove in-manual-section warnings for Fd and Lb (ok joerg@, schwarze@).Kristaps Dzonsons2010-05-141-48/+4
|
* Backed out check for `Ex' manual sec (ok schwarze@, joerg@), in turn backing ↵Kristaps Dzonsons2010-05-141-36/+2
| | | | out check_msec() and deps.
* "Warn on unknown argument for .At and print it like [new] groff." (patch by ↵Kristaps Dzonsons2010-05-141-2/+2
| | | | | | | Joerg Sonnenberger, ed. Kristaps) Keep short-log of commits in index.sgml. Document compatibility with new/old groff in mdoc.7.
* "Invalid standard argument should be a warning. Just leak it into theKristaps Dzonsons2010-05-141-2/+2
| | | | output." (patch by Joerg Sonnenberger)
* "If the last column wasn't specified, it is auto-sized." (patch by Joerg ↵Kristaps Dzonsons2010-05-141-3/+3
| | | | Sonnenberger)
* mdoc_atosec -> mdoc_str2sec (consistent with str2 being different from a2).Kristaps Dzonsons2010-05-121-5/+8
| | | | | Changed ordering of sections (EXIT STATUS moved around), argued for by Ulrich Sporlein. Fixed mdoc_str2sec not to use weird structure.
* Remove -fno-ign-chars as well-argued by Ingo Schwarze. Patch by Ingo ↵Kristaps Dzonsons2010-05-091-14/+3
| | | | Schwarze, too.
* Lint fixes (type-safety for enums via -cefuh).Kristaps Dzonsons2010-05-081-2/+2
|
* Removed manual-section-calling restrictions for `Cd' and and `Ex' (requested ↵Kristaps Dzonsons2010-04-071-14/+2
| | | | by Joerg Sonnenberger).
* Allowing `Cd' to be in section 9 (noted by Joerg Sonnenberger).Kristaps Dzonsons2010-04-071-2/+2
|
* Removed warning for `Er' when not used in certain sections (pointed out by ↵Kristaps Dzonsons2010-04-061-11/+2
| | | | Joerg Sonnenberger).
* Allow `Bd' to accept (warn about then ignore) in-line arguments.Kristaps Dzonsons2010-04-061-2/+4
|
* Cleaned up post_bl_head() and fixed erroneous reporting of child nodes.Kristaps Dzonsons2010-04-061-12/+13
|
* Let `Bl' accept arguments on the head line with a warning (these are ignored ↵Kristaps Dzonsons2010-04-061-3/+4
| | | | in the front-end device) (noted by Theo de Raadt).
* Merged patch by Ingo Schwarze allowing `Xr' to pass through with no ↵Kristaps Dzonsons2010-04-031-2/+2
| | | | arguments (emits warning of course).
* Modified version of Ingo Schwarze's patch so that -man doesn't puke when a ↵Kristaps Dzonsons2010-04-031-1/+3
| | | | TH isn't specified.
* Merged Ingo Schwarze's patch (plus documentation) for removing extraneous ↵Kristaps Dzonsons2010-04-031-3/+14
| | | | list types, which happens fairly often.
* Merging patch by Ingo Schwarze.Kristaps Dzonsons2010-04-031-3/+4
|
* Macro types enum-ated (enum mdoct) (for easier debugging in gdb of "tok" ↵Kristaps Dzonsons2010-03-311-3/+3
| | | | | | | values). Initial check-in of Ingo Schwarze's patch for Xo/Xc handling (in blocks ifdef'd "UGLY"). Put Oc-close-Op parts into UGLY ifdef blocks.
* Made `Xr' compatible with groff calling conventions where arguments ↵Kristaps Dzonsons2010-02-171-4/+2
| | | | | | following the trailing section are implicitly `Ns'd. Based on a patch submitted by Ingo Schwarze.
* Fix in handling Vt in SYNOPSIS with trailing punctuation. Spotted by Joerg ↵Kristaps Dzonsons2010-01-301-2/+30
| | | | Sonnenberger.
* Big check-in of compatibility layer. This should work on most major ↵Kristaps Dzonsons2010-01-011-5/+5
| | | | architectures. Thanks to Joerg Sonnenberger.
* `Bl' lets `Sm' slip by as a child. Noted by Ingo Schwarze.Kristaps Dzonsons2010-01-011-4/+11
|
* Added mandoc_a2time() for proper date conversion.Kristaps Dzonsons2009-11-021-2/+4
| | | | | Fitted TH and Dd handlers to use mandoc_a2time(). Documented date syntax for -man, fixed documentation for -mdoc.
* Fixed -Thtml printing of -ohang lists (-mdoc).Kristaps Dzonsons2009-10-311-1/+3
| | | | Fixed validation of -ohang lists as having no widths.
* Using perror() instead of fprintf for failure from library functions.Kristaps Dzonsons2009-10-311-2/+1
|
* Full `%U' support.Kristaps Dzonsons2009-10-261-7/+6
| | | | | | | `Lk' display fixed. Renamed arg2xxxx as a2xxxx for consistency. Renamed print_foot to print_man_foot for consistency. Removed default printing of `~' when `Lk' not provided (not sure where I got that from).
* Added `%U' to -mdoc (doesn't render in a nice way yet).Kristaps Dzonsons2009-10-241-1/+4
|