summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* For tbl: -man documents print an extra space before `TS' blocks.Kristaps Dzonsons2011-01-031-0/+2
|
* Add in support for number table cells that account for escapes and soKristaps Dzonsons2011-01-031-17/+28
| | | | | 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-22/+45
|
* Start using term_strlen() instead of strlen(). tbl_term.c can nowKristaps Dzonsons2011-01-031-33/+38
| | | | | 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-215/+239
| | | | | | | | | | | | | | | | 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-5/+0
|
* Make sure we don't continue recursively parsing once we've exited withKristaps Dzonsons2011-01-031-0/+8
| | | | | 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-26/+21
|
* Clarified the role of MDOC_HALT in libmdoc functions by having accessorKristaps Dzonsons2011-01-032-21/+20
| | | | | | | | | | 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-17/+29
| | | | header stuff.
* Turn on -Tascii tbl printing. The output still has some issues---I'mKristaps Dzonsons2011-01-026-3/+366
| | | | | | 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-1/+15
|
* Churn to get parts of 'struct tbl' visible from mandoc.h: rename theKristaps Dzonsons2011-01-028-83/+89
| | | | | | | 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-0/+165
| | | | | | | | 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-1/+13
| | | | 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-21/+151
| | | | | | | | | | 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-0/+2
|
* Make some bit-flags into enums as they should be. Make printing of -TtreeKristaps Dzonsons2011-01-013-31/+69
| | | | tables a little bit smarter.
* More checks for proper table exit.Kristaps Dzonsons2011-01-014-10/+11
|
* Raise an error if a table is closed without data.Kristaps Dzonsons2011-01-013-3/+9
|
* Add documentation bits for libroff's new roff_span().Kristaps Dzonsons2011-01-016-5/+34
| | | | | | 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-1/+2
|
* Make -Ttree spit out table columns.Kristaps Dzonsons2011-01-012-19/+48
| | | | 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-7/+18
|
* Add -man support for tables. Like -mdoc, this consists of anKristaps Dzonsons2011-01-017-39/+96
| | | | | | | 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-0/+12
|
* Add table processing structures to -mdoc. This consists of anKristaps Dzonsons2011-01-016-10/+88
| | | | | | 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-20/+22
|
* Expose the parsed table API to the world and add accessors through theKristaps Dzonsons2010-12-315-56/+85
| | | | roff.h interface.
* Put parsed tables into a queue that's cleared at the end of parsing.Kristaps Dzonsons2010-12-313-69/+52
| | | | This completes the parsing phase of the new tbl implementation.
* Assign layout cells to parsed data. This follows primarily fromKristaps Dzonsons2010-12-302-0/+33
| | | | tbl.bsd.lv, although it has been reimplemented.
* Move clean-up of parsed tbl nodes into the tbl_clear() function, calledKristaps Dzonsons2010-12-304-32/+48
| | | | once per invocation.
* Plan9 has a man(7) implementation that looks extremely archaic,Ingo Schwarze2010-12-301-0/+5
| | | | | 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-4/+132
| | | | | | 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-2/+2
|
* In mdoc.7, don't use `D1' in place of `Dl' for code examples.Kristaps Dzonsons2010-12-291-92/+92
|
* Update (still-commented) manual bits for tbl.Kristaps Dzonsons2010-12-292-29/+92
| | | | | 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-0/+25
|
* Merge, with considerable changes, tbl.bsd.lv's layout-handling code.Kristaps Dzonsons2010-12-297-8/+354
|
* Initial documentation for TBL, which for the time being is commented-out.Kristaps Dzonsons2010-12-291-0/+46
|
* Whack removed function from libroff.Kristaps Dzonsons2010-12-291-1/+0
|
* Significant update to options handling, which now departs almostKristaps Dzonsons2010-12-296-144/+165
| | | | | | | | | | | | | 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.
* Fix copyright email.Kristaps Dzonsons2010-12-282-2/+2
|
* Adding initial options processing (not hooked into parse yet). This isKristaps Dzonsons2010-12-284-13/+294
| | | | | more or less copied from tbl.bsd.lv and still needs integration with the general mandoc framework, e.g., with error messages.
* Temporarily remove check for r->tbl at end of parse since we need theKristaps Dzonsons2010-12-281-1/+2
| | | | original parse point to generate a useful error message.
* Fixed enum rofferr return value in tbl_read() (oops).Kristaps Dzonsons2010-12-281-1/+1
|
* Initial tbl framework. Parse point is in libroff, which keeps aKristaps Dzonsons2010-12-285-61/+195
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* In case an ID attribute is written in pieces, only protect the firstIngo Schwarze2010-12-271-9/+13
| | | | | | | | piece with a prepended 'x', not each piece, such that quoted and unquoted .Sh, .Ss, and .Sx arguments are compatible with each other. Fixing a bug reported by Nicolas Joly <njoly at NetBSD dot org>, avoiding a regression in my first patch as pointed out by njoly as well. "feel free to do so" kristaps@
* Note `Sx's connection to `Sh' and `Ss'.Kristaps Dzonsons2010-12-271-0/+5
|
* Whack MDOC_ACTED and MAN_ACTED (these no longer exist).Kristaps Dzonsons2010-12-262-2/+0
|