summaryrefslogtreecommitdiffstats
path: root/mdoc.h
Commit message (Collapse)AuthorAgeFilesLines
...
* Make struct_bl and struct_bd into pointers. This removes the need to doKristaps Dzonsons2010-07-011-2/+2
| | | | | | | | | | | copying on internals after modification. Even more importantly, if an ENDBODY token is provided, it would have been impossible for post-change copying of the data to take place in the BLOCK. This allows it to happen by dint of pointers. Also did some bikeshedding in mdoc_term.c: checking against enum type and explicitly casting to the "post" function to void. This is for my own readability.
* Support for badly nested blocks, written around the time ofIngo Schwarze2010-06-291-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | the Rostock mandoc hackathon and tested and polished since, supporting constructs like: .Ao Bo Ac Bc (exp breaking exp) .Aq Bo eol Bc (imp breaking exp) .Ao Bq Ac eol (exp breaking imp) .Ao Bo So Bc Ac Sc (double break, inner before outer) .Ao Bo So Ac Bc Sc (double break, outer before inner) .Ao Bo Ac So Bc Sc (broken breaker) .Ao Bo So Bc Do Ac Sc Dc (broken double breaker) There are still two known issues which are tricky: 1) Breaking two identical explicit blocks (Ao Bo Bo Ac or Aq Bo Bo eol) fails outright, triggering a bogus syntax error. 2) Breaking a block by two identical explicit blocks (Ao Ao Bo Ac Ac Bc or Ao Ao Bq Ac Ac eol) still has a minor rendering error left: "<ao1 <ao2 [bo ac2> ac1> bc]>" should not have the final ">". We can fix these later in the tree, let's not grow this diff too large. "get it in" kristaps@
* Following clue-stick applied by schwarze@, back out const-ness of regsetKristaps Dzonsons2010-06-271-1/+2
| | | | | | | | | passed in to libmdoc and libman. Fix mdoc.3 and man.3 EXAMPLE sections to include regset. Add MDOC_SYNPRETTY flag cueing front-end to nicely format certain values as if SEC_SYNOPSIS were the current section.
* Downstream maintainers: this removes UGLY! I don't want divergingKristaps Dzonsons2010-06-271-6/+3
| | | | | | | | | 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-ish check-in getting mdoc_parseln() and man_parseln() to accept aKristaps Dzonsons2010-06-261-1/+3
| | | | const struct regset pointer. No functionality.
* First step of adding register support. This is inspired by a significantKristaps Dzonsons2010-06-261-0/+1
| | | | | | patch by schwarze@. This commit adds support to libroff parsing `nr' into register set defined in regs.h. This will propogate into libmdoc and libman in later commits.
* Churn as I finish email address migration kth.se -> bsd.lv.Kristaps Dzonsons2010-06-191-1/+1
|
* Allow -width for lists to be cached in mdoc_bl. This requires someKristaps Dzonsons2010-06-131-0/+1
| | | | | | 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-0/+1
| | | | | 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-4/+5
| | | | 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-1/+5
| | | | cached values. You can probably guess where this is going.
* Cache all of `Bd's resolved arguments into mdoc_bd, which is stashed inKristaps Dzonsons2010-06-121-1/+7
| | | | | | 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-1/+11
| | | | | | | | | | | 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').
* Remove enum mdocargerr from phrase() (unused).Kristaps Dzonsons2010-05-311-0/+1
| | | | | | | | | | | | | | 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'.
* Increase performance by stashing the list type in struct mdoc_node.Kristaps Dzonsons2010-05-171-0/+19
| | | | | | | 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-8/+1
| | | | | | | | | | | 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.
* Allow roff_parseln() to be re-run.Kristaps Dzonsons2010-05-161-1/+1
| | | | | | | | | Allow roff_parseln() to manipulate the line buffer offset. This is used in situations like `.ie n .TH FOO 1' or `.ie n .ie n', where the line buffer offset is recalculated then the roff parser re-run. Fix mdoc_parseln() and man_parseln() to accept the initial line offset. WARNING: backed-out ALL roff macros whilst accomodating for how roff handles multi-line conditionals (in short, re-running the parser).
* LIBRARY can also occur in section 9.Kristaps Dzonsons2010-05-151-1/+1
| | | | | | 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.
* Fixed bug in -Thtml -mdoc where `Lb' would line-break in LIBRARY section.Kristaps Dzonsons2010-05-131-14/+14
| | | | | Fixed assumption that parse-point == 1 equates to beginning of line (false if whitespace separates macro and control character). Fixed line-break for non-first-macro in several SYNOPSIS macros.
* Tiny EOS patch. Back-end cues front-end through flag. Front-end cues ↵Kristaps Dzonsons2010-05-121-0/+1
| | | | output engine with flag.
* mdoc_atosec -> mdoc_str2sec (consistent with str2 being different from a2).Kristaps Dzonsons2010-05-121-2/+3
| | | | | 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-1/+0
| | | | Schwarze, too.
* Macro types enum-ated (enum mdoct) (for easier debugging in gdb of "tok" ↵Kristaps Dzonsons2010-03-311-123/+128
| | | | | | | 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.
* libmdoc and libman now using non-recoverable allocations (simpler code).Kristaps Dzonsons2009-10-301-1/+1
|
* Full `%U' support.Kristaps Dzonsons2009-10-261-2/+0
| | | | | | | `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 support for `Bd -centered', which appears in newer groffs (not yet ↵Kristaps Dzonsons2009-10-151-1/+2
| | | | implemented in centre-capable front-ends, i.e., -Thtml).
* Synchronised man.7, mdoc.7, mdoc.template manual structure.Kristaps Dzonsons2009-08-201-2/+2
|
* Updated manual structure in mdoc.7.Kristaps Dzonsons2009-08-201-1/+3
| | | | | | 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.).
* Removed superfluous FIXMEs.Kristaps Dzonsons2009-07-241-2/+1
|
* Added `br' and `sp' macros (requested by joerg@netbsd.org, jmc@openbsd.org).Kristaps Dzonsons2009-07-171-1/+3
|
* Replacement of `Lb' in mdoc_action.c.Kristaps Dzonsons2009-07-121-2/+0
| | | | | | 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-1/+0
| | | | Made bad standards into an error (were a warning).
* Moved mdoc_a2att() into libmdoc (replacement happens in mdoc_action.c).Kristaps Dzonsons2009-07-121-1/+0
|
* Initial removal of enum mdoc_warn from mdoc warnings (unnecessary complication).Kristaps Dzonsons2009-07-061-8/+1
|
* Added nchild decrement in libman (not used, but better in than forgotten).Kristaps Dzonsons2009-06-181-0/+1
| | | | Added nchild to libmdoc, deprecated count() functions in validator.
* Section orders are more elegantly handled (MDOC_PBODY is a flag).Kristaps Dzonsons2009-06-171-39/+25
| | | | Cleaned up string->enum conversion for section lookup.
* Removed MDOC___: moved MDOC_Ap to its index (comments not passed into mdoc ↵Kristaps Dzonsons2009-06-161-14/+13
| | | | parser).
* Deprecated mdoc_msg (not being used anywhere).Kristaps Dzonsons2009-06-151-1/+0
|
* Fixed license email address.Kristaps Dzonsons2009-06-101-1/+1
|
* Using proper license template (const).Kristaps Dzonsons2009-04-121-12/+10
|
* Manual .Dt fields CAPITALISED.Kristaps Dzonsons2009-04-121-0/+1
| | | | | | | | Indent set to 5 chars (nroff compat). Half-indent set to 3 chars (nroff compat). Default behaviour is loose-y (ignore macro/char/escape). Added -fstrict. Added unknown-character ignoring.
* General clean-ups.Kristaps Dzonsons2009-03-311-1/+1
|
* First addition of -man macro support.Kristaps Dzonsons2009-03-231-1/+1
| | | | Abstraction of mdoc.
* `Em' accepts empty tokens.Kristaps Dzonsons2009-03-211-2/+0
| | | | | Punctuation fully fixed (per-reserved-word). Sm enabled.
* Added %Q macro.Kristaps Dzonsons2009-03-211-1/+2
|
* Many more ASCII escapes added.Kristaps Dzonsons2009-03-191-2/+2
| | | | | | Stripped nroff punt from mdocterm.c. Fixed multiple-file handling for mdocterm.c. Cleared up mdoc.h API.
* Changed e-mail address to @openbsd.Kristaps Dzonsons2009-03-161-1/+2
| | | | Cleaned up manual-page documentation.
* Fixed mdoc_phrase escape handling.Kristaps Dzonsons2009-03-161-3/+3
| | | | | | | | | | | Added MDOC_IGNDELIM (Pf, soon Li, etc.). macro_constant_delimited ignargs -> argv.c parsing. Renamed macro functions to correspond to ontologies. `Fo' and `St' made callable (compat documented). strings.sh deprecated (directly using CPP). Abstracted ASCII translation into ascii.{c,in}. ASCII table uses a self-reordering chained hashtable. Removed old regressions.
* Added -nested (doesn't do anything).Kristaps Dzonsons2009-03-121-2/+4
| | | | | | Added .%C. .Cd is now callable. Added .Rv -std.