summaryrefslogtreecommitdiffstats
path: root/usr.bin/mandoc/libroff.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Cleanup, no functional change:schwarze2018-12-131-48/+0
| | | | | | | | In libroff.h, nothing was left except the eqn(7) parser interface, which isn't really part of the roff(7) parser, so rename it to eqn_parse.h. While here, move struct eqn_def to eqn.c because that's the only file using it, and let eqn_box_free() and eqn_free() handle NULL.
* Cleanup, no functional change:schwarze2018-12-131-35/+3
| | | | | Move tbl(7)-specific parser internals out of libroff.h. Move some tbl(7)-internal processing from roff.c to tbl.c.
* Simplify by creating struct roff_node syntax tree nodes for tbl(7)schwarze2017-07-081-5/+5
| | | | | | | | | | | | right from roff_parseln() rather than delegating to read.c, similar to what i just did for eqn(7). The interface function roff_span() becomes obsolete and is deleted, the former interface function roff_addtbl() becomes static, the interface functions tbl_read() and tbl_cdata() become void, and minus twelve linus of code. No functional change.
* 1. Eliminate struct eqn, instead use the existing membersschwarze2017-07-081-7/+7
| | | | | | 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.
* Complete rewrite of the lexer in a single function with four operationschwarze2017-06-261-3/+4
| | | | | | | | | | | | | | | | | | | | modes instead of four functions, resulting in considerable simplification, fifty lines less of code, fifteen fewer automatic variables, and several bug fixes, for example: 1. The delim control statement consumes exactly two bytes of input, requires no whitespace after these two bytes, and does not treat quotes in any special way. 2. If the argument of left, right, gfont, gsize, or size is defined as an alias, only the first word of the value is used as the delimiter, font name, or font size. 3. If a back, fwd, down, or up keyword is followed by another keyword instead of the required number, GNU eqn does nothing useful, but typically errors out. So no need to have special handling (with an ugly goto!) for it in mandoc. Also getting rid of one pointless static buffer and twelve redundant calls to strlcpy(3).
* In private header files, __BEGIN_DECLS and __END_DECLS are pointless.schwarze2015-11-071-4/+1
| | | | | | | | | | | | 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.
* Abolish struct tbl_head and replace it by an "int col" member inschwarze2015-01-301-3/+1
| | | | struct tbl_cell. No functional change, minus 40 lines of code.
* * Polish tbl(7) error reporting.schwarze2015-01-281-2/+2
| | | | | | * 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.
* For now, it can't be helped that mandoc tbl(7) ignores high-level macros,schwarze2015-01-281-6/+6
| | | | | | 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.
* blank lines in tables do not need special handling; simplifies codeschwarze2015-01-211-2/+2
| | | | and reduces groff/mandoc differences in base by about 1%
* simplify by getting rid of ROFF_ERR in tbl(7) parsing; no functional changeschwarze2015-01-141-3/+3
|
* header cleanup:schwarze2014-12-011-3/+3
| | | | | | * add missing forward declarations * remove needless header inclusions * some style unification
* remove unneccessary inclusion protection; ok schwarzederaadt2014-11-271-5/+1
|
* Report arguments to .EQ as an error, and simplify the code:schwarze2014-10-251-2/+2
| | | | | | * drop trivial wrapper function roff_openeqn() * drop unused first arg of function eqn_alloc() * drop usused member "name" of struct eqn_node
* Implement in-line equations, much needed by Xenocara manuals.schwarze2014-10-161-11/+15
| | | | | | | | 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.
* KNF: case (FOO): -> case FOO, remove /* LINTED */ and /* ARGSUSED */,schwarze2014-04-201-3/+3
| | | | | remove trailing whitespace and blanks before tabs, improve some indenting; no functional change
* The name "struct tbl" was badly misleading for two reasons:schwarze2013-05-311-2/+2
| | | | | | | 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.
* sync to version 1.11.5:schwarze2011-09-181-6/+22
| | | | | | | | adding an implementation of the eqn(7) language by kristaps@ So far, only .EQ/.EN blocks are handled, in-line equations are not, and rendering is not yet very pretty, but the parser is fairly complete.
* Merge version 1.11.1:schwarze2011-04-241-7/+3
| | | | | | | | | | | | | | Again lots of cleanup and maintenance work by kristaps@. - simplify error reporting: less function pointers, more mandoc_[v]msg - main: split document parsing out of main.c into read.c - roff, mdoc, man: improved recognition of control characters - roff: better handling of if/else stack overflows - roff: add some predefined strings for backward compatibility - mdoc, man: empty sections are not errors - mdoc: move delimiter handling to libmdoc - some header restructuring and some minor features and fixes This merge causes two minor regressions that i will fix in separate commits right afterwards.
* Import the foundation for eqn(7) support.schwarze2011-03-201-1/+10
| | | | | | | | Written by kristaps@. For now, i'm adding one line to each of the four frontends to just pass the input text through to the output, not yet interpreting any of then eqn keywords.
* Since tbl_data() can now produce multiple spans, let parsebuf()schwarze2011-01-251-2/+3
| | | | | | | 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@
* Merge kristaps@' cleaner tbl integration, removing mine;schwarze2011-01-041-0/+62
there are still a few bugs, but fixing these will be easier in tree.