diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2015-02-12 12:20:48 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2015-02-12 12:20:48 +0000 |
commit | 47e09eae357b2e21b53af1df064746c9bc48e18a (patch) | |
tree | a68fabbfdea6ae21842905be04b9755afeab5f30 /regress/usr.bin/mandoc/mdoc/Bl/broken.out_lint | |
parent | 662aad5bb9f48af2911dd44583d58c96e75c9e0d (diff) |
Delete the mdoc_node.pending pointer and the function calculating
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.
Diffstat (limited to 'regress/usr.bin/mandoc/mdoc/Bl/broken.out_lint')
-rw-r--r-- | regress/usr.bin/mandoc/mdoc/Bl/broken.out_lint | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/regress/usr.bin/mandoc/mdoc/Bl/broken.out_lint b/regress/usr.bin/mandoc/mdoc/Bl/broken.out_lint index b57a007983d..477b7fbc83a 100644 --- a/regress/usr.bin/mandoc/mdoc/Bl/broken.out_lint +++ b/regress/usr.bin/mandoc/mdoc/Bl/broken.out_lint @@ -1 +1,3 @@ mandoc: broken.in:13:2: WARNING: blocks badly nested: Bo breaks Bl +mandoc: broken.in:23:2: WARNING: blocks badly nested: Bo breaks Bd +mandoc: broken.in:25:2: ERROR: inserting missing end of block: It breaks Bd |