CVS log for mandoc/mdoc_macro.c

[BACK] Up to [cvsweb.bsd.lv] / mandoc

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.234 / (download) - annotate - [select for diffs], Sun Jan 19 18:02:00 2020 UTC (6 months, 2 weeks ago) by schwarze
Branch: MAIN
CVS Tags: HEAD
Changes since 1.233: +3 -2 lines
Diff to previous 1.233 (colored)

Introduce a new mdoc(7) macro .Tg ("tag") to explicitly mark a place
as defining a term.  Please only use it when automatic tagging does
not work.  Manual page authors will not be required to add the new
macro; using it remains optional.  HTML output is still rudimentary
in this version and will be polished later.

Thanks to kn@ for reminding me that i have been considering since
BSDCan 2014 whether something like this might be useful.  Given
that possibilities of making automatic tagging better are running
out and there are still several situations where automatic tagging
cannot do the job, i think the time is now ripe.

Feedback and no objection from millert@; OK espie@ inoguchi@ kn@.

Revision 1.233 / (download) - annotate - [select for diffs], Sun Jan 19 16:44:50 2020 UTC (6 months, 2 weeks ago) by schwarze
Branch: MAIN
Changes since 1.232: +2 -2 lines
Diff to previous 1.232 (colored)

Align to the new, sane behaviour of the groff_mdoc(7) .Dd macro:
without an argument, use the empty string, and always concatenate
all arguments, no matter their number.
This allows reducing the number of arguments of mandoc_normdate()
and some other simplifications, at the same time polishing some
error messages by adding the name of the macro in question.

