| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
same chunk of argument parsing code out of five of the eight callback
functions. The other three have too much special handling to
participate.
As a bonus, let lookup() and mdoc_args() deal with line macros and
retire the lookup_raw() helper and the mdoc_zargs() internal interface
function.
No functional change, minus 40 lines of code.
|
|
|
|
|
|
| |
it was the same in all four cases. As a bonus, get rid
of one enum type that was used for internal communication.
No functional change, minus 40 lines of code.
|
|
|
|
| |
No functional change, minus 130 lines of code.
|
|
|
|
|
|
| |
Include <sys/types.h> where needed, it does not belong in config.h.
Remove <stdio.h> from config.h; if it is missing somewhere, it should
be added, but i cannot find a *.c file where it is missing.
|
|
|
|
|
| |
* Mention invalid escape sequences and string names, and fallbacks.
* Hierarchical naming.
|
|
|
|
|
| |
since this is hardly more complicated than explicitly ignoring them
as we did in the past. Of course, do not use them!
|
|
|
|
|
|
|
| |
* Change eight reallocs to reallocarray to be safe from overflows.
* Change one malloc to reallocarray to be safe from overflows.
* Change one calloc to reallocarray, no zeroing needed.
* Change the order of arguments of three callocs (aesthetical).
|
|
|
|
|
| |
remove trailing whitespace and blanks before tabs, improve some indenting;
no functional change
|
|
|
|
|
| |
Found by naddy@ in the textproc/enchant(1) port.
Of course, do not use this in new manuals.
|
|
|
|
|
|
|
| |
functions used for multiple languages (mdoc, man, roff), for example
mandoc_escape(), mandoc_getarg(), mandoc_eos(), and generic auxiliary
functions. Split the auxiliaries out into their own file and header.
While here, do some #include cleanup.
|
|
|
|
| |
suggested by Thomas Klausner <wiz @ NetBSD dot org>.
|
|
|
|
| |
Patch from Franco Fichtner <franco at lastsummer dot de>.
|
|
|
|
|
|
|
|
|
| |
For a long time, we handle this in roff(7) and man(7) macros.
Now add correct handling for the mdoc(7) case, too.
Closely based on a patch by Tsugutomo dot ENAMI at jp dot sony dot com,
see http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=48438
received via Thomas Klausner (wiz@), slightly tweaked by me.
|
|
|
|
|
|
|
|
|
| |
reported by Nicolas Joly <njoly at pasteur dot fr>:
- add EOS spacing after trailing punctuation after .Cd, .Fc, and .Lb
- suppress spacing before trailing punctuation after .Fd
Add the remaining issues from the same report to the TODO file.
|
|
|
|
|
|
|
|
| |
Settle for "struct man *man", "struct mdoc *mdoc", "struct meta *meta"
and avoid the confusing "*m" which was sometimes this, sometimes that.
No functional change.
ok kristaps@ some time ago
|
|
|
|
|
|
|
| |
This fixes the end of sentence spacing in OpenBSD open(2)
and in about 150 pages in the NetBSD base system.
Reported by Nicolas Joly <njoly a pasteur point fr>, merci!
|
|
|
|
|
| |
even if it starts with a dash.
ok kristaps@
|
|
|
|
| |
This makes mandoc work much, much nicer with Mac OSX manpages.
|
|
|
|
| |
found while syncing to OpenBSD
|
|
|
|
|
| |
mysteriously disappeared in 1.14. No idea why. While here, remove an
unnecessary header and order the function prototypes.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
auto-opened `It' (i.e., a column list with a free-text first line) with
leading spaces in the line triggering assertion when searching for
arguments.
This led to a fix giving a nice performance speed-ups (a few percent,
with some quick trials): the search for flags immediately exits if the
macro has no flags, instead of having to first parse the leading word
then look it up. I also cleaned up the argv parsing stuff a little bit
and added more documentation.
This comes from a TODO by joerg@.
|
|
|
|
| |
values instead of ints.
|
|
|
|
|
|
|
|
| |
variable from mandoc_getarg() so that it prints the warning every time.
Then, remove the warning from args_checkpunct(). This way, warnings
are being posted at the correct time. This makes the flag argument to
mdoc_zargs() superfluous, so make it be zero when it's invoked. Finally,
move the args() flags into mdoc_argv.c and make them enums.
|
|
|
|
| |
arguments in -mdoc documents.
|
| |
|
| |
|
|
|
|
|
| |
Don't have them do that (includes in header files = faugh), and have
individual files directly include these files.
|
| |
|
|
|
|
|
|
|
|
|
| |
error where (1) -man pages were punctuating delimiters (e.g., `.B a ;')
and where (2) standalone punctuation in -mdoc or -man (e.g., ";" on its
own line) would also be punctuated. This introduces a small amount of
complexity of mdoc_{html,term}.c must manage their own spacing with
running print_word() or print_text(). The check for delimiting now
happens in mdoc_macro.c's dword().
|
| |
|
|
|
|
|
| |
static arrays const, properly abort() for bogus switch cases, and be
obsessive about spacing and (void)-casting.
|
| |
|
|
|
|
|
|
| |
removal of manual delimiter checks in html.c and term.c. Finally, add
the escaped period as a closing delimiter, removing a TODO to this
effect.
|
|
|
|
| |
which is wrong. Then remove mdoc_iscdelim() alltogether.
|
|
|
|
|
|
| |
later be modified to remove the need for iscdelim(), which will be used
to unify delimiter checks, which will then allow for the simple removal
of a TODO regarding escaped periods.
|
|
|
|
|
|
| |
over an array of possible argument types, hooking in to mdoc_argnames[].
This knocks off bytes for the duplicated strings and cleans up code
readability.
|
|
|
|
|
|
|
|
| |
favour of a simpler shim for normalised data in the node allocation and
free routines. This removes the need to bump and copy references within
validator handlers, removes a pointer redirect, and also kills the
refcount structure itself. Data is assumed to "live" either in a
MDOC_BLOCK or MDOC_ELEM and is copied accordingly.
|
|
|
|
|
|
|
| |
simplifies clean-up and allows for more types without extra hassle.
Also made in-line literal types in -T[x]html use CODE instead of SPAN to
match how literal blocks use PRE.
|
|
|
|
| |
Same fix as the previous one.
|
|
|
|
| |
Marc Espie.
|
| |
|
| |
|
|
|
|
| |
ok kristaps@
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
cached values. You can probably guess where this is going.
|
|
|
|
| |
processing.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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'.
|
| |
|