aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc.c
Commit message (Collapse)AuthorAgeFilesLines
...
* In the mdoc(7) parser, inspect roff registers early such that all partsIngo Schwarze2010-07-011-15/+19
| | | | | | | | | | | | of the parser can use the resulting cues. In particular, this allows to use .nr nS to force SYNOPSIS-style .Nm indentation outside the SYNOPSIS as needed by ifconfig(8). To actually make this useable, .Pp must rewind .Nm, or the rest of the section would end up indented. Implement a quick hack for now, a generic solution can be designed later. ok kristaps@ and tested by sobrado@
* Support for badly nested blocks, written around the time ofIngo Schwarze2010-06-291-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | 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@
* Allow registers to be unset. Implement and document the `.nr nS val'.Kristaps Dzonsons2010-06-271-1/+10
|
* Following clue-stick applied by schwarze@, back out const-ness of regsetKristaps Dzonsons2010-06-271-3/+12
| | | | | | | | | 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-26/+18
| | | | | | | | | 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.
* Mechanical diff allowing the const struct regset to propogate throughKristaps Dzonsons2010-06-261-18/+26
| | | | libman and libmdoc.
* Churn-ish check-in getting mdoc_parseln() and man_parseln() to accept aKristaps Dzonsons2010-06-261-2/+4
| | | | const struct regset pointer. No functionality.
* `Bl' is now using a struct instead of a single enum mdoc_list for itsKristaps Dzonsons2010-06-121-5/+5
| | | | cached values. You can probably guess where this is going.
* Fixed my breaking of Ingo's eoln-whitespace detection code, where aKristaps Dzonsons2010-05-311-1/+2
| | | | | hyphen wasn't resetting the fact of being whitespace. Noted by Jason McIntyre.
* Macro lines now infer an `It' if they immediately follow a `Bl -column'Kristaps Dzonsons2010-05-311-11/+56
| | | | | | | or a closed-out `It' block within a `Bl -column' (which only happens when a macro or free-form text is encountered prior to an `It'). Added some regression tests for this behaviour.
* Strengthened constraint for passing into `It'.Kristaps Dzonsons2010-05-311-2/+3
| | | | Added regression test for constrained condition.
* Add ability to interpret initial free-form lines as part of a `BlKristaps Dzonsons2010-05-311-2/+26
| | | | | | | | -column' up until the first `It'. This is UGLY and should have all sorts of warnings, and will. On the one hand, it fits with groff's notion of tabs and tab-spaces. On the other hand, it's not really "free-form" text any more. Note that this does not yet accomodate for macros coming on these lines.
* Remove enum mdocargerr from phrase() (unused).Kristaps Dzonsons2010-05-311-2/+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-4/+4
| | | | | | | | 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.
* Fixed `Lb' to be in_line (reported by Ulrich Spoerlein).Kristaps Dzonsons2010-05-261-1/+3
| | | | | | | | | 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).
* Modified version of Ingo Schwarze's patch for hyphen-breaking.Kristaps Dzonsons2010-05-251-1/+5
| | | | | | | Breakable hyphens are cued in the back-ends (with ASCII_HYPH) and acted upon in term.c or ignored in html.c. Also cleaned up XML decl printing (no need for extra vars).
* rewrite the main mdoc text parser, mdoc_ptext(),Ingo Schwarze2010-05-241-39/+52
| | | | | | | | making it easier to understand and fixing various bugs: * correctly strip whitespace from the end of text lines * issue consistent warnings regarding trailing spaces and tabs * escaped backslashes no longer escape the following character ok kristaps@
* Enable the unified error/warning enumeration in mandoc.h that'sKristaps Dzonsons2010-05-171-112/+26
| | | | | | | | | | | 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-29/+31
| | | | | | | | | 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).
* Fix allowing silly '\'' control character.Kristaps Dzonsons2010-05-161-2/+2
|
* LIBRARY can also occur in section 9.Kristaps Dzonsons2010-05-151-2/+4
| | | | | | 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.
* More EOS: append_delims() fitted with EOS detection, so ANY macro with ↵Kristaps Dzonsons2010-05-151-1/+3
| | | | | | appended delimiters will properly EOS. Fixed mandoc_eos() to accept sentence punctuation followed by close-delim buffers.
* Backed out check for `Ex' manual sec (ok schwarze@, joerg@), in turn backing ↵Kristaps Dzonsons2010-05-141-2/+1
| | | | out check_msec() and deps.
* Fixed bug in -Thtml -mdoc where `Lb' would line-break in LIBRARY section.Kristaps Dzonsons2010-05-131-5/+11
| | | | | 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.
* Put the eos-checker into libmandoc.h.Kristaps Dzonsons2010-05-121-14/+2
| | | | Added bits in mdoc.7 and man.7 about EOS spacing.
* Tiny EOS patch. Back-end cues front-end through flag. Front-end cues ↵Kristaps Dzonsons2010-05-121-2/+28
| | | | output engine with flag.
* Fix asserts on stripping end-of-line whitespace.Kristaps Dzonsons2010-05-081-4/+2
|
* Strip trailing, unescaped whitespace from free-form, non-literal lines (like ↵Kristaps Dzonsons2010-05-081-4/+18
| | | | groff).
* Lint fixes (type-safety for enums via -cefuh).Kristaps Dzonsons2010-05-081-10/+12
|
* De-chunking of text removed from parsers. This is a significant change (and ↵Kristaps Dzonsons2010-05-071-66/+29
| | | | | | I don't really like it), but it's what groff does. Distinction of ARGS_PHRASE and ARGS_PPHRASE in backend (not yet used).
* Sync'd mdoc.c's function names with man.c.Kristaps Dzonsons2010-04-081-8/+14
| | | | Prompted by Ingo and Claus Assman, added warn/ignore for text lines beginning with `\."'.
* Properly checked in Ingo Schwarze' prologue/body-breaking patch, which I'd ↵Kristaps Dzonsons2010-04-081-13/+11
| | | | munged.
* Migrating mdoc_node_free() and mdoc_node_freelist() to use ↵Kristaps Dzonsons2010-04-061-10/+48
| | | | mdoc_node_delete(), which has a more intuitive interface and mirrors libman.
* Commited relaxation of title-less document error-out noted by Christian ↵Kristaps Dzonsons2010-04-051-3/+18
| | | | Weisgerber and patched by Ingo Schwarze.
* Merging patch by Ingo Schwarze.Kristaps Dzonsons2010-04-031-3/+13
|
* Re-adjusting UGLY tags.Kristaps Dzonsons2010-03-311-1/+2
| | | | | Fixed removed assignment of type. Removed superfluous checks of mdoc_argflags (from days when comments were a macro tag).
* Macro types enum-ated (enum mdoct) (for easier debugging in gdb of "tok" ↵Kristaps Dzonsons2010-03-311-12/+12
| | | | | | | 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.
* Check for white-space at the end of free-form text. Lack of check spotted ↵Kristaps Dzonsons2010-01-071-1/+16
| | | | by Jason McIntyre.
* Check for white-space at end of stand-alone macro line.Kristaps Dzonsons2010-01-071-7/+15
|
* Big check-in of compatibility layer. This should work on most major ↵Kristaps Dzonsons2010-01-011-12/+11
| | | | architectures. Thanks to Joerg Sonnenberger.
* libmdoc and libman now using non-recoverable allocations (simpler code).Kristaps Dzonsons2009-10-301-45/+15
|
* bzero() -> memset() (noted by Joerg Sonnenberger).Kristaps Dzonsons2009-10-271-2/+2
|
* -man also prints unknown macro (noted by Joerg Sonnenberger).Kristaps Dzonsons2009-10-261-2/+1
|
* Added `%U' to -mdoc (doesn't render in a nice way yet).Kristaps Dzonsons2009-10-241-2/+4
|
* Added warning about specifying list arguments before type (suggested by ↵Kristaps Dzonsons2009-10-151-1/+2
| | | | Joerg Sonnenberg).
* Added support for `Bd -centered', which appears in newer groffs (not yet ↵Kristaps Dzonsons2009-10-151-2/+2
| | | | implemented in centre-capable front-ends, i.e., -Thtml).
* Added EBADCHILD error (bad child of parent context).Kristaps Dzonsons2009-09-241-2/+3
| | | | | `Rs' post-checks that all children are proper bibliographic elements. `Rs' correctly re-orders its children as per groff's output (including %C).
* FreeBSD compile fixes (uqs@spoerlein.net).Kristaps Dzonsons2009-09-231-1/+3
|
* Lookup hashes are now static tables, ordered first-level by second ↵Kristaps Dzonsons2009-09-161-8/+5
| | | | character, then randomly along a chain. Improves performance by a small fraction and considerably cleans up hash sources.
* Added check for graphable characters in initial-line parse for libman and ↵Kristaps Dzonsons2009-08-221-1/+7
| | | | libmdoc (joerg@netbsd.org).