| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
struct tbl_cell. No functional change, minus 40 lines of code.
|
|
|
|
|
|
| |
* Do not print out macro names in tbl(7) data blocks.
* Like with GNU tbl, let empty tables cause a blank line.
* Avoid producing empty tables in -Tman.
|
|
|
|
|
|
| |
but stop throwing away their arguments. This fixes information loss in a
handful of Xenocara manuals, at the price of a small amount of formatting
noise creeping through.
|
|
|
|
| |
and reduces groff/mandoc differences in OpenBSD base by about 1%
|
| |
|
|
|
|
|
|
| |
* add missing forward declarations
* remove needless header inclusions
* some style unification
|
| |
|
|
|
|
|
|
|
| |
* drop trivial wrapper function roff_openeqn()
* drop unused first arg of function eqn_alloc()
* drop usused member "name" of struct eqn_node
While here, sync to OpenBSD by killing some trailing blanks.
|
|
|
|
|
|
|
|
| |
Put the steering into the roff parser rather than into the mdoc
parser such that it works for all macro languages and on both text
and macro lines.
Line breaks and blank characters generated before and after in-line
equations are not perfect yet, but let's do one thing at a time.
|
|
|
|
|
| |
remove trailing whitespace and blanks before tabs, improve some indenting;
no functional change
|
|
|
|
|
|
|
| |
1) This struct almost exclusively contains the table options.
2) Information about the table as a whole is actually in "struct tbl_node".
Besides, "struct tbl" was almost impossible to search for.
So rename it to "struct tbl_opts". No functional change.
|
|
|
|
|
|
| |
This consists of a shim around the text parser that calls out to libroff
if equation components exist on the line. Right now this will do
nothing, as the equation delimiter always returns nil.
|
|
|
|
| |
somem more version notes (getting there). Have the equation nanme be captured.
|
| |
|
|
|
|
|
|
|
|
| |
CACM paper in an LR(1) parse (1 -> eqn_rewind()). Right now the code is
a little jungly, but will clear up as I consolidate parse components.
The AST structure will also be cleaned up, as right now it's pretty ad
hoc (this won't change the parse itself). I added the mandoc_strndup()
function will here.
|
|
|
|
|
|
|
| |
the proper `define' dance, which amounts to pure word-replace (you can,
say, define `foo' as `define' then define `define' as something else).
eqn.c is now ready for some semantic parsing of `box' and `eqn'
productions as defined by the grammar.
|
|
|
|
|
|
|
|
|
| |
This works by iterating over a simple list. It's a slow, auditable
early implementation. Data is read (the reading function will be
reused) then parsed, then the line re-run if remaining stuff exists.
Note this function isn't the same as mandoc_getarg(), as eqn(7) uses a
different system for reading quoted strings.
This doesn't actually use the defines.
|
|
|
|
| |
messages.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
the adding itself is implemented; equation data is not yet shown.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
generate man(7) or mdoc(7) nodes for all these spans,
not only for the last one.
Restores the horizontal lines in the cpu(4/hppa) tables.
ok kristaps@
|
|
|
|
|
|
|
| |
encountered as a line's last data cell, move into TBL_PART_CDATA mode
whilst leaving the cell's designation as TBL_DATA_NONE. When new data
arrives that's not a standalone `T}', append it to the cell contends.
Close out and warn appropriately.
|
|
|
|
|
|
|
| |
existing 'struct tbl' as 'struct tbl_node', then move all option stuff
into a 'struct tbl' in mandoc.h.
This conflicted with a structure in chars.c, which was renamed.
|
|
|
|
|
|
|
|
|
|
| |
layout for each row, including vertical spacers. One grabs the tbl_head
for a row and iterates through each entry, plugging data from the
tbl_span into the header as appropriate.
This is pulled in more or less verbatim from tbl.bsd.lv. In fact, this
is verbatim except that lists macros are made into hard-coded lists (for
compatibility, as long-ago noted by joerg@).
|
| |
|
|
|
|
|
|
| |
Add bits to remember tbl's invocation point.
Add ERROR class message if no data's in the table.
|
|
|
|
| |
roff.h interface.
|
|
|
|
| |
This completes the parsing phase of the new tbl implementation.
|
|
|
|
| |
tbl.bsd.lv, although it has been reimplemented.
|
|
|
|
| |
once per invocation.
|
|
|
|
|
|
| |
parses table data then throws it away immediately. It does not yet try
to cross-check data rows against layout or anything. This copied more
or less completely from tbl.bsd.lv.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
completely with the BSD.lv code due to performance issues and flat-out
errors.
Performance issues: functions called per character. Ugly.
Flat-out errors: disallowing "reserved" tokens as arguments to those
options accepting arguments.
Also added are two mandoc.h error codes for general tbl syntax errors
and for bad options.
|
|
|
|
|
| |
more or less copied from tbl.bsd.lv and still needs integration with the
general mandoc framework, e.g., with error messages.
|
|
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.
|