| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
Replace struct mdoc_node and struct man_node by a unified struct roff_node.
To be able to use the tok member for both mdoc(7) and man(7) without
defining all the macros in roff.h, sacrifice a tiny bit of type safety
and make tok an int rather than an enum.
Almost mechanical, no functional change.
Written on the Eurostar from Bruxelles to London on the way to p2k15.
|
|
|
|
|
|
| |
Replace enum mdoc_type and enum man_type by a unified enum roff_type.
Almost mechanical, no functional change.
Written on the ICE train from Frankfurt to Bruxelles on the way to p2k15.
|
| |
|
|
|
|
| |
confusing messages reported by Jan Stary <hans at stare dot cz>
|
|
|
|
|
|
| |
of .Do/.Dc, .Dq, .Lb, and .St untouched.
Reduces groff-mandoc differences in OpenBSD base by about 7%.
Reminded of the issue by naddy@.
|
|
|
|
| |
improved diagnostics, minus six lines of code
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
it, make_pending(), which was the most difficult function of the
whole mdoc(7) parser. After almost five years of maintaining this
hellhole, i just noticed the pointer isn't needed after all.
Blocks are always rewound in the reverse order they were opened;
that even holds for broken blocks. Consequently, it is sufficient
to just mark broken blogs with the flag MDOC_BROKEN and breaking
blocks with the flag MDOC_ENDED. When rewinding, instead of iterating
the pending pointers, just iterate from each broken block to its
parents, rewinding all that are MDOC_ENDED and stopping after
processing the first ancestor that it not MDOC_BROKEN. For ENDBODY
markers, use the mdoc_node.body pointer in place of the former
mdoc_node.pending.
This also fixes an assertion failure found by jsg@ with afl,
test case #467 (Bo Bl It Bd Bc It), where (surprise surprise)
the pending pointer got corrupted.
Improved functionality, minus one function, minus one struct field,
minus 50 lines of code.
|
|
|
|
| |
from Svyatoslav Mishyn <juef at openmailboxd dot org>, Crux Linux
|
|
|
|
| |
by more specific messages, improving diagnostics for .cc .tr .Bl -column
|
|
|
|
|
| |
replacing the last instances by more specific warnings.
Improved functionality, minus 50 lines of code.
|
|
|
|
| |
better handle .Fo with more than one argument
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Discard empty .Bk blocks.
Improve related diagnostics.
|
|
|
|
| |
in particular, get rid of check_count(..., CHECK_EQ, 0)
|
| |
|
|
|
|
| |
and the respective argument of check_count()
|
|
|
|
| |
as a bonus, get rid of another call to rew_sub().
|
|
|
|
|
| |
the first .It. Otherwise, move it out together with whatever
follows. Fixing an assertion failure found by jsg@ with afl.
|
|
|
|
|
|
|
|
| |
macro (for example .Xo) and never closed again, the item ends up
without a body block. This can even happen for list types that
usually don't have heads in the first place. So even in this
case, check for the existence of the body before accessing it.
NULL pointer access found by jsg@ with afl.
|
|
|
|
|
|
|
| |
* The first argument of .Pf is not parsed.
* Normal delimiter handling does not apply to the first argument of .Pf.
* Warn if nothing follows a prefix (inspired by groff_mdoc(7)).
* In that case, do not suppress spacing.
|
|
|
|
|
| |
long obsolete and were never written in mdoc(7) in the first place.
Removes 100 lines from source files.
|
|
|
|
|
|
| |
is a job for makewhatis(8)/mandoc.db(5), not for the parser.
Removes 150 lines from source files and 4k (1%) from the binary.
Bloat found by deraadt@.
|
| |
|
|
|
|
| |
No functional change, minus 90 lines of code.
|
|
|
|
|
| |
Since this was the last remaining FATAL error in this area,
this change will allow major simplifications in the mdoc(7) parser.
|
|
|
|
|
| |
and not trigger an assertion when there is more than one argument;
the latter found by jsg@ with afl.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* .No selects the default font; relevant e.g. in .Bf blocks
* no need to force empty .Li elements
* closing delimiters as leading macro arguments do not suppress space
* opening delimiters at the end of a macro line do not suppress space
* correctly handle delimiter spacing in -Tman
As a side effect, these fixes let mandoc warn about empty .No macros
as requested by bentley@.
|
|
|
|
|
|
|
|
|
| |
1. Support specifying the .Bd and .Bl -offset as a macro default width;
while here, simplify the code handling the same for .Bl -width.
2. Correct handling of .Bl -offset arguments: unlike .Bd -offset, the
arguments "left", "indent", and "indent-two" have no special meaning.
3. Fix the scaling of string length -offset and -width arguments in -Thtml.
Triggered by an incomplete documentation patch from bentley@.
|
|
|
|
|
| |
check sorting of .Xr's case-insensitively;
no idea why this was different here
|
|
|
|
| |
getting rid of a false positive noticed by bentley@.
|
| |
|
|
|
|
|
| |
particularly useful when converting from other languages to mdoc(7);
feature suggested by bentley@
|
| |
|
|
|
|
| |
inspired by mdoclint(1)
|
| |
|
| |
|
|
|
|
|
| |
no -type, -width, -offset or -compact arguments whatsoever;
this got broken in rev. 1.238.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
in particular relaxing the distinction between prologue and body
and further improving messages.
* The last .Dd wins and the last .Os wins, even in the body.
* The last .Dt before the first body macro wins.
* Missing title in .Dt defaults to UNTITLED. Warn about it.
* Missing section in .Dt does not default to 1. But warn about it.
* Do not warn multiple times about the same mdoc(7) prologue macro.
* Warn about missing .Os.
* Incomplete .TH defaults to empty strings. Warn about it.
|
|
|
|
|
|
| |
Saves 36 static arrays and 10 lines of code
at the expense of only five new trivial static functions.
No functional change.
|
|
|
|
|
| |
Saves 12 static arrays and 19 lines of code.
No functional change.
|
| |
|
| |
|
|
|
|
| |
and report the macro name and argument.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
right after the -column argument and some at the very end of the
argument list, after some other arguments like -compact, concatenate
the column lists.
This gets rid of one of the last useless FATAL errors
and actually shortens the code by a few lines.
This fixes an issue introduced more than five years ago, at first
causing an assert() since mdoc_action.c rev. 1.14 (June 17, 2009),
then later a FATAL error since mdoc_validate rev. 1.130 (Nov. 30, 2010),
and marked as "TODO" ever since.
|
|
|
|
|
|
| |
The last remaining instance was .It in .Bl -column with more than one
excessive .Ta. However, simply downgrading from FATAL to ERROR, it just
works fine, almost the same way as in groff, without any other changes.
|