Revision 1.232 / (download) - annotate - [select for diffs], Mon Jan 7 07:26:29 2019 UTC (18 months, 4 weeks ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_5
Changes since 1.231: +14 -3 lines
Diff to previous 1.231 (colored)

Represent mdoc(7) .Pp (and .sp, and some SYNOPSIS and .Rs features)
by the <p> HTML element and use the html_fillmode() mechanism
for .Bd -unfilled, just like it was done for man(7) earlier, finally
getting rid both of the horrible <div class="Pp"></div> hack and
of the worst HTML syntax violations caused by nested displays.

Care is needed because in some situations, paragraphs have to remain
open across several subsequent macros, whereas in other situations,
they must get closed together with a block containing them.

Some implementation details include:
* Always close paragraphs before emitting HTML flow content.
* Let html_close_paragraph() also close <pre> for extra safety.
* Drop the old, now unused function print_paragraph().
* Minor adjustments in the top-level man(7) node formatter for symmetry.
* Bugfix: .Ss heads suspend no-fill mode, even though .Ss doesn't end it.
* Bugfix: give up on .Op semantic markup for now, see the comment.

Revision 1.231 / (download) - annotate - [select for diffs], Tue Jan 1 07:42:04 2019 UTC (19 months ago) by schwarze
Branch: MAIN
Changes since 1.230: +46 -4 lines
Diff to previous 1.230 (colored)

Correctly set the ROFF_NOFILL parser flag for .Bd .Ed .Sh, such
that children and later siblings get correct NODE_NOFILL assignments.
This doesn't change rendering yet but prepares for future rendering
improvements.

Revision 1.230 / (download) - annotate - [select for diffs], Mon Dec 31 04:55:46 2018 UTC (19 months ago) by schwarze
Branch: MAIN
Changes since 1.229: +1 -2 lines
Diff to previous 1.229 (colored)

Cleanup, minus 15 LOC, no functional change:
Simplify the way the man(7) and mdoc(7) validators are called.
Reset the parser state with a common function before calling them.
There is no need to again reset the parser state afterwards,
the parsers are no longer used after validation.
This allows getting rid of man_node_validate() and mdoc_node_validate()
as separate functions.

Revision 1.229 / (download) - annotate - [select for diffs], Sun Dec 30 00:49:55 2018 UTC (19 months, 1 week ago) by schwarze
Branch: MAIN
Changes since 1.228: +2 -2 lines
Diff to previous 1.228 (colored)

Cleanup, no functional change:

The struct roff_man used to be a bad mixture of internal parser
state and public parsing results.  Move the public results to the
parsing result struct roff_meta, which is already public.  Move the
rest of struct roff_man to the parser-internal header roff_int.h.

Since the validators need access to the parser state, call them
from the top level parser during mparse_result() rather than from
the main programs, also reducing code duplication.

This keeps parser internal state out of thee main programs (five
in mandoc portable) and out of eight formatters.

Revision 1.228 / (download) - annotate - [select for diffs], Fri Dec 21 17:15:19 2018 UTC (19 months, 2 weeks ago) by schwarze
Branch: MAIN
Changes since 1.227: +66 -23 lines
Diff to previous 1.227 (colored)

Rename mandoc_getarg() to roff_getarg() and pass it the roff parser
struct as an argument such that after copy-in, it can call roff_expand()
once again, which used to be called roff_res() before this.  This
fixes a subtle low-level roff(7) parsing bug reported by Fabio
Scotoni <fabio at esse dot ch> in the 4.4BSD-Lite2 mdoc.samples(7)
manual page, because that page used an escaped escape sequence in
a macro argument.

To expand escaped escape sequences in quoted mdoc(7) arguments, too,
stop bypassing the call to roff_getarg() in mdoc_argv.c, function args()
for this case.  This does not solve the case of escaped escape sequences
in quoted .Bl -column phrases yet.

Because roff_expand() can make the string longer, roff_getarg() can no
longer operate in-place but needs to malloc(3) the returned string.
In the high-level parsers, free(3) that string after processing it.

Revision 1.227 / (download) - annotate - [select for diffs], Fri Dec 14 05:18:02 2018 UTC (19 months, 3 weeks ago) by schwarze
Branch: MAIN
Changes since 1.226: +33 -42 lines
Diff to previous 1.226 (colored)

Almost mechanical diff to remove the "struct mparse *" argument
from mandoc_msg(), where it is no longer used.
While here, rename mandoc_vmsg() to mandoc_msg() and retire the
old version:  There is really no point in having another function
merely to save "%s" in a few places.
Minus 140 lines of code.

Revision 1.226 / (download) - annotate - [select for diffs], Tue Dec 4 02:53:51 2018 UTC (20 months ago) by schwarze
Branch: MAIN
Changes since 1.225: +2 -2 lines
Diff to previous 1.225 (colored)

Clean up the validation of .Pp, .PP, .sp, and .br.  Make sure all
combinations are handled, and are handled in a systematic manner.
This resolves some erratic duplicate handling, handles a number of
missing cases, and improves diagnostics in various respects.

Move validation of .br and .sp to the roff validation module
rather than doing that twice in the mdoc and man validation modules.
Move the node relinking function to the roff library where it belongs.

In validation functions, only look at the node itself, at previous
nodes, and at descendants, not at following nodes or ancestors,
such that only nodes are inspected which are already validated.

Revision 1.225 / (download) - annotate - [select for diffs], Fri Aug 17 20:33:37 2018 UTC (23 months, 2 weeks ago) by schwarze
Branch: MAIN
Changes since 1.224: +30 -22 lines
Diff to previous 1.224 (colored)

Remove more pointer arithmetic passing via regions outside the array
that is undefined according to the C standard.  Robert Elz <kre at
munnari dot oz dot au> pointed out i wasn't quite done yet.

Revision 1.224 / (download) - annotate - [select for diffs], Tue May 30 16:22:03 2017 UTC (3 years, 2 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_4, VERSION_1_14_3, VERSION_1_14_2
Changes since 1.223: +17 -23 lines
Diff to previous 1.223 (colored)

Macro argument quoting does not prevent recognition of punctuation
and of called macros.

This bug affects almost all macros, and fixing it simplifies the
code.  It is amazing that the bogus ARGS_QWORD feature got implemented
in the first place, and then carrier along for more than eight years
without anybody ever noticing that it was pointless.

Reported by Leah Neukirchen <leah at vuxu dot org>, found on Void Linux.

Revision 1.223 / (download) - annotate - [select for diffs], Fri May 5 15:17:32 2017 UTC (3 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.222: +3 -5 lines
Diff to previous 1.222 (colored)

Move .sp to the roff modules.  Enough infrastructure is in place
now that this actually saves code: -70 LOC.

Revision 1.222 / (download) - annotate - [select for diffs], Fri May 5 13:17:55 2017 UTC (3 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.221: +2 -3 lines
Diff to previous 1.221 (colored)

move .ll to the roff modules

Revision 1.221 / (download) - annotate - [select for diffs], Thu May 4 17:48:29 2017 UTC (3 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.220: +6 -7 lines
Diff to previous 1.220 (colored)

Parser reorg:
Generate the first node on the roff level: .br
Fix some column numbers in diagnostic messages while here.

Revision 1.220 / (download) - annotate - [select for diffs], Sat Apr 29 12:45:42 2017 UTC (3 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.219: +2 -2 lines
Diff to previous 1.219 (colored)

Parser unification: use nice ohashes for all three request and macro tables;
no functional change, minus two source files, minus 200 lines of code.

Revision 1.219 / (download) - annotate - [select for diffs], Mon Apr 24 23:06:18 2017 UTC (3 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.218: +42 -43 lines
Diff to previous 1.218 (colored)

Continue parser unification:
* Make enum rofft an internal interface as enum roff_tok in "roff.h".
* Represent mdoc and man macros in enum roff_tok.
* Make TOKEN_NONE a proper enum value and use it throughout.
* Put the prologue macros first in the macro tables.
* Unify mdoc_macroname[] and man_macroname[] into roff_name[].

Revision 1.218 / (download) - annotate - [select for diffs], Mon Apr 17 12:53:29 2017 UTC (3 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.217: +6 -2 lines
Diff to previous 1.217 (colored)

Fix handling of trailing punctuation in .Lk.
This macro is unusual in so far as trailing punction needs to remain
inside the scope because it must be inside, not after the display
of long URIs in terminal output mode.
Improves formatting of fw_update(1), help(1), less(1), sendbug(1),
acx(4), inet6(4), ipsec(4), oce(4), isakmpd.conf(5), afterboot(8),
release(8), traceroute(8).

Revision 1.217 / (download) - annotate - [select for diffs], Thu Feb 16 09:47:31 2017 UTC (3 years, 5 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_1, VERSION_1_13
Changes since 1.216: +6 -3 lines
Diff to previous 1.216 (colored)

Fix block scoping error if an explicit block is broken by two
implicit blocks (.Aq Bq Po .Pc) that left the outer breaker open
and could in exceptional cases, like between .Bl and .It, cause
tree corruption leading to NULL dereference.
Found by tb@ with afl(1).

While here, do not mark intermediate ENDBODY markers as broken.

Revision 1.216 / (download) - annotate - [select for diffs], Thu Feb 16 03:00:23 2017 UTC (3 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.215: +4 -4 lines
Diff to previous 1.215 (colored)

Remove the ENDBODY_NOSPACE flag, simplifying the code.

Comparing to groff output, it appears that all cases where it was used
and made a difference actually require the opposite, ENDBODY_SPACE.

I have no idea why i added it back in 2010; maybe to compensate for
some other bug that has long been fixed.

Revision 1.215 / (download) - annotate - [select for diffs], Sat Feb 11 15:47:16 2017 UTC (3 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.214: +5 -4 lines
Diff to previous 1.214 (colored)

Never look for broken blocks inside blocks that are already closed.
Fixes the last the of tree corruptions sometimes causing NULL dereference
reported by tb@; this one triggered in cases like: .Bl -column .It Pq Ta

Revision 1.214 / (download) - annotate - [select for diffs], Sat Feb 11 14:11:17 2017 UTC (3 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.213: +9 -3 lines
Diff to previous 1.213 (colored)

Do not prematurely close .Nd containing a broken child.
Fixes tree corruption leading to NULL dereference
in insane cases like .Oo Oo .Nd .Pq Oc .Oc Oc
found by tb@ with afl(1).

Revision 1.213 / (download) - annotate - [select for diffs], Sat Feb 11 13:24:12 2017 UTC (3 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.212: +17 -10 lines
Diff to previous 1.212 (colored)

Do not prematurely mark intermediate blocks as broken while scanning
backwards.  Only do so when a block is found that is actually broken.
Logic error found while investigating crashes reported by tb@.

Revision 1.212 / (download) - annotate - [select for diffs], Fri Feb 10 22:19:18 2017 UTC (3 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.211: +8 -7 lines
Diff to previous 1.211 (colored)

For child macros of block-end macros, only scan backwards for pending
breakers unless the parent of the block is already closed.  While
the scanning is needed in cases like ".Ac Bo" for broken Ao, it is
useless and crashy in cases like ".Ac Bc" for non-broken Ao.

This fixes a NULL pointer dereference that tb@ found with afl(1).

Revision 1.211 / (download) - annotate - [select for diffs], Fri Feb 10 16:20:34 2017 UTC (3 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.210: +15 -7 lines
Diff to previous 1.210 (colored)

In the SYNOPSIS, .Nm blocks can get broken if one of their children
gets broken.  In that case, mark them as BROKEN and ENDED and make
sure they get closed out together with the child.

Fixes tree corruption leeding to a NULL dereference found by tb@
with afl(1) in: .Sh SYNOPSIS .Bl .Oo .Nm .Bk .Oc .It (where .Bk is
the child and .Oo is the breaker).
A simpler form of the same corruption (without crash) is visible in:
.Sh SYNOPSIS .Ao .Nm .Bo .Ac .Bc text
where the text ended up inside the .Nm (child .Bo, breaker .Ao).

Revision 1.210 / (download) - annotate - [select for diffs], Tue Jan 10 13:47:00 2017 UTC (3 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.209: +31 -31 lines
Diff to previous 1.209 (colored)

unify names of AST node flags; no change of cpp output

Revision 1.209 / (download) - annotate - [select for diffs], Sat Aug 20 17:59:34 2016 UTC (3 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.208: +23 -14 lines
Diff to previous 1.208 (colored)

When a mismatching end macro occurs while at least two nested blocks
are open, all except the innermost open block got a bogus MDOC_ENDED
marker, in some situations triggering segfaults down the road
which tb@ found with afl(1).
Fix the logic error by figuring out up front whether an end macro
has a matching body, and if it hasn't, don't mark any blocks as broken.

Revision 1.208 / (download) - annotate - [select for diffs], Sat Aug 20 15:58:21 2016 UTC (3 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.207: +2 -2 lines
Diff to previous 1.207 (colored)

When scanning upwards for a column list to put a .Ta macro in,
ignore body end markers of lists breaking other blocks.
Fixing a logical error that caused a NULL deref found by tb@ with afl(1).

Revision 1.207 / (download) - annotate - [select for diffs], Thu Aug 11 13:30:25 2016 UTC (3 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.206: +2 -2 lines
Diff to previous 1.206 (colored)

Even after switching from a pending head to the body, we have to
continue scanning upwards, because the enclosing block might already
be pending as well, e.g. .Bl .Bl .It Bo .El .It.
Tree corruption leading to a later NULL deref found by tb@ with afl(1).

Revision 1.206 / (download) - annotate - [select for diffs], Tue Oct 20 02:01:32 2015 UTC (4 years, 9 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_13_4
Changes since 1.205: +7 -13 lines
Diff to previous 1.205 (colored)

In order to become able to generate syntax tree nodes on the roff(7)
level, validation must be separated from parsing and rewinding.
This first big step moves calling of the mdoc(7) post_*() functions
out of the parser loop into their own mdoc_validate() pass, while
using a new mdoc_state() module to make syntax tree state handling
available to both the parser loop and the validation pass.

Revision 1.205 / (download) - annotate - [select for diffs], Sat Oct 17 00:21:07 2015 UTC (4 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.204: +29 -23 lines
Diff to previous 1.204 (colored)

Very tricky diff to fix macro interpretation and spacing around tabs
in .Bl -column; it took me more than a day to get this right.
Triggered by a loosely related bug report from tim@.

The lesson for you is:  Use .Ta macros in .Bl -column, avoid tabs,
or you are in for surprises:  The last word before a tab is not
interpreted as a macro (unless there is a blank in between), the
first word after a tab isn't either (unless there is a blank in
between), and a blank after a tab causes a leading blank in the
respective output cell.  Yes, "blank", "tab", "blank tab" and "tab
blank" all have different semantics; if you write code relying on
that, good luck maintaining it afterwards...

Revision 1.204 / (download) - annotate - [select for diffs], Thu Oct 15 22:27:24 2015 UTC (4 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.203: +6 -1 lines
Diff to previous 1.203 (colored)

When blk_full() handles an .It line in .Bl -column and indirectly
calls phrase_ta() to handle a .Ta child macro, advance the body
pointer accordingly, such that a subsequent tab character rewinds
the right body block and doesn't fail an assertion.  That happened
when there was nothing between the .Ta and the tab character.
Bug reported by tim@ some time ago.

Revision 1.203 / (download) - annotate - [select for diffs], Mon Oct 12 00:08:15 2015 UTC (4 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.202: +1 -11 lines
Diff to previous 1.202 (colored)

To make the code more readable, delete 283 /* FALLTHROUGH */ comments
that were right between two adjacent case statement.  Keep only
those 24 where the first case actually executes some code before
falling through to the next case.

Revision 1.202 / (download) - annotate - [select for diffs], Tue Oct 6 18:32:19 2015 UTC (4 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.201: +25 -25 lines
Diff to previous 1.201 (colored)

modernize style: "return" is not a function

Revision 1.201 / (download) - annotate - [select for diffs], Sat Sep 26 00:54:04 2015 UTC (4 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.200: +1 -2 lines
Diff to previous 1.200 (colored)

/* NOTREACHED */ after abort() is silly, delete it

Revision 1.200 / (download) - annotate - [select for diffs], Fri May 1 16:58:33 2015 UTC (5 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.199: +2 -2 lines
Diff to previous 1.199 (colored)

mdoc_valid_post() may indirectly call roff_node_unlink() which may
set ROFF_NEXT_CHILD, which is desirable for the final call to
mdoc_valid_post() - in case the target itself gets deleted, the
parse point may need this adjustment - but not for the intermediate
calls - if intermediate nodes get deleted, that mustn't clobber the
parse point.  So move setting ROFF_NEXT_SIBLING to the proper place
in rew_last().

This fixes the assertion failure in jsg@'s afl test case 108/Apr27.

Revision 1.199 / (download) - annotate - [select for diffs], Fri May 1 16:02:47 2015 UTC (5 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.198: +2 -4 lines
Diff to previous 1.198 (colored)

Setting the "last" member of struct roff_node was done at an extremely
weird place.  Move it to the obviously correct place.
Surprisingly, this didn't cause any misformatting in the test suite
or in any base system manuals, but i cannot believe the code was
really correct for all conceivable input, and it would be very hard
to verify.  At the very least, it cannot have worked for man(7).

Revision 1.198 / (download) - annotate - [select for diffs], Fri May 1 15:27:54 2015 UTC (5 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.197: +2 -2 lines
Diff to previous 1.197 (colored)

Minor bug fix:  When .Pp rewinds .Nm, rewind the whole block,
not just the body.  In some unusual edge cases, this caused
the .Pp to become a sibling of the .Nm body inside the .Nm block.

Revision 1.197 / (download) - annotate - [select for diffs], Wed Apr 29 21:58:32 2015 UTC (5 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.196: +4 -2 lines
Diff to previous 1.196 (colored)

If a block body gets broken, that's no good reason to extend the
scope of the end macro.  Instead, only keep the tail scope open if
the end macro macro calls an explicit macro and actually breaks
that.  This corrects syntax tree structure and fixes an assertion
found by jsg@ with afl (test case 098/Apr27).

Revision 1.196 / (download) - annotate - [select for diffs], Wed Apr 29 14:48:53 2015 UTC (5 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.195: +3 -1 lines
Diff to previous 1.195 (colored)

Do not mark a block with the MDOC_BROKEN flag if it merely contains
a mismatching explicit end macro without actually being broken.
Avoids a subsequent upward search for the non-existent breaker
ending up in a NULL pointer access; afl test case 005/Apr27 from jsg@.

Revision 1.195 / (download) - annotate - [select for diffs], Thu Apr 23 15:35:59 2015 UTC (5 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.194: +2 -2 lines
Diff to previous 1.194 (colored)

Get rid of two empty wrapper functions.  No functional change.

Revision 1.194 / (download) - annotate - [select for diffs], Tue Apr 21 16:14:25 2015 UTC (5 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.193: +16 -13 lines
Diff to previous 1.193 (colored)

Avoid a use after free when the target node is deleted during validation.
Bug reported by jsg@.

Revision 1.193 / (download) - annotate - [select for diffs], Sun Apr 19 14:57:38 2015 UTC (5 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.192: +4 -4 lines
Diff to previous 1.192 (colored)

Unify trickier node handling functions.
* man_elem_alloc() -> roff_elem_alloc()
* man_block_alloc() -> roff_block_alloc()
The functions mdoc_elem_alloc() and mdoc_block_alloc() remain for
now because they need to do mdoc(7)-specific argument processing.

Revision 1.192 / (download) - annotate - [select for diffs], Sun Apr 19 14:25:41 2015 UTC (5 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.191: +3 -3 lines
Diff to previous 1.191 (colored)

Unify some node handling functions that use TOKEN_NONE.
* mdoc_word_alloc(), man_word_alloc() -> roff_word_alloc()
* mdoc_word_append(), man_word_append() -> roff_word_append()
* mdoc_addspan(), man_addspan() -> roff_addtbl()
* mdoc_addeqn(), man_addeqn() -> roff_addeqn()
Minus 50 lines of code, no functional change.

Revision 1.191 / (download) - annotate - [select for diffs], Sun Apr 19 14:00:19 2015 UTC (5 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.190: +19 -18 lines
Diff to previous 1.190 (colored)

Decouple the token code for "no request or macro" from the individual
high-level parsers to allow further unification of functions that
only need to recognize this code, but that don't care about different
high-level macrosets beyond that.

Revision 1.190 / (download) - annotate - [select for diffs], Sun Apr 19 13:50:26 2015 UTC (5 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.189: +18 -17 lines
Diff to previous 1.189 (colored)

Unify node handling functions:
* node_alloc() for mdoc and man_node_alloc() -> roff_node_alloc()
* node_append() for mdoc and man_node_append() -> roff_node_append()
* mdoc_head_alloc() and man_head_alloc() -> roff_head_alloc()
* mdoc_body_alloc() and man_body_alloc() -> roff_body_alloc()
* mdoc_node_unlink() and man_node_unlink() -> roff_node_unlink()
* mdoc_node_free() and man_node_free() -> roff_node_free()
* mdoc_node_delete() and man_node_delete() -> roff_node_delete()
Minus 130 lines of code, no functional change.

Revision 1.189 / (download) - annotate - [select for diffs], Sat Apr 18 16:06:40 2015 UTC (5 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.188: +22 -21 lines
Diff to previous 1.188 (colored)

Replace the structs mdoc and man by a unified struct roff_man.
Almost completely mechanical, no functional change.
Written on the train from Exeter to London returning from p2k15.

Revision 1.188 / (download) - annotate - [select for diffs], Sun Apr 5 23:04:41 2015 UTC (5 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.187: +16 -4 lines
Diff to previous 1.187 (colored)

If a partial explicit block extending to the next input line follows
the end macro of a broken block, put all of it into the breaking block.
Needed for example by mutella(1).

Revision 1.187 / (download) - annotate - [select for diffs], Sun Apr 5 22:44:20 2015 UTC (5 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.186: +45 -51 lines
Diff to previous 1.186 (colored)

Reduce code duplication, no functional change:
Both partial and full implicit blocks can break explicit blocks.
Put the code to handle both cases into a common function.

Revision 1.186 / (download) - annotate - [select for diffs], Sun Apr 5 14:43:36 2015 UTC (5 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.185: +8 -10 lines
Diff to previous 1.185 (colored)

Arguments to end macros of broken partial explicit blocks
must go inside the breaking block.  For example, in
.It Ic cmd Oo
.Ar optional_arg Oc Ar mandatory_arg
the mandatory_arg is still inside the .It block.
Used for example by mutella(1).

Revision 1.185 / (download) - annotate - [select for diffs], Thu Apr 2 22:48:17 2015 UTC (5 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.184: +38 -40 lines
Diff to previous 1.184 (colored)

Second step towards parser unification:
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.

Revision 1.184 / (download) - annotate - [select for diffs], Thu Apr 2 21:36:50 2015 UTC (5 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.183: +21 -20 lines
Diff to previous 1.183 (colored)

First step towards parser unification:
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.

Revision 1.183 / (download) - annotate - [select for diffs], Thu Feb 12 12:24:33 2015 UTC (5 years, 5 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_13_3
Changes since 1.182: +78 -110 lines
Diff to previous 1.182 (colored)

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.

Revision 1.182 / (download) - annotate - [select for diffs], Wed Feb 11 13:37:57 2015 UTC (5 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.181: +8 -1 lines
Diff to previous 1.181 (colored)

explicit blocks close out .Nd; fixing data structure corruption
eventually leading to NULL pointer access;
found by jsg@ with afl, text case #455.

Revision 1.181 / (download) - annotate - [select for diffs], Tue Feb 10 17:47:45 2015 UTC (5 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.180: +44 -34 lines
Diff to previous 1.180 (colored)

Be more careful to not generate empty .In, .St, and .Xr nodes.
That could happen when their first argument was another called macro,
causing a NULL pointer access in .St validation found by jsg@ with afl.

Make in_line_argn() easier to understand by using one state
variable rather than two.

Revision 1.180 / (download) - annotate - [select for diffs], Sat Feb 7 16:42:33 2015 UTC (5 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.179: +2 -1 lines
Diff to previous 1.179 (colored)

Closing a block validates it, which may end up deleting it,
so if we are in a loop over blocks, cleanly restart the loop
rather than risking use after free; found by jsg@ with afl.

Revision 1.179 / (download) - annotate - [select for diffs], Fri Feb 6 07:13:14 2015 UTC (5 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.178: +4 -3 lines
Diff to previous 1.178 (colored)

Delete the legacy generic warning type MANDOCERR_ARGCWARN,
replacing the last instances by more specific warnings.
Improved functionality, minus 50 lines of code.

Revision 1.178 / (download) - annotate - [select for diffs], Fri Feb 6 03:38:45 2015 UTC (5 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.177: +7 -1 lines
Diff to previous 1.177 (colored)

better handle .Fo and .Fd without argument
better handle .Fo with more than one argument

Revision 1.177 / (download) - annotate - [select for diffs], Fri Feb 6 01:07:22 2015 UTC (5 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.176: +12 -1 lines
Diff to previous 1.176 (colored)

better handle .In .Sh .Ss .St .Xr without arguments

Revision 1.176 / (download) - annotate - [select for diffs], Thu Feb 5 01:46:56 2015 UTC (5 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.175: +2 -2 lines
Diff to previous 1.175 (colored)

fix handling of empty .An macros

Revision 1.175 / (download) - annotate - [select for diffs], Thu Feb 5 00:14:13 2015 UTC (5 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.174: +2 -8 lines
Diff to previous 1.174 (colored)

Simplify by deleting the "lastline" member of struct mdoc_node.
Minus one struct member, minus 17 lines of code, no functional change.

Revision 1.174 / (download) - annotate - [select for diffs], Wed Feb 4 22:30:10 2015 UTC (5 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.173: +8 -2 lines
Diff to previous 1.173 (colored)

Discard excess head arguments for .Bd .Bl .Bk and delete hwarn_eq0().
Discard empty .Bk blocks.
Improve related diagnostics.

Revision 1.173 / (download) - annotate - [select for diffs], Wed Feb 4 18:03:47 2015 UTC (5 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.172: +9 -4 lines
Diff to previous 1.172 (colored)

discard .Rs head arguments and improve .Rs diagnostics

Revision 1.172 / (download) - annotate - [select for diffs], Tue Feb 3 18:22:05 2015 UTC (5 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.171: +2 -1 lines
Diff to previous 1.171 (colored)

Avoid closing out an explicit block twice when broken by .It
(assertion failure); regression found in jsg@'s afl test case 847.

Revision 1.171 / (download) - annotate - [select for diffs], Tue Feb 3 01:14:12 2015 UTC (5 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.170: +75 -160 lines
Diff to previous 1.170 (colored)

Finally delete the kitchensink functions rew_sub() and rew_dohalt().
They were a maintenance and auditing nightmare because if you changed
one bit in there, stuff tended to break at seemingly unrelated places.
No functional change except getting rid of one bogus error message,
but minus 80 lines of code.

Revision 1.170 / (download) - annotate - [select for diffs], Tue Feb 3 00:48:47 2015 UTC (5 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.169: +11 -4 lines
Diff to previous 1.169 (colored)

Bring .Pp/.Lp handling inside .Nm blocks closer to groff;
as a bonus, get rid of another call to rew_sub().

Revision 1.169 / (download) - annotate - [select for diffs], Mon Feb 2 19:23:23 2015 UTC (5 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.168: +50 -57 lines
Diff to previous 1.168 (colored)

Simplify and reindent make_pending().  No functional change
except that some error messages become less confusing.
Now the function is almost readable (but still requires
nineteen lines of comments for fourteen lines of code).

Revision 1.168 / (download) - annotate - [select for diffs], Mon Feb 2 18:26:32 2015 UTC (5 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.167: +21 -31 lines
Diff to previous 1.167 (colored)

Simplify: Do not call rew_dohalt() from make_pending(),
the calling macro handler already found the breaking block.
No functional change except tiny variations in error messages.

Revision 1.167 / (download) - annotate - [select for diffs], Mon Feb 2 15:02:49 2015 UTC (5 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.166: +37 -66 lines
Diff to previous 1.166 (colored)

Get rid of all remaining calls to rew_sub() where the target block
is known.  This only leaves three that do actual searching.
No functional change, minus 30 lines of code.

Revision 1.166 / (download) - annotate - [select for diffs], Mon Feb 2 04:26:44 2015 UTC (5 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.165: +67 -65 lines
Diff to previous 1.165 (colored)

Get rid of all calls to rew_sub() in blk_exp_close(); only ten calls
remain in other functions.  As a bonus, this fixes an assertion failure
jsg@ found some time ago with afl (test case 982) and improves minor
details in error reporting.

Revision 1.165 / (download) - annotate - [select for diffs], Mon Feb 2 04:04:45 2015 UTC (5 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.164: +7 -4 lines
Diff to previous 1.164 (colored)

When a full block macro gets closed out by a mismatching
block closure macro it calls, do not attempt to open its body.
This can for example happen for (nonsensical) constructions like
.Fo
.Nm Fc
in the SYNOPSIS.  Fixing an assertion failure jsg@ found with afl
some time ago (test case number 731).

Revision 1.164 / (download) - annotate - [select for diffs], Sun Feb 1 23:56:37 2015 UTC (5 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.163: +14 -3 lines
Diff to previous 1.163 (colored)

get rid of rew_sub() in blk_part_imp(); no functional change

Revision 1.163 / (download) - annotate - [select for diffs], Sun Feb 1 17:30:45 2015 UTC (5 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.162: +8 -24 lines
Diff to previous 1.162 (colored)

Simplify blk_part_exp(), no functional change.
* Replace calls to rew_sub() with rew_last() - two less out of 18.
* No need to keep track of the body, it's always opened right after
the head and never used for anything in this function.

Revision 1.162 / (download) - annotate - [select for diffs], Sun Feb 1 16:47:39 2015 UTC (5 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.161: +4 -5 lines
Diff to previous 1.161 (colored)

The function rew_sub() tries to rewind any all all kinds of blocks
and elements under any and all circumstances, even handling some
bad block nesting now and then.  Little surprisingly, this ends up
in excessive complexity and has caused many bugs in the past.
Start to slowly disentangle this mess by replacing calls to rew_sub()
immediately following mdoc_head_alloc() by the much simpler rew_last().
Gets rid of the first two rew_sub() calls out of twenty.
No functional change.

Revision 1.161 / (download) - annotate - [select for diffs], Mon Dec 22 23:27:32 2014 UTC (5 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.160: +3 -3 lines
Diff to previous 1.160 (colored)

The code already pays attention not to close the same block twice.
Similarly, avoid having the same block break two other blocks.
In some situations, this could lead to an endless loop in rew_sub()
found by jsg@ with afl.
Minimal example:  .Po Ao Pc Bo Pc Ac Bc

Revision 1.160 / (download) - annotate - [select for diffs], Sat Dec 20 02:26:57 2014 UTC (5 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.159: +20 -9 lines
Diff to previous 1.159 (colored)

Fix two issues causing a class of assertion failures found by jsg@ with afl.
1) rew_sub(): Make sure REWIND_MORE is acted upon even when followed by
REWIND_NONE.  This prevents .It from ending up inside other children of .Bl.
2) blk_exp_close(): Only allow extension of .Bl when it has at least
one .It.  Otherwise, a broken child block could be moved in front of
the .Bl, effectively resulting in a .Bl that ended before it began.

Revision 1.159 / (download) - annotate - [select for diffs], Thu Dec 18 20:58:32 2014 UTC (5 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.158: +3 -2 lines
Diff to previous 1.158 (colored)

Don't let .Ta creep into an already-closed list; same as for .It.
Fixes an assertion found by jsg@ with afl.

Revision 1.158 / (download) - annotate - [select for diffs], Thu Dec 18 03:10:11 2014 UTC (5 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.157: +32 -21 lines
Diff to previous 1.157 (colored)

The code is already careful to not add items to lists that were
already closed.  In this respect, also consider lists closed
that have broken another block, their closure pending until the
end of the broken block.  This avoids syntax tree corruption
leading to a NULL pointer access found by jsg@ with afl.

Revision 1.157 / (download) - annotate - [select for diffs], Sat Dec 13 13:14:39 2014 UTC (5 years, 7 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_13_2
Changes since 1.156: +3 -5 lines
Diff to previous 1.156 (colored)

Fix a regression found by Carsten dot Kunze at arcor dot de:
Do not show bogus quotes when .Bl -column phrases are quoted.

Revision 1.156 / (download) - annotate - [select for diffs], Sun Nov 30 05:29:00 2014 UTC (5 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.155: +17 -7 lines
Diff to previous 1.155 (colored)

Multiple fixes with respect to .Pf:
* 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.

Revision 1.155 / (download) - annotate - [select for diffs], Sun Nov 30 02:36:38 2014 UTC (5 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.154: +17 -9 lines
Diff to previous 1.154 (colored)

warn about attempts to call non-callable macros;
inspired by a similar warning in the groff_mdoc(7) macros

Revision 1.154 / (download) - annotate - [select for diffs], Sat Nov 29 04:31:35 2014 UTC (5 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.153: +21 -19 lines
Diff to previous 1.153 (colored)

Reduce code duplication by reusing the same argument parser
for in_line_eoln() macros and .Bl -column phrases.
No functional change.

Revision 1.153 / (download) - annotate - [select for diffs], Sat Nov 29 03:37:44 2014 UTC (5 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.152: +63 -116 lines
Diff to previous 1.152 (colored)

Provide a helper function macro_or_word() and use it to prune the
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.

Revision 1.152 / (download) - annotate - [select for diffs], Fri Nov 28 23:21:32 2014 UTC (5 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.151: +5 -47 lines
Diff to previous 1.151 (colored)

Fold the loop around mdoc_argv() into the function itself,
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.

Revision 1.151 / (download) - annotate - [select for diffs], Fri Nov 28 04:47:03 2014 UTC (5 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.150: +117 -199 lines
Diff to previous 1.150 (colored)

Simplify by making the mdoc parser callbacks void, and some cleanup;
no functional change, minus 50 lines of code.

Revision 1.150 / (download) - annotate - [select for diffs], Fri Nov 28 03:14:18 2014 UTC (5 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.149: +234 -376 lines
Diff to previous 1.149 (colored)

Simplify the code by making various mdoc parser helper functions void.
No functional change, minus 130 lines of code.

Revision 1.149 / (download) - annotate - [select for diffs], Fri Nov 28 01:05:43 2014 UTC (5 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.148: +45 -53 lines
Diff to previous 1.148 (colored)

Simplify code by making mdoc validation handlers void.
No functional change, minus 90 lines of code.

Revision 1.148 / (download) - annotate - [select for diffs], Thu Nov 27 22:27:56 2014 UTC (5 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.147: +28 -8 lines
Diff to previous 1.147 (colored)

Multiple fixes with respect to .Eo:
1. Correctly parse stray .Ec without preceding .Eo,
avoiding an assertion violation found by jsg@ with afl.
2. Correctly parse .Ec arguments when breaking another block.
3. Correct spacing around closing delimiter when breaking another block.
4. Sync some related formatting control from -Tascii to -Thtml.

Revision 1.147 / (download) - annotate - [select for diffs], Wed Nov 26 19:22:51 2014 UTC (5 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.146: +2 -2 lines
Diff to previous 1.146 (colored)

The .Sm macro accepts at most one argument;
fixing an assertion failure found by jsg@ with afl.

Revision 1.146 / (download) - annotate - [select for diffs], Tue Nov 25 20:00:01 2014 UTC (5 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.145: +4 -2 lines
Diff to previous 1.145 (colored)

Do not access a NULL pointer when a section has no body,
which can for example happen for .Sh Xo .Sh without .Xc.
Crash found by jsg@ with afl.

Revision 1.145 / (download) - annotate - [select for diffs], Thu Nov 20 00:31:28 2014 UTC (5 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.144: +5 -2 lines
Diff to previous 1.144 (colored)

Fix two minibugs reported by Thomas Klausner <wiz at NetBSD>:
1. The first argument of .Fn is not supposed to be parsed.
2. The .Fn macro is not supposed to reopen its scope after punctuation.

Revision 1.144 / (download) - annotate - [select for diffs], Mon Nov 17 06:44:58 2014 UTC (5 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.143: +51 -25 lines
Diff to previous 1.143 (colored)

Multiple fixes with respect to in-line macros:
* .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@.

Revision 1.143 / (download) - annotate - [select for diffs], Sun Sep 7 00:05:28 2014 UTC (5 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.142: +3 -3 lines
Diff to previous 1.142 (colored)

Allow .ll in the prologue; Daniel Levai reports Slackware Linux uses this.

Revision 1.142 / (download) - annotate - [select for diffs], Thu Aug 21 12:57:17 2014 UTC (5 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.141: +13 -14 lines
Diff to previous 1.141 (colored)

Right after .Fl, a middle delimiter triggers an empty scope,
just like a closing delimiter.  This didn't work in groff-1.15,
but it now works in groff-1.22.

After being closed by delimiters, .Nm scopes do not reopen.

Do not suppress white space after .Fl if the next node is a text node
on the same input line; that can happen for middle delimiters.

Fixing an issue reported by jmc@.

Revision 1.141 / (download) - annotate - [select for diffs], Sat Aug 16 19:50:37 2014 UTC (5 years, 11 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_12_4, VERSION_1_12
Changes since 1.140: +3 -2 lines
Diff to previous 1.140 (colored)

If a stray .It follows .El, we are no longer in the list,
even though the list is still the last processed macro.
This fixes a regression introduced in mdoc_macro.c rev. 1.138:
Ulrich Spoerlein <uqs at FreeBSD> reports that various of their
kernel manuals trigger assertions.

Revision 1.140 / (download) - annotate - [select for diffs], Sun Aug 10 23:54:41 2014 UTC (5 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.139: +3 -3 lines
Diff to previous 1.139 (colored)

Get rid of HAVE_CONFIG_H, it is always defined; idea from libnbcompat.
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.

Revision 1.139 / (download) - annotate - [select for diffs], Fri Aug 1 17:27:44 2014 UTC (6 years ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_13_1
Changes since 1.138: +2 -2 lines
Diff to previous 1.138 (colored)

mention requests and macros in more messages

Revision 1.138 / (download) - annotate - [select for diffs], Wed Jul 30 17:06:26 2014 UTC (6 years ago) by schwarze
Branch: MAIN
Changes since 1.137: +19 -1 lines
Diff to previous 1.137 (colored)

Get rid of the useless FATAL error "child violates parent syntax".
When finding items outside lists, simply skip them and throw an ERROR.
Handle subsections before the first section instead of bailing out.

Revision 1.137 / (download) - annotate - [select for diffs], Mon Jul 7 21:36:20 2014 UTC (6 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.136: +10 -6 lines
Diff to previous 1.136 (colored)

Clean up ERROR messages related to document structure and macros:
Hierarchical naming and mention macro names in messages.

Revision 1.136 / (download) - annotate - [select for diffs], Fri Jul 4 16:12:08 2014 UTC (6 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.135: +7 -6 lines
Diff to previous 1.135 (colored)

Clean up messages regarding excess arguments:
* Downgrade ".Bf -emphasis Em" from FATAL to WARNING.
* Mention the macros, the arguments, and the fallbacks.
* Hierarchical naming.

Revision 1.135 / (download) - annotate - [select for diffs], Wed Jul 2 20:19:11 2014 UTC (6 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.134: +6 -4 lines
Diff to previous 1.134 (colored)

Improve and test the messages about empty macros,
in particular reporting the macro names involved.

Revision 1.134 / (download) - annotate - [select for diffs], Wed Jul 2 11:43:20 2014 UTC (6 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.133: +5 -14 lines
Diff to previous 1.133 (colored)

Clean up warnings related to macros and nesting.
* Hierarchical naming of enum mandocerr items.
* Improve the wording to make it comprehensible.
* Mention the offending macro.
* Garbage collect one chunk of ancient, long unreachable code.

Revision 1.133 / (download) - annotate - [select for diffs], Wed Jul 2 08:21:39 2014 UTC (6 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.132: +3 -3 lines
Diff to previous 1.132 (colored)

Fix the column numbers associated with in_line_argn() macros;
this bug is more than four years old, introduced by kristaps@
in mdocml.bsd.lv rev. 1.46, March 30, 2010.

Revision 1.132 / (download) - annotate - [select for diffs], Wed Jul 2 03:48:07 2014 UTC (6 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.131: +7 -14 lines
Diff to previous 1.131 (colored)

Implement the obsolete macros .En .Es .Fr .Ot for backward compatibility,
since this is hardly more complicated than explicitly ignoring them
as we did in the past.  Of course, do not use them!

Revision 1.131 / (download) - annotate - [select for diffs], Sun Apr 20 16:46:05 2014 UTC (6 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.130: +130 -153 lines
Diff to previous 1.130 (colored)

KNF: case (FOO):  ->  case FOO:, remove /* LINTED */ and /* ARGSUSED */,
remove trailing whitespace and blanks before tabs, improve some indenting;
no functional change

Revision 1.130 / (download) - annotate - [select for diffs], Sun Mar 30 19:47:48 2014 UTC (6 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.129: +2 -1 lines
Diff to previous 1.129 (colored)

Implement the roff(7) .ll (line length) request.
Found by naddy@ in the textproc/enchant(1) port.
Of course, do not use this in new manuals.

Revision 1.129 / (download) - annotate - [select for diffs], Tue Jan 21 10:26:53 2014 UTC (6 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.128: +2 -2 lines
Diff to previous 1.128 (colored)

Treat the line after .Cd as a single argument.
This doesn't hurt normal manual display
and makes the mandocdb(8) database more useful.

Revision 1.128 / (download) - annotate - [select for diffs], Mon Jan 20 11:28:29 2014 UTC (6 years, 6 months ago) by schwarze
Branch: MAIN
Changes since 1.127: +2 -2 lines
Diff to previous 1.127 (colored)

Keep words after .Ic together in a single argument.
This doesn't hurt normal manual display
and makes the mandocdb(8) database more useful.

Revision 1.127 / (download) - annotate - [select for diffs], Tue Dec 31 23:23:11 2013 UTC (6 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.126: +2 -2 lines
Diff to previous 1.126 (colored)

Simplify: Remove an unused argument from the mandoc_eos() function.
No functional change.

Revision 1.126 / (download) - annotate - [select for diffs], Tue Dec 31 22:40:12 2013 UTC (6 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.125: +1 -20 lines
Diff to previous 1.125 (colored)

Do not trigger end-of-sentence spacing by trailing punctuation
at the end of partial implicit macros.  Prodded by jmc@.

Actually, this is a revert of rev. 1.64 Fri May 14 14:09:13 2010 UTC
by kristaps@, with this original commit message:
"Block-implicit macros now up-propogate end-of-sentence spacing.
NOTE: GROFF IS NOT SMART ENOUGH TO DO THIS."
Please speak after me: Then why the hell should we?

We already weakened this in rev. 1.93 Sun Jul 18 17:00:26 2010 UTC,
but that weakening was insufficient.  Let's take it out completely.

Admittedly, there are two places in OpenBSD base where what Kristaps
did make the output nicer, in calloc(3) and in fish(6).  But both are
atypical.  There are 18 other places where this revert makes the
output nicer, the typical case being:
"Mail status is shown as ``No Mail.''  if there is no mail."
You do *not* want the EOS spacing after ``No Mail.'' in that sentence.

Revision 1.125 / (download) - annotate - [select for diffs], Tue Dec 24 20:45:27 2013 UTC (6 years, 7 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_12_3
Changes since 1.124: +2 -3 lines
Diff to previous 1.124 (colored)

It turns out SYNOPSIS mode does not imply .Bk in general,
but only within .Nm blocks.  Simplify the code accordingly.

Triggered by research done by Franco Fichtner.

Revision 1.124 / (download) - annotate - [select for diffs], Tue Dec 24 19:11:46 2013 UTC (6 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.123: +6 -1 lines
Diff to previous 1.123 (colored)

When deciding whether two consecutive macros are on the same input line,
we have to compare the line where the first one *ends* (not where it begins)
to the line where the second one starts.
This fixes the bug that .Bk allowed output line breaks right after block
macros spanning more than one input line, even when the next macro follows
on the same line.

Revision 1.123 / (download) - annotate - [select for diffs], Mon Oct 21 23:47:58 2013 UTC (6 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.122: +140 -99 lines
Diff to previous 1.122 (colored)

There are three kinds of input lines: text lines, macros taking
positional arguments (like Dt Fn Xr) and macros taking text as
arguments (like Nd Sh Em %T An).  In the past, even the latter put
each word of their arguments into its own MDOC_TEXT node; instead,
concatenate arguments unless delimiters, keeps or spacing mode
prevent that.  Regarding mandoc(1), this is internal refactoring,
no output change intended.

Regarding mandocdb(8), this fixes yet another regression introduced
when switching from DB to SQLite: The ability to search for strings
crossing word boundaries was lost and is hereby restored.  At the
same time, database sizes and build times are both reduced by a bit
more than 5% each.

Revision 1.122 / (download) - annotate - [select for diffs], Sun Sep 15 18:26:46 2013 UTC (6 years, 10 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_12_2
Changes since 1.121: +4 -1 lines
Diff to previous 1.121 (colored)

Block closing macros do not allocate a new node but finish an existing
one, so they miss the clearing of MDOC_NEWLINE in mdoc.c, node_alloc().
Consequently, MDOC_NEWLINE must be cleared before processing the next
macro on the same line.
This fixes horizontal spacing for input lines beginning like .Oc Ns ...

Issue found by Franco Fichtner <franco at lastsummer dot de>
while working on DragonFly mandoc integration.

Revision 1.121 / (download) - annotate - [select for diffs], Mon Nov 19 22:30:58 2012 UTC (7 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.120: +11 -5 lines
Diff to previous 1.120 (colored)

Do not crash on stray .Ta macros found outside column lists.
Problem reported by jmc@, thanks.

Revision 1.120 / (download) - annotate - [select for diffs], Sun Nov 18 00:05:35 2012 UTC (7 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.119: +3 -2 lines
Diff to previous 1.119 (colored)

Fix four small whitespace issues related to trailing punctuation
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.

Revision 1.119 / (download) - annotate - [select for diffs], Sat Nov 17 00:26:33 2012 UTC (7 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.118: +181 -176 lines
Diff to previous 1.118 (colored)

Cleanup naming of local variables to make the code easier on the eye:
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

Revision 1.118 / (download) - annotate - [select for diffs], Fri Nov 16 13:40:36 2012 UTC (7 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.117: +2 -2 lines
Diff to previous 1.117 (colored)

Fix a crash triggered by .Bl -tag .It Xo .El .Sh found by florian@.

* When allocating a body end marker, copy the pointer to the normalized
block information from the body block, avoiding the risk of subsequent
null pointer derefence.
* When inserting the body end marker into the syntax tree, do not try to
copy that pointer from the parent block, because not being a direkt child
of the block it belongs to is the whole point of a body end marker.
* Even non-callable blocks (like Bd and Bl) can break other blocks;
when this happens, postpone closing them out in the usual way.

Completed and tested at the OpenBSD impromptu Coimbra hackathon (c2k12).
Thanks to Pedro Almeida and the Laborat'orio de Computa,c~ao Avan,cada
da Universidade de Coimbra (http://www.uc.pt/lca) for their hospitality!

Revision 1.117 / (download) - annotate - [select for diffs], Wed Jul 18 16:20:43 2012 UTC (8 years ago) by schwarze
Branch: MAIN
Changes since 1.116: +9 -2 lines
Diff to previous 1.116 (colored)

Let a trailing .Ns macro take effect
even on an input line containing a partial implicit macro.

Fixes horizontal spacing in vi(1), ddb(4), and ppp(8).

OpenBSD rev. 1.74.

Revision 1.116 / (download) - annotate - [select for diffs], Sun May 27 17:39:28 2012 UTC (8 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.115: +2 -2 lines
Diff to previous 1.115 (colored)

update Copyright years according to the CVS logs; no code change

Revision 1.115 / (download) - annotate - [select for diffs], Thu Jan 5 00:43:51 2012 UTC (8 years, 7 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_12_1
Changes since 1.114: +9 -11 lines
Diff to previous 1.114 (colored)

Fix previous such that all .It HEADs are unparsed,
not just the first one in each -diag list.
While here, drop the needless if-statement
and choose a more precise wording for the comment.
ok kristaps@

Revision 1.114 / (download) - annotate - [select for diffs], Mon Jan 2 15:48:05 2012 UTC (8 years, 7 months ago) by kristaps
Branch: MAIN
Changes since 1.113: +14 -4 lines
Diff to previous 1.113 (colored)

`-diag' lists aren't parsed, unlike other list types.  This fixes a TODO
entry raised by deraadt@.

Revision 1.113 / (download) - annotate - [select for diffs], Sat Dec 3 23:59:14 2011 UTC (8 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.112: +1 -17 lines
Diff to previous 1.112 (colored)

Remove an OpenBSD-specific tweak regarding .Xr spacing and make it
compatible with groff-1.21.  This tweak was originally added for
compatibility with groff-1.15, which is no longer needed.

ok jmc@ kristaps@

Revision 1.112 / (download) - annotate - [select for diffs], Sun Oct 16 12:20:34 2011 UTC (8 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.111: +2 -5 lines
Diff to previous 1.111 (colored)

Remove a bunch of useless assignments,
and assert that print_bvspace cannot be called on NULL pointers.
No change in behaviour, none of these were bugs,
but the code becomes easier to understand.
Based on a clang report posted by joerg@; ok kristaps@.

Revision 1.111 / (download) - annotate - [select for diffs], Sun Sep 18 14:14:15 2011 UTC (8 years, 10 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_12_0
Changes since 1.110: +2 -2 lines
Diff to previous 1.110 (colored)

forgotten Copyright bumps; no code change
found while syncing to OpenBSD

Revision 1.110 / (download) - annotate - [select for diffs], Wed Aug 10 14:07:23 2011 UTC (8 years, 11 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_11_7, VERSION_1_11_6
Changes since 1.109: +3 -3 lines
Diff to previous 1.109 (colored)

Allow `Sx' and `Ss' to have child nodes.  Fixes manuals in NetBSD.
Originally pointed out by joerg@ then again by Thomas Klausner by way of
Nicolas Joy.  Note: don't use these constructions as you can't link to
the sections with `Sx'.

Revision 1.109 / (download) - annotate - [select for diffs], Sat Apr 30 10:18:24 2011 UTC (9 years, 3 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_11_5, VERSION_1_11_4, VERSION_1_11_3, VERSION_1_11_2
Changes since 1.108: +5 -5 lines
Diff to previous 1.108 (colored)

No code change: fixing spelling errors.  From a patch by uqs@.  Thanks!

Revision 1.108 / (download) - annotate - [select for diffs], Mon Apr 25 00:03:07 2011 UTC (9 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.107: +14 -2 lines
Diff to previous 1.107 (colored)

Closing delimiters only suppress spacing when they follow something.
Fixing a regression introduced in rev. 1.105.
ok and prodding for comments kristaps@.

Revision 1.107 / (download) - annotate - [select for diffs], Tue Apr 19 16:38:48 2011 UTC (9 years, 3 months ago) by kristaps
Branch: MAIN
Changes since 1.106: +4 -4 lines
Diff to previous 1.106 (colored)

Clean up parsing of delimiters in -mdoc.  First, remove the "dowarn"
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.

Revision 1.106 / (download) - annotate - [select for diffs], Tue Mar 22 14:33:05 2011 UTC (9 years, 4 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_11_1
Changes since 1.105: +2 -1 lines
Diff to previous 1.105 (colored)

libmdoc.h and libman.h were including mdoc.h and man.h, respectively.
Don't have them do that (includes in header files = faugh), and have
individual files directly include these files.

Revision 1.105 / (download) - annotate - [select for diffs], Tue Mar 22 14:05:45 2011 UTC (9 years, 4 months ago) by kristaps
Branch: MAIN
Changes since 1.104: +48 -25 lines
Diff to previous 1.104 (colored)

Move mandoc_isdelim() back into libmdoc.h.  This fixes an unreported
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().

Revision 1.104 / (download) - annotate - [select for diffs], Sun Mar 20 16:02:05 2011 UTC (9 years, 4 months ago) by kristaps
Branch: MAIN
Changes since 1.103: +9 -8 lines
Diff to previous 1.103 (colored)

Consolidate messages.  Have all parse-time messages (in libmdoc,
libroff, etc., etc.) route into mandoc_msg() and mandoc_vmsg(), for the
time being in libmandoc.h.  This requires struct mparse to be passed
into the allocation routines instead of mandocmsg and a void pointer.
Then, move some of the functionality of the old mmsg() into read.c's
mparse_mmsg() (check against wlevel and setting of file_status) and use
main.c's mmsg() as simply a printing tool.

Revision 1.103 / (download) - annotate - [select for diffs], Thu Mar 17 11:30:23 2011 UTC (9 years, 4 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_10_10
Changes since 1.102: +10 -11 lines
Diff to previous 1.102 (colored)

Clean-up in libmdoc: fix last checks for mdoc_*msg return value, then
make mdoc_vmsg not return an int.  libmdoc is now completely clean of
return-value checks from the message subsystem.

Revision 1.102 / (download) - annotate - [select for diffs], Thu Mar 17 09:16:38 2011 UTC (9 years, 4 months ago) by kristaps
Branch: MAIN
Changes since 1.101: +8 -8 lines
Diff to previous 1.101 (colored)

Move mdoc_isdelim() into mandoc.h as mandoc_isdelim().  This allows the
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.

Revision 1.101 / (download) - annotate - [select for diffs], Tue Jan 25 15:17:18 2011 UTC (9 years, 6 months ago) by kristaps
Branch: MAIN
Changes since 1.100: +3 -1 lines
Diff to previous 1.100 (colored)

Have `Bx' accept two arguments, not just one, and join these arguments
with "xxBSD-yy"

Revision 1.100 / (download) - annotate - [select for diffs], Wed Jan 12 17:00:07 2011 UTC (9 years, 6 months ago) by kristaps
Branch: MAIN
Changes since 1.99: +10 -3 lines
Diff to previous 1.99 (colored)

Incorporate same fix for -man post-validation deletion of nodes.  This
isn't known to cause any problems, but better safe than sorry.

Revision 1.99 / (download) - annotate - [select for diffs], Wed Dec 15 23:39:40 2010 UTC (9 years, 7 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_10_9, VERSION_1_10_8
Changes since 1.98: +4 -1 lines
Diff to previous 1.98 (colored)

Add a "last child" member of struct mdoc_node.

Remove `Pp' or `Lp' if it is the FIRST or LAST child of an `Sh' or `Sh' body.

Make "skipping paragraph" be an error, not a warning, as information (an
invoked macro) is ignored.

Revision 1.98 / (download) - annotate - [select for diffs], Mon Dec 6 11:01:19 2010 UTC (9 years, 8 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_10_7
Changes since 1.97: +22 -22 lines
Diff to previous 1.97 (colored)

Merge schwarze@'s relaxation of scope-breaking rules: allow implicit
ending of scopes and drop stray scope-endings.

Revision 1.97 / (download) - annotate - [select for diffs], Tue Nov 30 13:04:14 2010 UTC (9 years, 8 months ago) by kristaps
Branch: MAIN
Changes since 1.96: +3 -11 lines
Diff to previous 1.96 (colored)

mdoc_action.c is no more.  Attic it and remove it from the Makefile.
Remove references to MDOC_ACTED (it was only assertions) and the pre-
and post-action functions.

Revision 1.96 / (download) - annotate - [select for diffs], Mon Nov 29 13:02:47 2010 UTC (9 years, 8 months ago) by kristaps
Branch: MAIN
Changes since 1.95: +2 -2 lines
Diff to previous 1.95 (colored)

Move `Mt', `Ar', and `Li' handling from mdoc_action.c into mdoc_validate.c.

Clarify that `Mt' gets a default `~' (as per groff 1.20) and document it
in mdoc.7.

Made `Lk' be removed in mdoc_macro.c if it has no arguments.  This fixes
segfaults in mdoc_{term,html}.c that nobody's managed to raise yet.

Revision 1.95 / (download) - annotate - [select for diffs], Fri Oct 1 21:51:13 2010 UTC (9 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.94: +3 -3 lines
Diff to previous 1.94 (colored)

* need a space before .No even if it starts with a closing delimiter
* slightly simplify .Pf *_IGNDELIM code, and share part of it with .No
* do not let opening delimiters fall out of the front of .Ns (from kristaps@)
This fixes a few spacing issues in csh(1) and ksh(1).
OK kristaps@

Revision 1.94 / (download) - annotate - [select for diffs], Sun Sep 26 20:22:28 2010 UTC (9 years, 10 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_10_6
Changes since 1.93: +5 -9 lines
Diff to previous 1.93 (colored)

If an explicit scope is still open at the end of an input file,
report an ERROR:  We can still render the page by just closing
the open scope, but it is likely that information will be missing
or document structure mangled.
Before, man(7) only reported a WARNING (which is dangerous because
we cannot be sure rendering is correct) and mdoc(7) ran into FATAL
(which is too drastic, there is no reason not to show what we have).
"looks good" kristaps@

Revision 1.93 / (download) - annotate - [select for diffs], Sun Jul 18 17:00:26 2010 UTC (10 years ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_10_5_PREPDF, VERSION_1_10_5
Changes since 1.92: +3 -3 lines
Diff to previous 1.92 (colored)

Text ending in a full stop, exclamation mark or question mark
should not flag the end of a sentence if:

1) The punctuation is followed by closing delimiters
and not preceded by alphanumeric characters, like in
"There is no full stop (.) in this sentence"

or

2) The punctuation is a child of a macro
and not preceded by alphanumeric characters, like in
"There is no full stop
.Pq \&.
in this sentence"

"looks fine" to kristaps@; tested by jmc@ and sobrado@

Revision 1.92 / (download) - annotate - [select for diffs], Sun Jul 4 22:04:04 2010 UTC (10 years, 1 month ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_10_4
Changes since 1.91: +3 -2 lines
Diff to previous 1.91 (colored)

Assert my copyright, making it explicit that i'm granting the same license
on those parts of the code and text that i have written as Kristaps is.
"fine with me" kristaps@

Revision 1.91 / (download) - annotate - [select for diffs], Fri Jul 2 10:53:28 2010 UTC (10 years, 1 month ago) by kristaps
Branch: MAIN
Changes since 1.90: +2 -2 lines
Diff to previous 1.90 (colored)

Lint fixes.

Revision 1.90 / (download) - annotate - [select for diffs], Thu Jul 1 22:35:54 2010 UTC (10 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.89: +5 -2 lines
Diff to previous 1.89 (colored)

In the mdoc(7) parser, inspect roff registers early such that all parts
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@

Revision 1.89 / (download) - annotate - [select for diffs], Thu Jul 1 21:12:00 2010 UTC (10 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.88: +4 -1 lines
Diff to previous 1.88 (colored)

Correct handling of trailing punctuation in MDOC_DELIM blk_full HEADs.
The bug was uncovered by SYNOPSIS .Nm as this happened to be the first
block with this particular combination of properties.
Found the hard way by kristaps@ in NetBSD gcc-contrib(1),
fix by me.

Revision 1.88 / (download) - annotate - [select for diffs], Thu Jul 1 15:38:56 2010 UTC (10 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.87: +20 -11 lines
Diff to previous 1.87 (colored)

Improve .Nm indentation in the SYNOPSIS;
kristaps@ will do the missing HTML part soon.
"looks nicer" jmc@
"seems perfect to me" sobrado@
"slap it in" kristaps@

Revision 1.87 / (download) - annotate - [select for diffs], Thu Jul 1 14:28:12 2010 UTC (10 years, 1 month ago) by kristaps
Branch: MAIN
Changes since 1.86: +3 -3 lines
Diff to previous 1.86 (colored)

p->end is an enum: treat it as such.

Revision 1.86 / (download) - annotate - [select for diffs], Wed Jun 30 04:05:02 2010 UTC (10 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.85: +43 -4 lines
Diff to previous 1.85 (colored)

Closing of full blocks (Bd Bf Bk Bl It Fo Nd Rs Sh Ss) may never be
delayed: It must either succeed right away or fail outright.
As noticed by Kristaps, neglecting to fail properly when required
could make invalid input screw up the syntax tree and ultimately
trigger assertions in other, unrelated parts of the program.
This fix tested by and OK by kristaps@.
While here, comment the rather tricky function rew_dohalt().
This function will probably need more tweaks later on.

Revision 1.85 / (download) - annotate - [select for diffs], Tue Jun 29 19:45:06 2010 UTC (10 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.84: +2 -2 lines
Diff to previous 1.84 (colored)

fix a typo in the function declaration;
seems like gcc3 didn't catch it :-(
thanks to thib@ and kristaps@ for reporting

Revision 1.84 / (download) - annotate - [select for diffs], Tue Jun 29 19:24:14 2010 UTC (10 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.83: +70 -207 lines
Diff to previous 1.83 (colored)

Considerably simplify block rewind rules; no functional change intended.
* Let rew_alt() always succeed, obsoleting tons of case statements.
* Merge rew_dobreak() into rew_dohalt().
* Encode all rewinding cases uniformly in terms of "enum rew".
Required because i'm too dumb to get SYNOPSIS .Nm rewinding right
without cleaning this up first.

"get it in" kristaps@

Revision 1.83 / (download) - annotate - [select for diffs], Tue Jun 29 19:20:38 2010 UTC (10 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.82: +195 -73 lines
Diff to previous 1.82 (colored)

Support for badly nested blocks, written around the time of
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@

Revision 1.82 / (download) - annotate - [select for diffs], Sun Jun 27 15:52:41 2010 UTC (10 years, 1 month ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_10_3
Changes since 1.81: +16 -25 lines
Diff to previous 1.81 (colored)

Downstream maintainers: this removes UGLY!  I don't want diverging
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.

Revision 1.81 / (download) - annotate - [select for diffs], Sat Jun 26 16:07:08 2010 UTC (10 years, 1 month ago) by kristaps
Branch: MAIN
Changes since 1.80: +19 -16 lines
Diff to previous 1.80 (colored)

Mechanical diff allowing the const struct regset to propogate through
libman and libmdoc.

Revision 1.80 / (download) - annotate - [select for diffs], Sat Jun 19 20:46:28 2010 UTC (10 years, 1 month ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_10_2
Changes since 1.79: +2 -2 lines
Diff to previous 1.79 (colored)

Churn as I finish email address migration kth.se -> bsd.lv.

Revision 1.79 / (download) - annotate - [select for diffs], Mon May 31 23:49:16 2010 UTC (10 years, 2 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_10_1
Changes since 1.78: +2 -3 lines
Diff to previous 1.78 (colored)

Lint fixes (noops).

Revision 1.78 / (download) - annotate - [select for diffs], Mon May 31 22:39:55 2010 UTC (10 years, 2 months ago) by kristaps
Branch: MAIN
Changes since 1.77: +1 -21 lines
Diff to previous 1.77 (colored)

Remove now-superfluous check on `Ta' context.

Revision 1.77 / (download) - annotate - [select for diffs], Mon May 31 15:42:09 2010 UTC (10 years, 2 months ago) by kristaps
Branch: MAIN
Changes since 1.76: +12 -2 lines
Diff to previous 1.76 (colored)

Add ability to interpret initial free-form lines as part of a `Bl
-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.

Revision 1.76 / (download) - annotate - [select for diffs], Mon May 31 11:52:06 2010 UTC (10 years, 2 months ago) by kristaps
Branch: MAIN
Changes since 1.75: +5 -2 lines
Diff to previous 1.75 (colored)

`Ta' scope-checks need to be more specific (until implicit `It' handling
comes into play).

Revision 1.75 / (download) - annotate - [select for diffs], Mon May 31 10:28:04 2010 UTC (10 years, 2 months ago) by kristaps
Branch: MAIN
Changes since 1.74: +97 -23 lines
Diff to previous 1.74 (colored)

Remove enum mdocargerr from phrase() (unused).

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'.

Revision 1.74 / (download) - annotate - [select for diffs], Sun May 30 22:56:02 2010 UTC (10 years, 2 months ago) by kristaps
Branch: MAIN
Changes since 1.73: +20 -14 lines
Diff to previous 1.73 (colored)

Migrate `Bl -column' phrases to be MDOC_BODY instead of MDOC_HEAD.  This
will make it easy for re-entrant parsing of `Ta' macros to fit in with
standard closure rules.

Added some more regressions for `Bl -column'.  Note that one should
fail, as documented in the TODO file.

Recorded change of AST BNF in mdoc.3.

Revision 1.73 / (download) - annotate - [select for diffs], Sun May 30 21:50:23 2010 UTC (10 years, 2 months ago) by kristaps
Branch: MAIN
Changes since 1.72: +18 -5 lines
Diff to previous 1.72 (colored)

Final word on lac/ac.  Document flow as it relates to phrasing, as I'll
be changing this around and want a record in CVS of what was happening
beforehand.

Revision 1.72 / (download) - annotate - [select for diffs], Sun May 30 21:41:46 2010 UTC (10 years, 2 months ago) by kristaps
Branch: MAIN
Changes since 1.71: +4 -2 lines
Diff to previous 1.71 (colored)

Obvious fix to last patch: have ARGS_PEND also be flagged for phrase()
handling.

Revision 1.71 / (download) - annotate - [select for diffs], Sun May 30 21:28:30 2010 UTC (10 years, 2 months ago) by kristaps
Branch: MAIN
Changes since 1.70: +13 -9 lines
Diff to previous 1.70 (colored)

First in several iterative patches in getting complex -column lists
supported (which works but is tricky enough that it should be broken
down into digestable parts).  This simply moves around the propogation
of ARGS_PEND into one recognised by phrase().

Added a few regressions for simple -column lists.

Revision 1.70 / (download) - annotate - [select for diffs], Sat May 29 18:47:54 2010 UTC (10 years, 2 months ago) by kristaps
Branch: MAIN
Changes since 1.69: +33 -12 lines
Diff to previous 1.69 (colored)

Commit of patch floated on discuss@ a few days ago: if an in_line scope
has not been opened and closing punctuation is encountered AND the macro
is marked as accepting no-content (or `Li'), then open an empty scope.

Added regression tests for `Fl' and `Li' testing this behaviour.

Also, squeeze hyph0.in tests into the last characters of each line so
that groff doesn't hyphenate and break the test.

Revision 1.69 / (download) - annotate - [select for diffs], Wed May 26 09:35:35 2010 UTC (10 years, 2 months ago) by kristaps
Branch: MAIN
Changes since 1.68: +2 -2 lines
Diff to previous 1.68 (colored)

Fixed `Lb' to be in_line (reported by Ulrich Spoerlein).

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).

Revision 1.68 / (download) - annotate - [select for diffs], Mon May 17 22:11:42 2010 UTC (10 years, 2 months ago) by kristaps
Branch: MAIN
Changes since 1.67: +19 -15 lines
Diff to previous 1.67 (colored)

Enable the unified error/warning enumeration in mandoc.h that's
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.

Revision 1.67 / (download) - annotate - [select for diffs], Sat May 15 08:54:04 2010 UTC (10 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.66: +13 -11 lines
Diff to previous 1.66 (colored)

Distinguish OPEN, MIDDLE and CLOSE delimiters (using an enum).
Only OPEN are drawn before the beginning of a macro;
this is new, before this, MIDDLE ('|') were drawn in front, too.
Only CLOSE are pushed after the end of a macro (as before).
ok kristaps@

Revision 1.66 / (download) - annotate - [select for diffs], Sat May 15 06:48:13 2010 UTC (10 years, 2 months ago) by kristaps
Branch: MAIN
Changes since 1.65: +22 -7 lines
Diff to previous 1.65 (colored)

More EOS: append_delims() fitted with EOS detection, so ANY macro with appended delimiters will properly EOS.
Fixed mandoc_eos() to accept sentence punctuation followed by close-delim buffers.

Revision 1.65 / (download) - annotate - [select for diffs], Sat May 15 04:47:38 2010 UTC (10 years, 2 months ago) by kristaps
Branch: MAIN
Changes since 1.64: +15 -23 lines
Diff to previous 1.64 (colored)

More `Bl -column' dancing: It children also inherit in-phrase flags (noted by Ingo Schwarze).

Revision 1.64 / (download) - annotate - [select for diffs], Fri May 14 14:09:13 2010 UTC (10 years, 2 months ago) by kristaps
Branch: MAIN
Changes since 1.63: +21 -1 lines
Diff to previous 1.63 (colored)

Block-implicit macros now up-propogate end-of-sentence spacing.  NOTE: GROFF IS NOT SMART ENOUGH TO DO THIS.

Revision 1.63 / (download) - annotate - [select for diffs], Fri May 14 13:31:20 2010 UTC (10 years, 2 months ago) by kristaps
Branch: MAIN
Changes since 1.62: +11 -5 lines
Diff to previous 1.62 (colored)

Removed remaining "1 == ppos" invocations.

Revision 1.62 / (download) - annotate - [select for diffs], Fri May 14 12:55:22 2010 UTC (10 years, 2 months ago) by kristaps
Branch: MAIN
Changes since 1.61: +7 -12 lines
Diff to previous 1.61 (colored)

Proper handling of quoted tab-separated column lists.

Revision 1.61 / (download) - annotate - [select for diffs], Thu May 13 11:34:45 2010 UTC (10 years, 2 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_25
Changes since 1.60: +2 -1 lines
Diff to previous 1.60 (colored)

Lint fix.

Revision 1.60 / (download) - annotate - [select for diffs], Thu May 13 06:22:11 2010 UTC (10 years, 2 months ago) by kristaps
Branch: MAIN
Changes since 1.59: +22 -13 lines
Diff to previous 1.59 (colored)

Fixed bug in -Thtml -mdoc where `Lb' would line-break in LIBRARY section.
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.

Revision 1.59 / (download) - annotate - [select for diffs], Sun May 9 10:17:02 2010 UTC (10 years, 3 months ago) by kristaps
Branch: MAIN
Changes since 1.58: +45 -15 lines
Diff to previous 1.58 (colored)

Introduce ARGS_PEND for `It -column' end-of-line special casing.
Initial rules for insane `It -column' tabsep handling.

Revision 1.58 / (download) - annotate - [select for diffs], Sat May 8 07:30:19 2010 UTC (10 years, 3 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_24
Changes since 1.57: +4 -4 lines
Diff to previous 1.57 (colored)

Lint fixes (type-safety for enums via -cefuh).

Revision 1.57 / (download) - annotate - [select for diffs], Fri May 7 06:05:38 2010 UTC (10 years, 3 months ago) by kristaps
Branch: MAIN
Changes since 1.56: +5 -8 lines
Diff to previous 1.56 (colored)

Initial ARGS_PPHRASE (partial phrase) framework.
Running tally of changes in index.sgml.

Revision 1.56 / (download) - annotate - [select for diffs], Fri May 7 05:54:09 2010 UTC (10 years, 3 months ago) by kristaps
Branch: MAIN
Changes since 1.55: +25 -21 lines
Diff to previous 1.55 (colored)

enum-ised mdoc_argv() return (better return-value safety).

Revision 1.55 / (download) - annotate - [select for diffs], Fri May 7 05:48:29 2010 UTC (10 years, 3 months ago) by kristaps
Branch: MAIN
Changes since 1.54: +10 -10 lines
Diff to previous 1.54 (colored)

margerr -> margserr (getting ready for margverr).

Revision 1.54 / (download) - annotate - [select for diffs], Fri May 7 05:39:35 2010 UTC (10 years, 3 months ago) by kristaps
Branch: MAIN
Changes since 1.53: +26 -17 lines
Diff to previous 1.53 (colored)

Protection against running lookup() against quoted words.

Revision 1.53 / (download) - annotate - [select for diffs], Fri May 7 05:34:56 2010 UTC (10 years, 3 months ago) by kristaps
Branch: MAIN
Changes since 1.52: +145 -125 lines
Diff to previous 1.52 (colored)

Wrangle mdoc_args() and mdoc_zargs() to use enum return type.
Fixed lookup() and lookup_raw() to correctly use enum type.
Quashed in_line_argn() bug (not reported, but there) where mixing return values.

Revision 1.52 / (download) - annotate - [select for diffs], Tue Apr 6 07:17:51 2010 UTC (10 years, 4 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_23
Changes since 1.51: +2 -2 lines
Diff to previous 1.51 (colored)

Fix mdoc bug found by Claus Assmann: `Pf' should be callable.

Revision 1.51 / (download) - annotate - [select for diffs], Mon Apr 5 08:45:29 2010 UTC (10 years, 4 months ago) by kristaps
Branch: MAIN
Changes since 1.50: +9 -7 lines
Diff to previous 1.50 (colored)

Enum-ised REWIND return values.

Revision 1.50 / (download) - annotate - [select for diffs], Mon Apr 5 08:38:37 2010 UTC (10 years, 4 months ago) by kristaps
Branch: MAIN
Changes since 1.49: +9 -4 lines
Diff to previous 1.49 (colored)

Tentative fix of quoted punctuation issue noted by Jason McIntyre, e.g., `Li "!"' rendering the "!" outside of scope.

Revision 1.49 / (download) - annotate - [select for diffs], Wed Mar 31 08:04:57 2010 UTC (10 years, 4 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_22
Changes since 1.48: +14 -9 lines
Diff to previous 1.48 (colored)

Fixed fatal bug in Xo/Xc patch that caused segfaults with last-child explicit-scope macros.

Revision 1.48 / (download) - annotate - [select for diffs], Wed Mar 31 07:42:04 2010 UTC (10 years, 4 months ago) by kristaps
Branch: MAIN
Changes since 1.47: +3 -5 lines
Diff to previous 1.47 (colored)

Re-adjusting UGLY tags.
Fixed removed assignment of type.
Removed superfluous checks of mdoc_argflags (from days when comments were a macro tag).

Revision 1.47 / (download) - annotate - [select for diffs], Wed Mar 31 07:13:53 2010 UTC (10 years, 4 months ago) by kristaps
Branch: MAIN
Changes since 1.46: +53 -16 lines
Diff to previous 1.46 (colored)

Macro types enum-ated (enum mdoct) (for easier debugging in gdb of "tok" 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.

Revision 1.46 / (download) - annotate - [select for diffs], Tue Mar 30 08:24:01 2010 UTC (10 years, 4 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_21, VERSION_1_9_20
Changes since 1.45: +34 -22 lines
Diff to previous 1.45 (colored)

Modified in_line_eoln() to handle leading punctuation.

Revision 1.45 / (download) - annotate - [select for diffs], Tue Mar 30 06:52:08 2010 UTC (10 years, 4 months ago) by kristaps
Branch: MAIN
Changes since 1.44: +66 -54 lines
Diff to previous 1.44 (colored)

Last remaining bits for leading-punctuation in blk_exp().

Revision 1.44 / (download) - annotate - [select for diffs], Mon Mar 29 19:45:42 2010 UTC (10 years, 4 months ago) by kristaps
Branch: MAIN
Changes since 1.43: +9 -11 lines
Diff to previous 1.43 (colored)

Fixed segfault with accidentally-munged tree.

Revision 1.43 / (download) - annotate - [select for diffs], Mon Mar 29 19:28:04 2010 UTC (10 years, 4 months ago) by kristaps
Branch: MAIN
Changes since 1.42: +108 -76 lines
Diff to previous 1.42 (colored)

Integrate Ingo Schwarze's patch for mdoc_iscdelim() (tri-state for opening and closing macro punctuation).
Modify blk_part_exp() to correctly handle leading punctuation before HEAD.
Significantly clean up and document blk_part_exp().
Modify blk_part_imp() for to correctly handle leading punctuation before HEAD.
Significantly clean up and document blk_part_imp().
Integrate Ingo Schwarze's patch for args() (using new mdoc_iscdelim() format).
Documented bad `Ec' handling for later work in mdoc_term.c/mdoc_html.c.

Revision 1.42 / (download) - annotate - [select for diffs], Wed Feb 17 19:28:11 2010 UTC (10 years, 5 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_19, VERSION_1_9_18, VERSION_1_9_17, VERSION_1_9_16, VERSION_1_9_15
Changes since 1.41: +19 -3 lines
Diff to previous 1.41 (colored)

Made `Xr' compatible with groff calling conventions where arguments following the
trailing section are implicitly `Ns'd.  Based on a patch submitted by Ingo Schwarze.

Revision 1.41 / (download) - annotate - [select for diffs], Sat Jan 30 08:42:20 2010 UTC (10 years, 6 months ago) by kristaps
Branch: MAIN
Changes since 1.40: +28 -2 lines
Diff to previous 1.40 (colored)

Fix in handling Vt in SYNOPSIS with trailing punctuation.  Spotted by Joerg Sonnenberger.

Revision 1.40 / (download) - annotate - [select for diffs], Fri Jan 1 17:14:29 2010 UTC (10 years, 7 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_15-pre2
Changes since 1.39: +5 -1 lines
Diff to previous 1.39 (colored)

Big check-in of compatibility layer.  This should work on most major architectures. Thanks to Joerg Sonnenberger.

Revision 1.39 / (download) - annotate - [select for diffs], Fri Jan 1 13:17:58 2010 UTC (10 years, 7 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_15-pre1
Changes since 1.38: +12 -1 lines
Diff to previous 1.38 (colored)

`Fl' has each argument be in a separate scope (thanks Ingo Schwarze).
Situation of `Fl [arg]* "" [arg]*' is fixed: empty arguments are ignored.  Note that OpenBSD crashes when this happens.
Situation of `Fl' is fixed wrt trailing whitespace.

Revision 1.38 / (download) - annotate - [select for diffs], Mon Oct 26 17:05:44 2009 UTC (10 years, 9 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_14, VERSION_1_9_13, VERSION_1_9_12
Changes since 1.37: +2 -1 lines
Diff to previous 1.37 (colored)

Added time.h to various files for FreeBSD compilation (thanks Ulrich Sporlein).

Revision 1.37 / (download) - annotate - [select for diffs], Sat Oct 24 05:52:13 2009 UTC (10 years, 9 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_11, VERSION_1_9_10
Changes since 1.36: +2 -1 lines
Diff to previous 1.36 (colored)

Added `%U' to -mdoc (doesn't render in a nice way yet).

Revision 1.36 / (download) - annotate - [select for diffs], Sun Sep 20 17:24:57 2009 UTC (10 years, 10 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_9, VERSION_1_9_8, VERSION_1_9_7, VERSION_1_9_6, VERSION_1_9_5
Changes since 1.35: +2 -1 lines
Diff to previous 1.35 (colored)

Some extra html tags and near-complete Bl: -tag is hopeless (synonym for -hang, now) and -column is still pending.

Revision 1.35 / (download) - annotate - [select for diffs], Wed Sep 16 20:49:06 2009 UTC (10 years, 10 months ago) by kristaps
Branch: MAIN
Changes since 1.34: +14 -14 lines
Diff to previous 1.34 (colored)

Lintifications.

Revision 1.34 / (download) - annotate - [select for diffs], Wed Sep 16 14:40:56 2009 UTC (10 years, 10 months ago) by kristaps
Branch: MAIN
Changes since 1.33: +2 -2 lines
Diff to previous 1.33 (colored)

Lookup hashes are now static tables, ordered first-level by second character, then randomly along a chain.  Improves performance by a small fraction and considerably cleans up hash sources.

Revision 1.33 / (download) - annotate - [select for diffs], Thu Aug 20 08:59:12 2009 UTC (10 years, 11 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_2, VERSION_1_9_1
Changes since 1.32: +3 -3 lines
Diff to previous 1.32 (colored)

Delimiter whitespace is correctly flagged (required some special handling).

Revision 1.32 / (download) - annotate - [select for diffs], Wed Aug 19 14:09:33 2009 UTC (10 years, 11 months ago) by kristaps
Branch: MAIN
Changes since 1.31: +202 -265 lines
Diff to previous 1.31 (colored)

In-line documentation of mdoc_macro file.
Moved _NEXT_ macros into _alloc_ routines (where they belong).

Revision 1.31 / (download) - annotate - [select for diffs], Wed Aug 19 11:58:32 2009 UTC (10 years, 11 months ago) by kristaps
Branch: MAIN
Changes since 1.30: +1 -10 lines
Diff to previous 1.30 (colored)

Moved MDOC_NEXT_SIBLING into mdoc_word (libmdoc).
De-chunking of word terms in libman.

Revision 1.30 / (download) - annotate - [select for diffs], Thu Aug 13 11:43:24 2009 UTC (10 years, 11 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_0
Changes since 1.29: +3 -2 lines
Diff to previous 1.29 (colored)

Noted areas that need work in libmdoc.

Revision 1.29 / (download) - annotate - [select for diffs], Wed Jul 29 08:52:24 2009 UTC (11 years ago) by kristaps
Branch: MAIN
Changes since 1.28: +13 -28 lines
Diff to previous 1.28 (colored)

Columns with `Bl -column' correctly check for CALLABLE status.

Revision 1.28 / (download) - annotate - [select for diffs], Wed Jul 29 08:46:06 2009 UTC (11 years ago) by kristaps
Branch: MAIN
Changes since 1.27: +24 -18 lines
Diff to previous 1.27 (colored)

Moved CALLABLE check to lookup_raw().
Made PARSABLE check occur prior to lookup().
Non-PARSEABLE macros no longer warn against having macro-like parameters.
Non-CALLABLE macros no longer produce an error, just display their symbols (as in groff) (pointed out by joerg@netbsd.org).

Revision 1.27 / (download) - annotate - [select for diffs], Sat Jul 25 16:03:03 2009 UTC (11 years ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_8_5, VERSION_1_8_4
Changes since 1.26: +5 -6 lines
Diff to previous 1.26 (colored)

Patches and results of LLVM static analysis (thanks uqs@sporlein.net).

Revision 1.26 / (download) - annotate - [select for diffs], Fri Jul 24 12:17:25 2009 UTC (11 years ago) by kristaps
Branch: MAIN
Changes since 1.25: +6 -4 lines
Diff to previous 1.25 (colored)

Allow `An' to accept NULL arguments (-split/-nosplit).

Revision 1.25 / (download) - annotate - [select for diffs], Tue Jul 21 15:53:47 2009 UTC (11 years ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_8_3
Changes since 1.24: +3 -1 lines
Diff to previous 1.24 (colored)

Noted that `Pa' can accept 0 arguments.

Revision 1.24 / (download) - annotate - [select for diffs], Sun Jul 19 21:26:27 2009 UTC (11 years ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_8_2
Changes since 1.23: +26 -60 lines
Diff to previous 1.23 (colored)

Fixed and cleaned up "phrase" handling (`Bl -column' columns).
Found strange newline bug in -diag handling (and others?).

Revision 1.23 / (download) - annotate - [select for diffs], Sun Jul 19 09:17:42 2009 UTC (11 years ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_8_1
Changes since 1.22: +2 -2 lines
Diff to previous 1.22 (colored)

Made `Cd' parseable (too many SYNOPSIS sections do this).

Revision 1.22 / (download) - annotate - [select for diffs], Sun Jul 19 08:28:48 2009 UTC (11 years ago) by kristaps
Branch: MAIN
Changes since 1.21: +7 -7 lines
Diff to previous 1.21 (colored)

Explicit-close macros now only warn when encountering trailing terms, not
error out (try `.Ed foo').

Revision 1.21 / (download) - annotate - [select for diffs], Fri Jul 17 12:08:08 2009 UTC (11 years ago) by kristaps
Branch: MAIN
Changes since 1.20: +3 -7 lines
Diff to previous 1.20 (colored)

Documented `br' macro in mdoc.7.
Made `Pp' and `Lp' be inline_eoln() (not sure why they weren't before).

Revision 1.20 / (download) - annotate - [select for diffs], Fri Jul 17 10:56:57 2009 UTC (11 years ago) by kristaps
Branch: MAIN
Changes since 1.19: +3 -1 lines
Diff to previous 1.19 (colored)

Added `br' and `sp' macros (requested by joerg@netbsd.org, jmc@openbsd.org).

Revision 1.19 / (download) - annotate - [select for diffs], Sun Jul 12 16:34:16 2009 UTC (11 years ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_8_0
Changes since 1.18: +41 -4 lines
Diff to previous 1.18 (colored)

`Nd' is now a BFI (was an ELEM).  Noted by joerg@netbsd.org, behaviour ok jmc@openbsd.org, etc.

Revision 1.18 / (download) - annotate - [select for diffs], Tue Jul 7 11:47:17 2009 UTC (11 years, 1 month ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_7_24
Changes since 1.17: +2 -2 lines
Diff to previous 1.17 (colored)

Made `In' handling work in new-groff style (see mdoc.samples).

Revision 1.17 / (download) - annotate - [select for diffs], Tue Jul 7 09:29:15 2009 UTC (11 years, 1 month ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_7_23
Changes since 1.16: +3 -3 lines
Diff to previous 1.16 (colored)

Tabularised error-code lookup in mdoc.c.

Revision 1.16 / (download) - annotate - [select for diffs], Mon Jul 6 13:04:52 2009 UTC (11 years, 1 month ago) by kristaps
Branch: MAIN
Changes since 1.15: +12 -80 lines
Diff to previous 1.15 (colored)

Consolidated all err/warnings into mdoc.c via libmdoc.h.

Revision 1.15 / (download) - annotate - [select for diffs], Mon Jul 6 09:21:24 2009 UTC (11 years, 1 month ago) by kristaps
Branch: MAIN
Changes since 1.14: +3 -3 lines
Diff to previous 1.14 (colored)

Initial removal of enum mdoc_warn from mdoc warnings (unnecessary complication).

Revision 1.14 / (download) - annotate - [select for diffs], Wed Jun 17 19:02:26 2009 UTC (11 years, 1 month ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_7_22, VERSION_1_7_21, VERSION_1_7_20, VERSION_1_7_19
Changes since 1.13: +1 -3 lines
Diff to previous 1.13 (colored)

Removed superfluous FIXMEs (fixed already).

Revision 1.13 / (download) - annotate - [select for diffs], Tue Jun 16 19:45:51 2009 UTC (11 years, 1 month ago) by kristaps
Branch: MAIN
Changes since 1.12: +2 -3 lines
Diff to previous 1.12 (colored)

Removed MDOC___: moved MDOC_Ap to its index (comments not passed into mdoc parser).

Revision 1.12 / (download) - annotate - [select for diffs], Fri Jun 12 09:18:00 2009 UTC (11 years, 1 month ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_7_17, VERSION_1_7_16, VERSION_1_7_15
Changes since 1.11: +9 -5 lines
Diff to previous 1.11 (colored)

`Lk' is correctly handled as CALLABLE (note groff munges nested output).
`Mt' is now CALLABLE.
Fixed missing validate/action of zero-element, non-called inline elements.
Fixed missing validate/action of nested inline element re-calls.
Fixed bogus column argv index in validator.

Revision 1.11 / (download) - annotate - [select for diffs], Thu Jun 11 20:02:37 2009 UTC (11 years, 1 month ago) by kristaps
Branch: MAIN
Changes since 1.10: +4 -4 lines
Diff to previous 1.10 (colored)

`Ft' and `Ms' are now callable and compat-noted in mdoc.7 (joerg@netbsd.org).

Revision 1.10 / (download) - annotate - [select for diffs], Thu Jun 11 19:56:14 2009 UTC (11 years, 1 month ago) by kristaps
Branch: MAIN
Changes since 1.9: +2 -2 lines
Diff to previous 1.9 (colored)

`An' now callable, historic use noted in mdoc.7 (joerg@netbsd.org).

Revision 1.9 / (download) - annotate - [select for diffs], Wed Jun 10 20:18:43 2009 UTC (11 years, 1 month ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_7_14
Changes since 1.8: +2 -2 lines
Diff to previous 1.8 (colored)

Fixed license email address.

Revision 1.8 / (download) - annotate - [select for diffs], Sun Apr 12 19:45:26 2009 UTC (11 years, 3 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_7_13
Changes since 1.7: +10 -12 lines
Diff to previous 1.7 (colored)

Using proper license template (const).

Revision 1.7 / (download) - annotate - [select for diffs], Sun Apr 12 19:19:57 2009 UTC (11 years, 3 months ago) by kristaps
Branch: MAIN
Changes since 1.6: +7 -3 lines
Diff to previous 1.6 (colored)

Manual .Dt fields CAPITALISED.
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.

Revision 1.6 / (download) - annotate - [select for diffs], Thu Apr 2 06:51:44 2009 UTC (11 years, 4 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_7_12, VERSION_1_7_10, OPENBSD_CHECKIN
Changes since 1.5: +3 -3 lines
Diff to previous 1.5 (colored)

mdoc_tokhash -> hash
Initial man hashtab (BROKEN).

Revision 1.5 / (download) - annotate - [select for diffs], Tue Mar 31 13:50:19 2009 UTC (11 years, 4 months ago) by kristaps
Branch: MAIN
Changes since 1.4: +1 -7 lines
Diff to previous 1.4 (colored)

General clean-ups.

Revision 1.4 / (download) - annotate - [select for diffs], Fri Mar 27 14:56:15 2009 UTC (11 years, 4 months ago) by kristaps
Branch: MAIN
Changes since 1.3: +55 -12 lines
Diff to previous 1.3 (colored)

Added some new manuals (mdoc.3 mandoc_char.7).
Support for .br in libman.

Revision 1.3 / (download) - annotate - [select for diffs], Fri Mar 27 13:44:24 2009 UTC (11 years, 4 months ago) by kristaps
Branch: MAIN
Changes since 1.2: +23 -11 lines
Diff to previous 1.2 (colored)

Fixes in going over all OpenBSD manuals.

Revision 1.2 / (download) - annotate - [select for diffs], Mon Mar 23 15:41:09 2009 UTC (11 years, 4 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_7_5
Changes since 1.1: +2 -5 lines
Diff to previous 1.1 (colored)

-man linked to mandoc in documentation.

Revision 1.1 / (download) - annotate - [select for diffs], Mon Mar 23 14:22:11 2009 UTC (11 years, 4 months ago) by kristaps
Branch: MAIN

First addition of -man macro support.
Abstraction of mdoc.

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.




CVSweb