| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Since the man(7) and roff(7) validators no longer use the parser
state flag ROFF_NOFILL, we can finally get rid of the function
man_state(), resulting in a better separation of parsing and validation.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
For example, ksh93(1) needs this for .B\n.SM.
|
|
|
|
|
| |
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.
|
|
|
|
| |
no functional change, minus two source files, minus 200 lines of code.
|
|
|
|
|
|
|
|
| |
* 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[].
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
| |
Minus 80 lines of code, no functional change.
Written on the train from Koeln to Wolfsburg returning from p2k15.
|
|
|
|
|
| |
and call them from mparse_alloc() and choose_parser(),
preparing unified allocation of struct roff_man.
|
|
|
|
|
| |
Almost completely mechanical, no functional change.
Written on the train from Exeter to London returning from p2k15.
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
1. MAN_EXPLICIT was used iff fp == blk_exp, so just test fp.
2. MAN_FSCOPED was used only for TP, so just test for TP.
3. MAN_NOCLOSE was completely unused.
No functional change.
|
|
|
|
|
|
| |
when .Os has no argument, so do the same for man(7) when .TH has less
than four arguments; there is no reason to treat both differently.
Issue found following a question from Thomas Klausner <wiz at NetBSD>.
|
| |
|
|
|
|
| |
and some cleanup; no functional change, minus 70 lines.
|
|
|
|
|
|
|
| |
the same way the mdoc(7) macros marked MDOC_JOIN do it.
In -Thtml, this removes bogus <br/> when the font macros are used
in no-fill mode; issue found by jsg@ in the Xcursor(3) SYNOPSIS.
As a bonus, this slightly reduces the size of the syntax tree.
|
|
|
|
|
|
|
|
|
| |
Drop pre-handlers, they were almost unused.
Drop the needless complexity of allowing more than one post-handler.
This saves one internal interface function, one static function, one
private struct definition, sixteen static arrays, and 45 lines of code.
No functional change.
|
| |
|
| |
|
|
|
|
| |
No functional change.
|
|
|
|
|
|
| |
removing one function argument, one function definition,
three function invocations and two pointless assert()s.
No functional change.
|
|
|
|
|
| |
remove trailing whitespace and blanks before tabs, improve some indenting;
no functional change
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
for accelerated generation of reduced-size databases.
Implement this by allowing the parsers to optionally
abort the parse sequence after the NAME section.
While here, garbage collect the unused void *arg attribute of
struct mparse and mparse_alloc() and fix some errors in mandoc(3).
This reduces the processing time of mandocdb(8) on /usr/share/man
by a factor of 2 and the database size by a factor of 4.
However, it still takes 5 times the time and 6 times the space
of makewhatis(8), so more work is clearly needed.
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
do not abort with a FATAL error, but report a report a WARNING,
remove the broken .TP from the syntax tree, and prod on.
Reported repeatedly by ports people, at least by brad@ and jeremy@.
Also fixes rendition(4) in Xenocara.
ok kristaps@
|
|
|
|
| |
found while syncing to OpenBSD
|
| |
|
|
|
|
|
| |
This is required for supporting in-line equations. While here, push
registers properly into roff and add an set/get/mod interface.
|
|
|
|
|
|
| |
make its return value boolean (we don't care about QWORD). We can move
it into mdoc_macro.c because it's basically just a wrapper around
mandoc_getarg(). Then blow away man_argv.c, which is left empty.
|
|
|
|
|
| |
ARGS_ERROR, as it is never returned by man_args(). Then clean up
invocations of man_args() to only check for ARGS_EOLN.
|
|
|
|
| |
used for `RE'.
|
|
|
|
|
| |
Don't have them do that (includes in header files = faugh), and have
individual files directly include these files.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Also convert man_vmsg to return void.
|
|
|
|
| |
shall precede outputted text (surprise!).
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
ok kristaps@
|
|
|
|
|
|
|
|
|
| |
roff_getstr() family of functions into roff.c with the "first_string"
directly in struct roff. Second, pre-process each line for reserved
words in libroff, splicing and re-running a line if it has one (this
allows defined symbols to be macros). Remove term.c's invocation of the
roff_getstrn() function. Removed function documentation in roff.3 and
added roff.7 `ds' documentation.
|
|
|
|
|
|
|
|
|
| |
passed in to libmdoc and libman.
Fix mdoc.3 and man.3 EXAMPLE sections to include regset.
Add MDOC_SYNPRETTY flag cueing front-end to nicely format certain values
as if SEC_SYNOPSIS were the current section.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
libman and libmdoc.
|
|
|
|
| |
const struct regset pointer. No functionality.
|