aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_action.c
Commit message (Collapse)AuthorAgeFilesLines
* Downstream maintainers: this removes UGLY! I don't want divergingKristaps Dzonsons2010-06-271-1/+6
| | | | | | | | | functionality and UGLY works quite well thanks to schwarze@'s careful attention. This also backs out function-prototype changes for struct regset, instead stuffing a pointer to the regset directly into struct mdoc/man/roff.
* Churn as I finish email address migration kth.se -> bsd.lv.Kristaps Dzonsons2010-06-191-2/+2
|
* Allow -width for lists to be cached in mdoc_bl. This requires someKristaps Dzonsons2010-06-131-42/+53
| | | | | | 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.
* Small optimisations in mdoc_action list processing. Cleanups making wayKristaps Dzonsons2010-06-131-38/+36
| | | | for "width" cached argument.
* Cached `Bl -offset' into mdoc_bl. Removed erroneous "-offset defaultsKristaps Dzonsons2010-06-121-42/+2
| | | | | to 6n if no value is specified" and added regression tests for `Bl' testing against the empty -offset argument.
* Cache all of `Bd's resolved arguments into mdoc_bd, which is stashed inKristaps Dzonsons2010-06-121-5/+3
| | | | | | 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-9/+5
| | | | | | | | | | | 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').
* Consolidated list processing to a single loop in mdoc_validate.c. ThisKristaps Dzonsons2010-06-031-59/+5
| | | | | | | | | | 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.
* 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'.
* Made `Dt' default to LOCAL and UNKNOWN instead of local and unknown (note case).Kristaps Dzonsons2010-05-301-5/+6
| | | | | | | | 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.
* Moved printing of empty word [back] into mdoc_action.c so that it's notKristaps Dzonsons2010-05-291-2/+24
| | | | mirrored across front-ends.
* If a .Bl -tag lacks a -width, skip all non-It macros for the implicitJoerg Sonnenberger2010-05-241-3/+6
| | | | | | calculation. E.g. .Sm can occur as direct child of .Bl. OK schwarze@
* Increase performance by stashing the list type in struct mdoc_node.Kristaps Dzonsons2010-05-171-4/+59
| | | | | | | 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-22/+46
| | | | | | | | | | | 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-20/+18
| | | | | | 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.
* "Warn on unknown argument for .At and print it like [new] groff." (patch by ↵Kristaps Dzonsons2010-05-141-6/+18
| | | | | | | 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-4/+5
| | | | output." (patch by Joerg Sonnenberger)
* mdoc_atosec -> mdoc_str2sec (consistent with str2 being different from a2).Kristaps Dzonsons2010-05-121-2/+2
| | | | | Changed ordering of sections (EXIT STATUS moved around), argued for by Ulrich Sporlein. Fixed mdoc_str2sec not to use weird structure.
* Lint fixes (type-safety for enums via -cefuh).Kristaps Dzonsons2010-05-081-5/+5
|
* Migrating mdoc_node_free() and mdoc_node_freelist() to use ↵Kristaps Dzonsons2010-04-061-22/+3
| | | | mdoc_node_delete(), which has a more intuitive interface and mirrors libman.
* Fix issue of non-NAME sections triggering "no sections" error, reported by ↵Kristaps Dzonsons2010-04-051-2/+6
| | | | Christian Weisgerber, patched by Ingo Schwarze.
* Macro types enum-ated (enum mdoct) (for easier debugging in gdb of "tok" ↵Kristaps Dzonsons2010-03-311-2/+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.
* Big check-in of compatibility layer. This should work on most major ↵Kristaps Dzonsons2010-01-011-5/+5
| | | | architectures. Thanks to Joerg Sonnenberger.
* Added mandoc_a2time() for proper date conversion.Kristaps Dzonsons2009-11-021-4/+5
| | | | | Fitted TH and Dd handlers to use mandoc_a2time(). Documented date syntax for -man, fixed documentation for -mdoc.
* Using perror() instead of fprintf for failure from library functions.Kristaps Dzonsons2009-10-311-3/+1
|
* Lint fixes.Kristaps Dzonsons2009-10-301-1/+2
| | | | Made realloc puke with fprintf.
* Clean-ups in mdoc_action (using libmandoc.h functions).Kristaps Dzonsons2009-10-291-152/+173
|
* Fix to segfault in ordering Rs blocks (d'oh!).VERSION_1_9_11Kristaps Dzonsons2009-10-261-3/+4
| | | | Version: 1.9.11.
* Full `%U' support.Kristaps Dzonsons2009-10-261-3/+5
| | | | | | | `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/+2
|
* Added ability to set OS name at compile-time with -DOSNAME="\"foo\"".Kristaps Dzonsons2009-10-221-1/+14
|
* Lint check (noop).Kristaps Dzonsons2009-09-251-1/+2
|
* Fixed segfault in `Rs' empty block.Kristaps Dzonsons2009-09-241-1/+2
|
* Added EBADCHILD error (bad child of parent context).Kristaps Dzonsons2009-09-241-8/+89
| | | | | `Rs' post-checks that all children are proper bibliographic elements. `Rs' correctly re-orders its children as per groff's output (including %C).
* -offset string can now be blank (supplied with 6n as stipulated by ↵Kristaps Dzonsons2009-09-241-12/+49
| | | | mdoc.samples).
* Lintifications.Kristaps Dzonsons2009-09-161-2/+2
|
* Lookup hashes are now static tables, ordered first-level by second ↵Kristaps Dzonsons2009-09-161-2/+2
| | | | character, then randomly along a chain. Improves performance by a small fraction and considerably cleans up hash sources.
* Updated manual structure in mdoc.7.Kristaps Dzonsons2009-08-201-188/+173
| | | | | | Synchronised mdoc.template and mdoc.7 manual structure. `Rv' and `Ex' now accept multiple arguments (-std made standalone, terms as children). `Rv' and `Ex' format correctly in -Tascii (plurals, commas, etc.).
* Made out-of-order prologue macros not cause an error.Kristaps Dzonsons2009-07-261-2/+5
|
* Patches and results of LLVM static analysis (thanks uqs@sporlein.net).Kristaps Dzonsons2009-07-251-2/+1
|
* Added `St -ieee1275-94'.Kristaps Dzonsons2009-07-241-2/+7
| | | | Documented a future `Bd' fixme.
* Added default print of `~' with empty `Pa' (not documented with OpenBSD, but ↵Kristaps Dzonsons2009-07-211-6/+6
| | | | still applicable).
* Added `br' and `sp' macros (requested by joerg@netbsd.org, jmc@openbsd.org).Kristaps Dzonsons2009-07-171-1/+3
|
* Subtle fixes correcting vis count with erroneously-decorated whitespace.Kristaps Dzonsons2009-07-161-16/+1
|
* Removed assertion (disregarded blank literal lines).Kristaps Dzonsons2009-07-151-1/+16
|
* Replacement of `Lb' in mdoc_action.c.Kristaps Dzonsons2009-07-121-2/+33
| | | | | | Added warning against bogus `Lb' (like groff does). Added proper quotes around `Lb' in mdoc_term.c. Moved mdoc_a2lib -> libmdoc (where it belongs).
* Moved mdoc_a2st() out of mdoc.h -> libmdoc.h (replacement in mdoc_action.c).Kristaps Dzonsons2009-07-121-2/+19
| | | | Made bad standards into an error (were a warning).
* Moved mdoc_a2att() into libmdoc (replacement happens in mdoc_action.c).Kristaps Dzonsons2009-07-121-13/+39
|
* Made `In' handling work in new-groff style (see mdoc.samples).Kristaps Dzonsons2009-07-071-2/+3
|
* Consolidated all err/warnings into mdoc.c via libmdoc.h.Kristaps Dzonsons2009-07-061-84/+30
|