aboutsummaryrefslogtreecommitdiffstatshomepage
Commit message (Collapse)AuthorAgeFilesLines
* Support `T{' and `T}' data blocks. When a standalone `T{' isKristaps Dzonsons2011-01-048-23/+86
| | | | | | | 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.
* Have horizontal spanner not clobber pre-set width.Kristaps Dzonsons2011-01-041-2/+5
|
* Fix spacing for tables to use term_len(). Also make term.c properlyKristaps Dzonsons2011-01-043-16/+23
| | | | recode ASCII_HYPHEN and ASCII_NBRSP before passing back for widths.
* Fix to make horizontal spanners in the layout be properly printed.Kristaps Dzonsons2011-01-045-55/+71
| | | | | | | mandoc also now warns (so does tbl(1)) if a horizontal spanner is specified along with data. While here, fix up some documentation and uncomment the tbl reference.
* Protect tbl nodes from getting a post call.Kristaps Dzonsons2011-01-041-4/+11
|
* Add skeleton for -T[x]html tbl stuff. Also start to put in some bits aboutKristaps Dzonsons2011-01-046-9/+98
| | | | the up-coming version, although we're not quite there yet.
* Multiple man(7) .IP and .TP fixes started during p2k10:Ingo Schwarze2011-01-042-38/+35
| | | | | | | | | | | | | | | | | | | | | Affecting both -Tascii and -Thtml: * The .IP HEAD uses the second argument as the width, not the last one. * Only print the first .IP HEAD argument, not all but the last. Affecting only -Tascii: * The .IP and .TP HEADs must be printed without literal mode, but literal mode must be restored afterwards. * After the .IP and .TP bodies, we only want term_newln(), not term_flushln(), or we would get two blank lines in literal mode. * The .TP HEAD does not use TWOSPACE, just like .IP doesn't either. * In literal mode, clear NOLPAD after each line, or subsequent lines would get no indentation whatsoever. Affecting only -Thtml: * Only print next-line .TP children, instead of all but the first. OK kristaps@ on the -Tascii part; and: "Can you work this into man_html.c, too?"
* Partial cleanup of argument count validation in mdoc(7):Ingo Schwarze2011-01-033-70/+74
| | | | | | | | | | | | * Do not segfault on empty .Db, .Rs, .Sm, and .St. * Let check_count() really throw the requested level, not always ERROR. * Downgrade most bad argument counts from ERROR to WARNING. * And some related internal cleanup. Looks fine to kristaps@. Note that the macros using eerr_ge1() still need to be checked at a later time; but as all the others are done, let's use what we already have.
* Calling a macro with fewer arguments than it is defined with is OK;Ingo Schwarze2011-01-031-2/+2
| | | | | the remaining ones default to the empty string, not to NULL. Regression reported and fix tested by kristaps@.
* Unify roff macro argument parsing (in roff.c, roff_userdef()) and man macroIngo Schwarze2011-01-034-117/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | | argument parsing (in man_argv.c, man_args()), both having different bugs, to use one common macro argument parser (in mandoc.c, mandoc_getarg()), because from the point of view of roff, man macros are just roff macros, hence their arguments are parsed in exactly the same way. While doing so, fix these bugs: * Escaped blanks (i.e. those preceded by an odd number of backslashes) were mishandled as argument separators in unquoted arguments to user-defined roff macros. * Unescaped blanks preceded by an even number of backslashes were not recognized as argument separators in unquoted arguments to man macros. * Escaped backslashes (i.e. pairs of backslashes) were not reduced to single backslashes both in unquoted and quoted arguments both to user-defined roff macros and to man macros. * Escaped quotes (i.e. pairs of quotes inside quoted arguments) were not reduced to single quotes in man macros. OK kristaps@ Note that mdoc macro argument parsing is yet another beast for no good reason and is probably afflicted by similar bugs. But i don't attempt to fix that right now because it is intricately entangled with lots of unrelated high-level mdoc(7) functionality, like delimiter handling and column list phrase handling. Disentagling that would waste too much time now.
* Remove TODO for tbl.Kristaps Dzonsons2011-01-031-3/+1
|
* Switch on the `TS' documentation in roff.7. As per off-line discussion,Kristaps Dzonsons2011-01-032-129/+178
| | | | | | | | this may be moved to tbl.7, but for the time being, keep it in the document as it's developed. Also note that my handling of horizontal rules in layouts needs some work.
* For tbl: -man documents print an extra space before `TS' blocks.Kristaps Dzonsons2011-01-031-1/+3
|
* Add in support for number table cells that account for escapes and soKristaps Dzonsons2011-01-031-18/+29
| | | | | on. Note also that -Tps and -Tpdf, with these last two commits, produce more readable output ("less crappy").
* Clean up the tbl top-level printing code and document the parts of it.Kristaps Dzonsons2011-01-031-23/+46
|
* Start using term_strlen() instead of strlen(). tbl_term.c can nowKristaps Dzonsons2011-01-031-34/+39
| | | | | properly handle embedded escapes when calculating its widths. NOTE: this doesn't yet apply to the decimal-point calculation.
* Make width calculations occur within tbl_term.c, not tbl.c. This allowsKristaps Dzonsons2011-01-036-221/+245
| | | | | | | | | | | | | | | | 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.
* Tiny edit required after MDOC_HALT change.Kristaps Dzonsons2011-01-031-6/+1
|
* Make sure we don't continue recursively parsing once we've exited withKristaps Dzonsons2011-01-031-1/+9
| | | | | failure (this had caused some segfaults with the new assert() call in MAN_HALT and MDOC_HALT).
* Same treatment for MAN_HALT as for MDOC_HALT.Kristaps Dzonsons2011-01-032-29/+24
|
* Clarified the role of MDOC_HALT in libmdoc functions by having accessorKristaps Dzonsons2011-01-032-24/+23
| | | | | | | | | | functions assert() if they're called after MDOC_HALT is set. This makes more sense than returning 0 because this return value is used for parse errors, not programme-flow errors, and it's inconsistent to use the same value for both. Plus, prior to this, I'd return 0 without printing an error message, which would cause failure to go unreported to the operator.
* Fix table to print nicely (merging error). Also have -Ttree push out someKristaps Dzonsons2011-01-023-20/+32
| | | | header stuff.
* Turn on -Tascii tbl printing. The output still has some issues---I'mKristaps Dzonsons2011-01-026-7/+370
| | | | | | not sure whether it's in the header calculation or term.c squashing spaces or whatever, but let's get this in for general testing as soon as possible.
* Add some final bits necessary in the upcoming -Tascii tbl stuff.Kristaps Dzonsons2011-01-024-5/+19
|
* Churn to get parts of 'struct tbl' visible from mandoc.h: rename theKristaps Dzonsons2011-01-028-91/+97
| | | | | | | 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.
* Merge in the width, decimal, and positioning code for individual data rowsKristaps Dzonsons2011-01-011-1/+166
| | | | | | | | from tbl.bsd.lv. This is more or less verbatim, less queue macros and also a check for NULL layout. This concludes the back-end parsing for a little while, as the front-end display may now be configured.
* Add a warning if a data cell has no layout. Also make -Ttree show thisKristaps Dzonsons2011-01-014-5/+17
| | | | with a little star next to the entry (yeah, this is mostly for testing).
* Plug in the "head" concept for tables. A tbl_head specifies the fullKristaps Dzonsons2011-01-014-25/+155
| | | | | | | | | | 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 for compilation on Mac.Kristaps Dzonsons2011-01-012-2/+4
|
* Make some bit-flags into enums as they should be. Make printing of -TtreeKristaps Dzonsons2011-01-013-34/+72
| | | | tables a little bit smarter.
* More checks for proper table exit.Kristaps Dzonsons2011-01-014-14/+15
|
* Raise an error if a table is closed without data.Kristaps Dzonsons2011-01-013-6/+12
|
* Add documentation bits for libroff's new roff_span().Kristaps Dzonsons2011-01-016-12/+41
| | | | | | Add bits to remember tbl's invocation point. Add ERROR class message if no data's in the table.
* Make -Ttree a bit more readable.Kristaps Dzonsons2011-01-011-2/+3
|
* Make -Ttree spit out table columns.Kristaps Dzonsons2011-01-012-21/+50
| | | | Add forgotten assignment of span to -man's TBL nodes.
* Switch on tbl rows being added to the parse stream. Here we go!Kristaps Dzonsons2011-01-013-10/+21
|
* Add -man support for tables. Like -mdoc, this consists of anKristaps Dzonsons2011-01-017-47/+104
| | | | | | | external-facing function man_addspan() (this required shuffling around the descope routine) and hooks elsewhere. Also fixed mdoc.c's post-validation of tables.
* Add basic -Ttree support for tables.Kristaps Dzonsons2011-01-011-1/+13
|
* Add table processing structures to -mdoc. This consists of anKristaps Dzonsons2011-01-016-17/+95
| | | | | | external-facing function mdoc_addspan(), then various bits to prohibit printing and scanning (this requires some if's to be converted into switch's).
* Clean up {mdoc,man}_pmsg and vmsg invocations (ignore return values).Kristaps Dzonsons2011-01-012-22/+24
|
* Expose the parsed table API to the world and add accessors through theKristaps Dzonsons2010-12-315-61/+90
| | | | roff.h interface.
* Put parsed tables into a queue that's cleared at the end of parsing.Kristaps Dzonsons2010-12-313-72/+55
| | | | This completes the parsing phase of the new tbl implementation.
* Assign layout cells to parsed data. This follows primarily fromKristaps Dzonsons2010-12-302-2/+35
| | | | tbl.bsd.lv, although it has been reimplemented.
* Move clean-up of parsed tbl nodes into the tbl_clear() function, calledKristaps Dzonsons2010-12-304-36/+52
| | | | once per invocation.
* Plan9 has a man(7) implementation that looks extremely archaic,Ingo Schwarze2010-12-301-1/+6
| | | | | even more archaic than Solaris/Heirloom stuff; so that is quite interesting from a perspective of compatibility and history.
* Initial check-in of table data-row processing. For the time being, thisKristaps Dzonsons2010-12-294-6/+134
| | | | | | 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.
* Use `Dl' instead of `D1' for code examples.Kristaps Dzonsons2010-12-291-4/+4
|
* In mdoc.7, don't use `D1' in place of `Dl' for code examples.Kristaps Dzonsons2010-12-291-94/+94
|
* Update (still-commented) manual bits for tbl.Kristaps Dzonsons2010-12-292-31/+94
| | | | | Also removed lots of superfluous switch cases by using tolower() and handling only the lowercase keys.
* Add handling for `T&', which restarts a table except for its options.Kristaps Dzonsons2010-12-293-3/+28
|