summaryrefslogtreecommitdiffstats
path: root/tree.c
Commit message (Collapse)AuthorAgeFilesLines
* show the {MDOC,MAN}_EQN node, it contains interesting information,Ingo Schwarze2014-10-201-10/+12
| | | | | in particular line and column numbers and flags; but hide the uninteresting EQN_ROOT box
* sync Copyright years after merge to OpenBSD; no code changeIngo Schwarze2014-10-101-1/+1
|
* Make eqn(7) -Ttree output more useful:Ingo Schwarze2014-10-101-8/+27
| | | | | | | * Reduce noise by not printing default attributes. * Print missing "top" and "bottom" attributes. * Print mnemonics, not code numbers for expression positions. * Do not print unused "pile" attribute.
* Re-write of eqn(7) parser and MathML output.Kristaps Dzonsons2014-10-101-2/+7
| | | | | | | | | | This adds parser-level support for the grammar described by the eqn second-edition technical paper, "Typesetting Mathematics — User's Guide" (Kernighan, Cherry). The reason for this re-write is the grouping rules, which were not possible given the existing implementation. The re-write has also considerably simplified the HTML (and, if it ever is completed, terminal) front-end.
* Make eqn tree output a bit more useful.Kristaps Dzonsons2014-09-281-2/+2
|
* Get rid of HAVE_CONFIG_H, it is always defined; idea from libnbcompat.Ingo Schwarze2014-08-101-2/+2
| | | | | | 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.
* Change column display in -Ttree to be 1-based instead of 0-basedIngo Schwarze2014-07-021-3/+3
| | | | such that column numbers agree between messages and -Ttree.
* KNF: case (FOO): -> case FOO:, remove /* LINTED */ and /* ARGSUSED */,Ingo Schwarze2014-04-201-58/+53
| | | | | remove trailing whitespace and blanks before tabs, improve some indenting; no functional change
* To find out whether .TP head arguments are same-line or next-line arguments,Ingo Schwarze2014-03-081-2/+5
| | | | | | | | use the MAN_LINE flag instead of the man_node line member. This is required such that user-defined macros wrapping .TP work correctly. Issue found by Havard Eidnes in Tcl_NewStringObj(3), reported via the NetBSD bug tracking system and Thomas Klausner <wiz at NetBSD>.
* When deciding whether two consecutive macros are on the same input line,Ingo Schwarze2013-12-241-1/+5
| | | | | | | | 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.
* For some mdoc(7) macros, it is (unfortunately) semantically significantIngo Schwarze2013-09-151-2/+5
| | | | | | whether they are the first macro on the line or called by another macro. To help debugging, indicate this property "first macro on a new input line" by prefixing an asterisk to the line number in -Ttree output.
* Remove the variable sz because it's invariantly == 0,Ingo Schwarze2013-05-181-7/+2
| | | | | | | | | along with the dead code testing whether it's positive. Reported by Ulrich Spoerlein <uqs@spoerlein.net>, found by Coverity Scan CID 975717. While here, remove the now unused **params array as well, which Coverity apparently missed, at least it wasn't reported...
* forgotten Copyright bumps; no code changeIngo Schwarze2011-09-181-1/+1
| | | | found while syncing to OpenBSD
* Add matrix support. Also remove "above" notion, as all elements in aKristaps Dzonsons2011-07-231-22/+17
| | | | list are delimited by their "aboveness" and it's superfluous.
* Give lists their own eqn function.Kristaps Dzonsons2011-07-221-0/+9
|
* Complete eqn.7 parsing. Features all productions from the original 1975Kristaps Dzonsons2011-07-211-4/+7
| | | | | | | | 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.
* Support `size' constructs in eqn.7. Generalise mandoc_strontou to thisKristaps Dzonsons2011-07-211-3/+7
| | | | effect.
* Full support for eqn positionals (above, over, sup, sub, etc.).Kristaps Dzonsons2011-07-211-6/+6
|
* Add eqn subexpression fonts.Kristaps Dzonsons2011-07-211-3/+6
|
* Add support for markers. These decorate the last box: see eqn.7.Kristaps Dzonsons2011-07-211-3/+3
|
* Support nested `{, }' subexpressions in eqn. Document in code.Kristaps Dzonsons2011-07-211-3/+8
|
* Flip eqn into using parsed nodes. I've temporarily disabled printingKristaps Dzonsons2011-07-211-24/+44
| | | | | | | these in the front-ends except for -Ttree, which will display the parsed tree. While here, fix that quoted strings aren't scanned for replacement parts.
* Add MAN_TAIL, which will be used by `UE' (forthcoming) and needs to beKristaps Dzonsons2011-03-231-0/+5
| | | | used for `RE'.
* Allow -man to process EQN as well. Also fix a segfault in missing caseKristaps Dzonsons2011-02-091-1/+1
| | | | statements in the post-handler for EQN in -mdoc and -man.
* Allow EQN data to be pushed down into libmdoc via mdoc_addeqn(). OnlyKristaps Dzonsons2011-02-091-1/+1
| | | | the adding itself is implemented; equation data is not yet shown.
* Let the line-number of a tbl_span be remembered.Kristaps Dzonsons2011-02-061-4/+3
|
* Add initial libmdoc and libman top-most machinery for accepting TBLKristaps Dzonsons2011-02-061-0/+12
| | | | | directives. For now this will just ignore them (except for -Ttree, which just notes that an EQN's been accepted).
* First, make extra data cells be thrown away. This makes "dp->layout"Kristaps Dzonsons2011-01-101-1/+6
| | | | | | | | | | | | always hold, which cleans up the table stuff a bit. Second, set a "spans" value per data cell consisting of the number of skipped TBL_CELL_SPAN layout cells. Third, make tbl_term.c understand how to skip over spanned sections when iterating over the header queue. What remains is to calculate the widths of spanned cells.
* Make width calculations occur within tbl_term.c, not tbl.c. This allowsKristaps Dzonsons2011-01-031-13/+0
| | | | | | | | | | | | | | | | for front-ends to make decisions about widths, not the back-end. To pull this off, first make each tbl_head contain a unique index value (0 <= index < total tbl_head elements) and remove the tbl_calc() routine from the back-end. Then, when encountering the first tbl_span in the front-end, dynamically create an array of configurations (termp_tbl) keyed on each tbl_head's unique index value. Construct the decimals and widths at this time, then continue parsing as before. The termp_tbl and indexes are required because we pass a const tbl AST into the front-end.
* Fix table to print nicely (merging error). Also have -Ttree push out someKristaps Dzonsons2011-01-021-11/+28
| | | | header stuff.
* Add a warning if a data cell has no layout. Also make -Ttree show thisKristaps Dzonsons2011-01-011-1/+1
| | | | with a little star next to the entry (yeah, this is mostly for testing).
* Make some bit-flags into enums as they should be. Make printing of -TtreeKristaps Dzonsons2011-01-011-15/+43
| | | | tables a little bit smarter.
* Make -Ttree a bit more readable.Kristaps Dzonsons2011-01-011-1/+2
|
* Make -Ttree spit out table columns.Kristaps Dzonsons2011-01-011-19/+47
| | | | Add forgotten assignment of span to -man's TBL nodes.
* Add basic -Ttree support for tables.Kristaps Dzonsons2011-01-011-0/+12
|
* Re-constitution of `ds' symbol processing. First, push theKristaps Dzonsons2010-07-071-1/+0
| | | | | | | | | 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.
* Support for badly nested blocks, written around the time ofIngo Schwarze2010-06-291-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | 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@
* Churn-ish check-in getting mdoc_parseln() and man_parseln() to accept aKristaps Dzonsons2010-06-261-0/+1
| | | | const struct regset pointer. No functionality.
* Churn as I finish email address migration kth.se -> bsd.lv.Kristaps Dzonsons2010-06-191-1/+1
|
* Enable the unified error/warning enumeration in mandoc.h that'sKristaps Dzonsons2010-05-171-0/+1
| | | | | | | | | | | 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.
* Big check-in of compatibility layer. This should work on most major ↵Kristaps Dzonsons2010-01-011-0/+4
| | | | architectures. Thanks to Joerg Sonnenberger.
* More lint fixes.Kristaps Dzonsons2009-10-301-1/+0
| | | | Removed err.h from inclusions (less main.c--still in progress).
* Added time.h to various files for FreeBSD compilation (thanks Ulrich Sporlein).Kristaps Dzonsons2009-10-261-0/+1
|
* Moved output definitions into main.h.Kristaps Dzonsons2009-10-131-0/+1
| | | | Pushed terminal_{mdoc,man} into {mdoc,man}_term.c.
* Made tree/term/out() functions return void.Kristaps Dzonsons2009-09-161-4/+2
| | | | Put err() functions back into front-ends (no use making it needlessly complex).
* Significant overhaul in libman. Macros are now block- and line-scoped (withKristaps Dzonsons2009-08-131-0/+15
| | | | | | | | next-line scope extensions possible). man.7 reflects block and line scoping, and also includes a REFERENCE section that will be used as a template for the big mdoc reference. Many fixes in next-line behaviour for both inline and block macros. Added some macros for compatibility (from me.7). Corrected quoted-literal handling for libman.
* Fixed license email address.Kristaps Dzonsons2009-06-101-1/+1
|
* Using proper license template (const).Kristaps Dzonsons2009-04-121-12/+10
|
* Proper resetting of memory.Kristaps Dzonsons2009-04-031-14/+20
| | | | Array boundary fixed (-W).
* -man printing linked to -Ttree.Kristaps Dzonsons2009-03-231-6/+58
|