CVS log for mandoc/roff.h

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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.76 / (download) - annotate - [select for diffs], Tue Oct 24 20:53:12 2023 UTC (5 months ago) by schwarze
Branch: MAIN
CVS Tags: HEAD
Changes since 1.75: +2 -1 lines
Diff to previous 1.75 (colored) to selected 1.72 (colored)

Implement the man(7) .MR macro, a 2023 GNU extension.
The syntax and semantics is almost identical to mdoc(7) .Xr.

This will be needed for reading the groff manual pages once our port
will be updated to 1.23, and the Linux Manual Pages Project is also
determined to start using it sooner or later.  I did not advocate for
this new macro, but since we want to remain able to read all manual
pages found in the wild, there is little choice but to support it.
At least it is easy to do, they basically copied .Xr.

Revision 1.75 / (download) - annotate - [select for diffs], Sat Apr 30 15:09:26 2022 UTC (22 months, 4 weeks ago) by schwarze
Branch: MAIN
Changes since 1.74: +13 -13 lines
Diff to previous 1.74 (colored) to selected 1.72 (colored)

Add comments to some of the enum roff_tok values;
particularly useful for values that have non-obvious semantics
like ROFF_MAX, ROFF_cblock, ROFF_RENAMED, and TOKEN_NONE;
no code change.

Revision 1.74 / (download) - annotate - [select for diffs], Wed Apr 8 11:56:03 2020 UTC (3 years, 11 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_6
Changes since 1.73: +2 -1 lines
Diff to previous 1.73 (colored) to selected 1.72 (colored)

Use a separate node->tag attribute rather than abusing the node->string
attribute for the purpose.  No functional change intended.
The purpose is to make it possible to later attach tags to text nodes.

Revision 1.73 / (download) - annotate - [select for diffs], Mon Apr 6 10:16:18 2020 UTC (3 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.72: +3 -2 lines
Diff to previous 1.72 (colored)

Support manual tagging of .Pp, .Bd, .D1, .Dl, .Bl, and .It.
In HTML output, improve the logic for writing inside permalinks:
skip them when there is no child content or when there is a risk
that the children might contain flow content.

Revision 1.72 / (download) - annotate - [selected], Thu Feb 27 21:43:45 2020 UTC (4 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.71: +3 -1 lines
Diff to previous 1.71 (colored)

Fully support explicit tagging of .Sh and .Ss.
This fixes the offset of two lines in terminal output
and this improves HTML output by putting the id= attribute
and <a> element into the respective <h1> or <h2> element rather
than writing an additional <mark> element.

To that end, introduce node flags NODE_ID (to make the node a link
target, for example by writing an HTML id= attribute or by calling
tag_put()) and NODE_HREF (to make the node a link source, used only
in HTML output, used only to write an <a class="permalink"> element).

In particular:
* In the validator, generalize the concept of the "next node"
such that it also works before .Sh and .Ss.
* If the first argument of .Tg is empty, don't forget to complain
if there are additional arguments, which will be ignored.
* In the terminal formatter, support writing of explicit tags
for all kinds of nodes, not just for .Tg.
* In deroff(), allow nodes to have an explicit string representation
even when they aren't text nodes.  Use this for explicitly tagged
section headers.  Suprisingly, this is sufficient to make HTML
output work, without explicit code changes in the HTML formatter.
* In syntax tree output, display NODE_ID and NODE_HREF.

Revision 1.71 / (download) - annotate - [select for diffs], Thu Feb 27 01:43:52 2020 UTC (4 years, 1 month ago) by schwarze
Branch: MAIN
Changes since 1.70: +7 -3 lines
Diff to previous 1.70 (colored) to selected 1.72 (colored)

Introduce the concept of nodes that are semantically transparent:
they are skipped when looking for previous or following high-level
macros.  Examples include roff(7) .ft, .ll, and .ta, mdoc(7) .Sm
and .Tg, and man(7) .DT and .PD.  Use this concept for a variety
of improved decisions in various validators and formatters.

While here,
* remove a few const qualifiers on struct arguments that caused trouble;
* get rid of some more Yoda notation in the vicinity;
* and apply some other stylistic improvements in the vicinity.

I found this class of issues while considering .Tg patches from kn@.

Revision 1.70 / (download) - annotate - [select for diffs], Sun Jan 19 18:02:00 2020 UTC (4 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.69: +3 -2 lines
Diff to previous 1.69 (colored) to selected 1.72 (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.69 / (download) - annotate - [select for diffs], Mon Mar 4 13:01:57 2019 UTC (5 years ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_5
Changes since 1.68: +3 -2 lines
Diff to previous 1.68 (colored) to selected 1.72 (colored)

When the -S option is given to man(1) and the requested manual page
name is not found and the requested architecture is unknown, complain
about the architecture rather than about the manual page name:

$ man -S vax cpu
man: Unknown architecture "vax".
$ man -S sparc64 foobar
man: No entry for foobar in the manual.

Friendlier error message suggested by jmc@, who also OK'ed the patch.

Revision 1.68 / (download) - annotate - [select for diffs], Mon Dec 31 08:18:12 2018 UTC (5 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.67: +9 -8 lines
Diff to previous 1.67 (colored) to selected 1.72 (colored)

Store the fill mode with a new flag NODE_NOFILL in every node,
like it is already done with NODE_SYNPRETTY, such that the fill
mode becomes more directly available to the formatters.
Not used yet, but will be used by upcoming commits.

Revision 1.67 / (download) - annotate - [select for diffs], Mon Dec 31 07:08:12 2018 UTC (5 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.66: +3 -5 lines
Diff to previous 1.66 (colored) to selected 1.72 (colored)

Move parsing of the .nf and .fi (fill mode) requests from the man(7)
parser to the roff(7) parser.  As a side effect, .nf and .fi are
now also parsed in mdoc(7) input, though the mdoc(7) formatters
still ignore most of their effect.

Revision 1.66 / (download) - annotate - [select for diffs], Sun Dec 30 00:49:56 2018 UTC (5 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.65: +5 -40 lines
Diff to previous 1.65 (colored) to selected 1.72 (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.65 / (download) - annotate - [select for diffs], Fri Dec 14 06:33:14 2018 UTC (5 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.64: +1 -2 lines
Diff to previous 1.64 (colored) to selected 1.72 (colored)

Cleanup, no functional change:
Now that message handling is properly encapsulated,
remove struct mparse pointers from four structs (roff, roff_man,
tbl_node, eqn_node) and from the argument lists of five functions
(roff_alloc, roff_man_alloc, mandoc_getarg, tbl_alloc, eqn_alloc).
Except for being passed to the main program as an opaque object,
it now only occurs in read.c, as it should, and not across 15 files
like in the past.

Revision 1.64 / (download) - annotate - [select for diffs], Thu Dec 13 11:55:47 2018 UTC (5 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.63: +7 -1 lines
Diff to previous 1.63 (colored) to selected 1.72 (colored)

Cleanup, no functional change:
Split the top level parser interface out of the utility header
mandoc.h, into a new header mandoc_parse.h, for use in the main
program and in the main parser only.
Move enum mandoc_os into roff.h because struct roff_man is the
place where it is stored.
This allows removal of mandoc.h from seven files in low-level
parsers and in formatters.

Revision 1.63 / (download) - annotate - [select for diffs], Thu Dec 13 06:18:20 2018 UTC (5 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.62: +3 -4 lines
Diff to previous 1.62 (colored) to selected 1.72 (colored)

Cleanup, no functional change:
Move the roffhash_*() functions from roff.h to roff_int.h
because they are only intended for use by parsers,
neither by main programs nor by formatters.

Revision 1.62 / (download) - annotate - [select for diffs], Thu Dec 13 02:06:07 2018 UTC (5 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.61: +2 -2 lines
Diff to previous 1.61 (colored) to selected 1.72 (colored)

Cleanup, no functional change:
Move tbl(7)-specific parser internals out of libroff.h.
Move some tbl(7)-internal processing from roff.c to tbl.c.

Revision 1.61 / (download) - annotate - [select for diffs], Sat Aug 18 02:08:27 2018 UTC (5 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.60: +4 -2 lines
Diff to previous 1.60 (colored) to selected 1.72 (colored)

implement the GNU man-ext .SY/.YS (synopsis block) macro in man(7),
used in most manual pages of the groff package

Revision 1.60 / (download) - annotate - [select for diffs], Thu Aug 16 23:43:37 2018 UTC (5 years, 7 months ago) by schwarze
Branch: MAIN
Changes since 1.59: +2 -1 lines
Diff to previous 1.59 (colored) to selected 1.72 (colored)

implement the GNU man-ext .TQ macro in man(7),
used for example by groff_diff(7)

Revision 1.59 / (download) - annotate - [select for diffs], Wed Apr 11 17:11:13 2018 UTC (5 years, 11 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_4
Changes since 1.58: +2 -1 lines
Diff to previous 1.58 (colored) to selected 1.72 (colored)

preserve comments before .Dd when converting mdoc(7) to man(7)
with mandoc -Tman; suggested by Thomas Klausner <wiz at NetBSD>

Revision 1.58 / (download) - annotate - [select for diffs], Sat Jul 8 14:51:05 2017 UTC (6 years, 8 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_3, VERSION_1_14_2
Changes since 1.57: +2 -2 lines
Diff to previous 1.57 (colored) to selected 1.72 (colored)

1. Eliminate struct eqn, instead use the existing members
of struct roff_node which is allocated for each equation anyway.
2. Do not keep a list of equation parsers, one parser is enough.
Minus fifty lines of code, no functional change.

Revision 1.57 / (download) - annotate - [select for diffs], Sun Jun 25 11:42:02 2017 UTC (6 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.56: +3 -1 lines
Diff to previous 1.56 (colored) to selected 1.72 (colored)

add support for the MT and ME mailto macros, used for example in wg(8);
patch from bentley@

Revision 1.56 / (download) - annotate - [select for diffs], Sat Jun 24 14:38:33 2017 UTC (6 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.55: +4 -10 lines
Diff to previous 1.55 (colored) to selected 1.72 (colored)

Split -Wstyle into -Wstyle and the even lower -Wbase, and add
-Wopenbsd and -Wnetbsd to check conventions for the base system of
a specific operating system.  Mark operating system specific messages
with "(OpenBSD)" at the end.

Please use just "-Tlint" to check base system manuals (defaulting
to -Wall, which is now -Wbase), but prefer "-Tlint -Wstyle" for the
manuals of portable software projects you maintain that are not
part of OpenBSD base, to avoid bogus recommendations about base
system conventions that do not apply.

Issue originally reported by semarie@, solution using
an idea from tedu@, discussed with jmc@ and jca@.

Revision 1.55 / (download) - annotate - [select for diffs], Sat Jun 17 22:43:15 2017 UTC (6 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.54: +2 -1 lines
Diff to previous 1.54 (colored) to selected 1.72 (colored)

style message about missing RCS ids; inspired by mdoclint

Revision 1.54 / (download) - annotate - [select for diffs], Wed Jun 14 22:51:25 2017 UTC (6 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.53: +2 -2 lines
Diff to previous 1.53 (colored) to selected 1.72 (colored)

Naive implementation of the roff(7) .po (page offset) request.

This clearly works when .po is called on the top level, but might
not be sophisticated enough if people call .po inside indentation-changing
contexts, but i haven't seen that in manual pages (yet :).

Revision 1.53 / (download) - annotate - [select for diffs], Wed Jun 14 13:00:31 2017 UTC (6 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.52: +2 -2 lines
Diff to previous 1.52 (colored) to selected 1.72 (colored)

implement roff(7) .rj (right justify) request

Revision 1.52 / (download) - annotate - [select for diffs], Wed Jun 7 23:29:49 2017 UTC (6 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.51: +8 -1 lines
Diff to previous 1.51 (colored) to selected 1.72 (colored)

style checks related to .Er; inspired by mdoclint(1)

Revision 1.51 / (download) - annotate - [select for diffs], Wed Jun 7 00:50:34 2017 UTC (6 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.50: +2 -1 lines
Diff to previous 1.50 (colored) to selected 1.72 (colored)

Implement the roff(7) .rn (rename macro or string) request.
Renaming a user-defined macro is very simple: just copy
the definition to the new name and delete the old name.
Renaming high-level macros is a bit tricky: use a dedicated
key-value-table, with non-standard names as keys and standard
names as values.  When a macro is found that is not user-defined,
look it up in the "renamed" table and translate it back to the
standard name before passing it on to the high-level parsers.

Revision 1.50 / (download) - annotate - [select for diffs], Tue Jun 6 15:01:04 2017 UTC (6 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.49: +2 -2 lines
Diff to previous 1.49 (colored) to selected 1.72 (colored)

Minimal implementation of the roff(7) .ce request (center a number
of input lines without filling).
Contrary to groff, high-level macros abort .ce mode for now.

Revision 1.49 / (download) - annotate - [select for diffs], Sun Jun 4 22:44:15 2017 UTC (6 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.48: +2 -2 lines
Diff to previous 1.48 (colored) to selected 1.72 (colored)

Implement the roff(7) .mc (right margin character) request.
The Tcl/Tk manual pages use this extensively.
Delete the TERM_MAXMARGIN hack, it breaks .mc inside .nf;
instead, implement a proper TERMP_BRNEVER flag.

Revision 1.48 / (download) - annotate - [select for diffs], Mon May 8 15:34:54 2017 UTC (6 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.47: +2 -2 lines
Diff to previous 1.47 (colored) to selected 1.72 (colored)

Basic implementation of the roff(7) .ti (temporary indent) request.
Needed by about four dozen ports (thanks to naddy@ for the research).

Revision 1.47 / (download) - annotate - [select for diffs], Sun May 7 17:31:45 2017 UTC (6 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.46: +2 -2 lines
Diff to previous 1.46 (colored) to selected 1.72 (colored)

Basic implementation of the roff(7) .ta (define tab stops) request.
This is the first feature made possible by the parser reorganization.
Improves the formatting of the SYNOPSIS in many Xenocara GL manuals.
Also important for ports, as reported by many, including naddy@.

Revision 1.46 / (download) - annotate - [select for diffs], Fri May 5 15:17:32 2017 UTC (6 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.45: +2 -4 lines
Diff to previous 1.45 (colored) to selected 1.72 (colored)

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

Revision 1.45 / (download) - annotate - [select for diffs], Fri May 5 13:17:55 2017 UTC (6 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.44: +2 -4 lines
Diff to previous 1.44 (colored) to selected 1.72 (colored)

move .ll to the roff modules

Revision 1.44 / (download) - annotate - [select for diffs], Fri May 5 02:06:19 2017 UTC (6 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.43: +3 -3 lines
Diff to previous 1.43 (colored) to selected 1.72 (colored)

Move handling of the roff(7) .ft request from the man(7)
modules to the new roff(7) modules.  As a side effect,
mdoc(7) now handles .ft, too.  Of course, do not use that.

Revision 1.43 / (download) - annotate - [select for diffs], Thu May 4 17:48:29 2017 UTC (6 years, 10 months ago) by schwarze
Branch: MAIN
Changes since 1.42: +4 -5 lines
Diff to previous 1.42 (colored) to selected 1.72 (colored)

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

Revision 1.42 / (download) - annotate - [select for diffs], Sat Apr 29 12:45:42 2017 UTC (6 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.41: +8 -1 lines
Diff to previous 1.41 (colored) to selected 1.72 (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.41 / (download) - annotate - [select for diffs], Mon Apr 24 23:06:18 2017 UTC (6 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.40: +413 -3 lines
Diff to previous 1.40 (colored) to selected 1.72 (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.40 / (download) - annotate - [select for diffs], Thu Feb 16 03:00:23 2017 UTC (7 years, 1 month ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_1, VERSION_1_13
Changes since 1.39: +2 -3 lines
Diff to previous 1.39 (colored) to selected 1.72 (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.39 / (download) - annotate - [select for diffs], Tue Jan 10 13:47:00 2017 UTC (7 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.38: +9 -12 lines
Diff to previous 1.38 (colored) to selected 1.72 (colored)

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

Revision 1.38 / (download) - annotate - [select for diffs], Tue Jan 10 12:53:08 2017 UTC (7 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.37: +4 -2 lines
Diff to previous 1.37 (colored) to selected 1.72 (colored)

Introduce flags NODE_NOSRC and NODE_NOPRT for AST nodes.
Use them to mark generated nodes and nodes that shall not produce output.
Let -Ttree output mode display these new flags.
Use NODE_NOSRC for .Ar, .Mt, and .Pa default arguments.
Use NODE_NOPRT for .Dd, .Dt, and .Os.

These will help to make handling of text production macros more rigorous.

Revision 1.37 / (download) - annotate - [select for diffs], Fri Jan 8 17:48:10 2016 UTC (8 years, 2 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_13_4
Changes since 1.36: +0 -1 lines
Diff to previous 1.36 (colored) to selected 1.72 (colored)

Delete the redundant "nchild" member of struct roff_node, replacing
most uses by one, a few by two pointer checks, and only one by a
tiny loop - not only making data smaller, but code shorter as well.

This gets rid of an implicit invariant that confused both static
analysis tools and human auditors.  No functional change.

Revision 1.36 / (download) - annotate - [select for diffs], Sat Nov 7 14:01:16 2015 UTC (8 years, 4 months ago) by schwarze
Branch: MAIN
Changes since 1.35: +0 -3 lines
Diff to previous 1.35 (colored) to selected 1.72 (colored)

In private header files, __BEGIN_DECLS and __END_DECLS are pointless.
Because these work slightly differently on different systems,
they are becoming a maintenance burden in the portable version,
so delete them.

Besides, one of the chief design goals of the mandoc toolbox is to
make sure that nothing related to documentation requires C++.
Consequently, linking mandoc against any kind of C++ program would
defeat the purpose and is not supported.
I don't understand why kristaps@ added them in the first place.

Revision 1.35 / (download) - annotate - [select for diffs], Sat Oct 17 00:21:07 2015 UTC (8 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.34: +5 -2 lines
Diff to previous 1.34 (colored) to selected 1.72 (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.34 / (download) - annotate - [select for diffs], Thu Apr 23 16:17:44 2015 UTC (8 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.33: +6 -0 lines
Diff to previous 1.33 (colored) to selected 1.72 (colored)

Unify mdoc_deroff() and man_deroff() into a common function deroff().
No functional change except that for mdoc(7), it now skips leading
escape sequences just like it already did for man(7).
Escape sequences rarely occur in mdoc(7) code and if they do,
skipping them is an improvement in this context.
Minus 30 lines of code.

Revision 1.33 / (download) - annotate - [select for diffs], Sun Apr 19 14:00:20 2015 UTC (8 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.32: +1 -0 lines
Diff to previous 1.32 (colored) to selected 1.72 (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.32 / (download) - annotate - [select for diffs], Sat Apr 18 16:34:25 2015 UTC (8 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.31: +7 -0 lines
Diff to previous 1.31 (colored) to selected 1.72 (colored)

Profit from the unified struct roff_man and reduce the number of
arguments of mparse_result() by one.  No functional change.
Written on the ICE Bruxelles-Koeln on the way back from p2k15.

Revision 1.31 / (download) - annotate - [select for diffs], Sat Apr 18 16:06:41 2015 UTC (8 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.30: +35 -1 lines
Diff to previous 1.30 (colored) to selected 1.72 (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.30 / (download) - annotate - [select for diffs], Thu Apr 2 23:48:20 2015 UTC (8 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.29: +11 -0 lines
Diff to previous 1.29 (colored) to selected 1.72 (colored)

Third step towards parser unification:
Replace struct mdoc_meta and struct man_meta by a unified struct roff_meta.
Written of the train from London to Exeter on the way to p2k15.

Revision 1.29 / (download) - annotate - [select for diffs], Thu Apr 2 22:48:18 2015 UTC (8 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.28: +77 -0 lines
Diff to previous 1.28 (colored) to selected 1.72 (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.28 / (download) - annotate - [select for diffs], Thu Apr 2 21:36:51 2015 UTC (8 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.27: +16 -11 lines
Diff to previous 1.27 (colored) to selected 1.72 (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.27, Tue Mar 22 09:50:11 2011 UTC (13 years ago) by kristaps
Branch: MAIN
Changes since 1.26: +1 -1 lines
FILE REMOVED

Step 2: blow away roff.h, as all of its functions have been moved into
libmandoc.h and there's nothing left.

Revision 1.26 / (download) - annotate - [select for diffs], Tue Mar 22 09:48:13 2011 UTC (13 years ago) by kristaps
Branch: MAIN
Changes since 1.25: +1 -24 lines
Diff to previous 1.25 (colored) to selected 1.72 (colored)

Step 1 of restructuring: libmandoc.h.  Move all compiler-set-specific
stuff into libmandoc.h, including old mdoc.h/man.h/roff.h functions now
used by read.c.  The motivation behind this is to tighten the
relationship between the underlying compilers while keeping parse data
hidden from general callers (e.g., main.c).

While here, also move register values from mandoc.h into libmandoc.h as
noted by schwarze@.  See above for explanation.

Revision 1.25 / (download) - annotate - [select for diffs], Sun Mar 20 16:02:05 2011 UTC (13 years ago) by kristaps
Branch: MAIN
Changes since 1.24: +2 -2 lines
Diff to previous 1.24 (colored) to selected 1.72 (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.24 / (download) - annotate - [select for diffs], Wed Feb 9 09:05:52 2011 UTC (13 years, 1 month ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_10_10
Changes since 1.23: +2 -1 lines
Diff to previous 1.23 (colored) to selected 1.72 (colored)

Allow EQN data to be pushed down into libmdoc via mdoc_addeqn().  Only
the adding itself is implemented; equation data is not yet shown.

Revision 1.23 / (download) - annotate - [select for diffs], Sun Feb 6 20:36:36 2011 UTC (13 years, 1 month ago) by kristaps
Branch: MAIN
Changes since 1.22: +2 -1 lines
Diff to previous 1.22 (colored) to selected 1.72 (colored)

Add initial EQN support to mandoc.  This parses, then throws away, data
between EQ and EN roff blocks.  EQN is different from TBL in that data
after .EQ is unilaterally considered an equation until an .EN.  Thus,
there's no need to jump through hoops in having table spans and so on.
This is ONLY the parse code framework in libroff.  EQN is not yet passed
into the backends.

Revision 1.22 / (download) - annotate - [select for diffs], Sat Jan 1 16:18:39 2011 UTC (13 years, 2 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_10_9
Changes since 1.21: +2 -2 lines
Diff to previous 1.21 (colored) to selected 1.72 (colored)

More checks for proper table exit.

Revision 1.21 / (download) - annotate - [select for diffs], Fri Dec 31 18:19:43 2010 UTC (13 years, 2 months ago) by kristaps
Branch: MAIN
Changes since 1.20: +2 -1 lines
Diff to previous 1.20 (colored) to selected 1.72 (colored)

Expose the parsed table API to the world and add accessors through the
roff.h interface.

Revision 1.20 / (download) - annotate - [select for diffs], Tue Dec 28 10:51:03 2010 UTC (13 years, 3 months ago) by kristaps
Branch: MAIN
Changes since 1.19: +2 -1 lines
Diff to previous 1.19 (colored) to selected 1.72 (colored)

Initial tbl framework.  Parse point is in libroff, which keeps a
reference to a current tbl parse and routes ALL text into the tbl parse
after stripping reserved words and making block-level pre-processing
(e.g., `ig').  This is consistent with an analysis of embedded `TS/TE'
in manuals with sprinkled -mdoc, roff, and -man macros.

Fact of a parse is exposed to main.c by a return value (ROFF_TBL), which
will trigger main.c to add a foreign parsed body to the -mdoc or -man
parse stream.  This interface isn't in yet, but will follow the
parse-text functions in both libraries.  I put this login in main.c
because I don't want libroff calling directly into libmdoc or libman.

As a consequence, a parsed row can be pushed directly into any -mdoc or
-man context (put a `Bd -literal -offset indent' into a `TE/TS' block to
see why this is necessary).  It will then absorb formatting cues in the
front-ends.

A note on naming.  I decided on libroff.h instead of tbl.h because this
is purely within the roff layer.  Separate tbl implementations will
need, then, to interface with libroff.  This is "how it should be"
because tbl is tightly linked with roff in terms of `ds' and other
formatting macros, as well as, of course, special characters and other
roffisms.

Revision 1.19 / (download) - annotate - [select for diffs], Wed Dec 1 15:09:01 2010 UTC (13 years, 3 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_10_8, VERSION_1_10_7
Changes since 1.18: +4 -1 lines
Diff to previous 1.18 (colored) to selected 1.72 (colored)

Merge restructuring of main.c code.  This provided by schwarze@ and inspected
carefully by joerg@.  Merge roff.h header for compilation's sake (this is not
yet implemented in roff.c.).

THIS IS A BUGGY CHECK-IN.  The manual type is erroneously kept between runs
of the compiler.  This is a known bug.

Revision 1.18 / (download) - annotate - [select for diffs], Fri Aug 20 01:02:07 2010 UTC (13 years, 7 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_10_6
Changes since 1.17: +2 -2 lines
Diff to previous 1.17 (colored) to selected 1.72 (colored)

Implement a simple, consistent user interface for error handling.
We now have sufficient practical experience to know what we want,
so this is intended to be final:
- provide -Wlevel (warning, error or fatal) to select what you care about
- provide -Wstop to stop after parsing a file with warnings you care about
- provide consistent exit status codes for those warnings you care about
- fully document what warnings, errors and fatal errors mean
- remove all other cruft from the user interface, less is more:
- remove all -f knobs along with the whole -f option
- remove the old -Werror because calling warnings "fatal" is silly
- always finish parsing each file, unless fatal errors prevent that
This commit also includes a couple of related simplifications behind
the scenes regarding error handling.
Feedback and OK  kristaps@;  Joerg Sonnenberger (NetBSD) and
Sascha Wildner (DragonFly BSD) agree with the general direction.

Revision 1.17 / (download) - annotate - [select for diffs], Sun Jun 27 15:52:41 2010 UTC (13 years, 9 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_10_5_PREPDF, VERSION_1_10_5, VERSION_1_10_4, VERSION_1_10_3
Changes since 1.16: +4 -4 lines
Diff to previous 1.16 (colored) to selected 1.72 (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.16 / (download) - annotate - [select for diffs], Sat Jun 26 15:22:19 2010 UTC (13 years, 9 months ago) by kristaps
Branch: MAIN
Changes since 1.15: +3 -3 lines
Diff to previous 1.15 (colored) to selected 1.72 (colored)

First step of adding register support.  This is inspired by a significant
patch by schwarze@.  This commit adds support to libroff parsing `nr'
into register set defined in regs.h.  This will propogate into libmdoc
and libman in later commits.

Revision 1.15 / (download) - annotate - [select for diffs], Mon May 17 00:06:36 2010 UTC (13 years, 10 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_10_2, VERSION_1_10_1
Changes since 1.14: +2 -2 lines
Diff to previous 1.14 (colored) to selected 1.72 (colored)

libroff now is aware of which sub-nodes should be interpreted even in a
conditional-negative context so as to preserve structural integrity.
Initial "rules" (deny/allow) are now inherited for future work in
evaluating conditionals.

Lint-fix noted by Joerg.

Added regression tests for zany constructs.

Revision 1.14 / (download) - annotate - [select for diffs], Sun May 16 10:59:36 2010 UTC (13 years, 10 months ago) by kristaps
Branch: MAIN
Changes since 1.13: +7 -5 lines
Diff to previous 1.13 (colored) to selected 1.72 (colored)

Allow roff_parseln() to be re-run.
Allow roff_parseln() to manipulate the line buffer offset.  This is used
in situations like `.ie n .TH FOO 1' or `.ie n .ie n', where the line
buffer offset is recalculated then the roff parser re-run.
Fix mdoc_parseln() and man_parseln() to accept the initial line offset.
WARNING: backed-out ALL roff macros whilst accomodating for how roff
handles multi-line conditionals (in short, re-running the parser).

Revision 1.13 / (download) - annotate - [select for diffs], Sat May 15 18:35:14 2010 UTC (13 years, 10 months ago) by kristaps
Branch: MAIN
Changes since 1.12: +6 -6 lines
Diff to previous 1.12 (colored) to selected 1.72 (colored)

Add mandoc.h, which will eventually replace compilers' inner enum errors with unified ones.
Add initial roff pre-processor shim, a compiler sitting outside of the other compilers that processes pure roff instructions.

Revision 1.12 / (download) - annotate - [select for diffs], Sat May 15 07:52:11 2010 UTC (13 years, 10 months ago) by kristaps
Branch: MAIN
Changes since 1.11: +21 -285 lines
Diff to previous 1.11 (colored) to selected 1.72 (colored)

Initial roff shim skeleton in place.

Revision 1.11, Mon Dec 15 02:29:44 2008 UTC (15 years, 3 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_9_5, VERSION_1_8_5, VERSION_1_8_1, VERSION_1_7_16, VERSION_1_7_15, VERSION_1_6_5, VERSION_1_5_1, VERSION_1_3_6, VERSION_1_3_15, VERSION_1_2_0, OPENBSD_CHECKIN
Changes since 1.10: +1 -1 lines
FILE REMOVED

More file pruning.

Revision 1.10 / (download) - annotate - [select for diffs], Wed Dec 10 17:31:57 2008 UTC (15 years, 3 months ago) by kristaps
Branch: MAIN
Changes since 1.9: +2 -2 lines
Diff to previous 1.9 (colored) to selected 1.72 (colored)

*** empty log message ***

Revision 1.9 / (download) - annotate - [select for diffs], Mon Dec 8 12:46:28 2008 UTC (15 years, 3 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_0_2, VERSION_1_0_1
Changes since 1.8: +137 -123 lines
Diff to previous 1.8 (colored) to selected 1.72 (colored)

Added warnings for using macros in the wrong sections.

Revision 1.8 / (download) - annotate - [select for diffs], Sun Dec 7 22:40:18 2008 UTC (15 years, 3 months ago) by kristaps
Branch: MAIN
Changes since 1.7: +2 -2 lines
Diff to previous 1.7 (colored) to selected 1.72 (colored)

*** empty log message ***

Revision 1.7 / (download) - annotate - [select for diffs], Sun Dec 7 16:41:04 2008 UTC (15 years, 3 months ago) by kristaps
Branch: MAIN
Changes since 1.6: +22 -22 lines
Diff to previous 1.6 (colored) to selected 1.72 (colored)

*** empty log message ***

Revision 1.6 / (download) - annotate - [select for diffs], Sun Dec 7 14:38:57 2008 UTC (15 years, 3 months ago) by kristaps
Branch: MAIN
Changes since 1.5: +2 -2 lines
Diff to previous 1.5 (colored) to selected 1.72 (colored)

*** empty log message ***

Revision 1.5 / (download) - annotate - [select for diffs], Sat Dec 6 21:10:31 2008 UTC (15 years, 3 months ago) by kristaps
Branch: MAIN
Changes since 1.4: +6 -6 lines
Diff to previous 1.4 (colored) to selected 1.72 (colored)

.St macros in place.

Revision 1.4 / (download) - annotate - [select for diffs], Sat Dec 6 19:41:41 2008 UTC (15 years, 3 months ago) by kristaps
Branch: MAIN
Changes since 1.3: +29 -30 lines
Diff to previous 1.3 (colored) to selected 1.72 (colored)

*** empty log message ***

Revision 1.3 / (download) - annotate - [select for diffs], Sat Dec 6 16:50:18 2008 UTC (15 years, 3 months ago) by kristaps
Branch: MAIN
Changes since 1.2: +4 -4 lines
Diff to previous 1.2 (colored) to selected 1.72 (colored)

*** empty log message ***

Revision 1.2 / (download) - annotate - [select for diffs], Sat Dec 6 13:18:44 2008 UTC (15 years, 3 months ago) by kristaps
Branch: MAIN
Changes since 1.1: +2 -2 lines
Diff to previous 1.1 (colored) to selected 1.72 (colored)

*** empty log message ***

Revision 1.1 / (download) - annotate - [select for diffs], Fri Dec 5 22:54:44 2008 UTC (15 years, 3 months ago) by kristaps
Branch: MAIN
Diff to selected 1.72 (colored)

*** empty log message ***

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