summaryrefslogtreecommitdiffstats
path: root/mandoc.h
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix to make horizontal spanners in the layout be properly printed.Kristaps Dzonsons2011-01-041-0/+1
| | | | | | | 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.
* Partial cleanup of argument count validation in mdoc(7):Ingo Schwarze2011-01-031-1/+2
| | | | | | | | | | | | * 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.
* Make width calculations occur within tbl_term.c, not tbl.c. This allowsKristaps Dzonsons2011-01-031-3/+3
| | | | | | | | | | | | | | | | 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.
* Add some final bits necessary in the upcoming -Tascii tbl stuff.Kristaps Dzonsons2011-01-021-0/+5
|
* Churn to get parts of 'struct tbl' visible from mandoc.h: rename theKristaps Dzonsons2011-01-021-0/+15
| | | | | | | 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.
* Add a warning if a data cell has no layout. Also make -Ttree show thisKristaps Dzonsons2011-01-011-0/+5
| | | | 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-011-0/+20
| | | | | | | | | | 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@).
* Make some bit-flags into enums as they should be. Make printing of -TtreeKristaps Dzonsons2011-01-011-8/+16
| | | | tables a little bit smarter.
* Add documentation bits for libroff's new roff_span().Kristaps Dzonsons2011-01-011-0/+1
| | | | | | Add bits to remember tbl's invocation point. Add ERROR class message if no data's in the table.
* Expose the parsed table API to the world and add accessors through theKristaps Dzonsons2010-12-311-0/+69
| | | | roff.h interface.
* Merge, with considerable changes, tbl.bsd.lv's layout-handling code.Kristaps Dzonsons2010-12-291-0/+2
|
* Significant update to options handling, which now departs almostKristaps Dzonsons2010-12-291-0/+2
| | | | | | | | | | | | | 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.
* Revert IGNPAR to a warning after clue-stick applied by schwarze@:Kristaps Dzonsons2010-12-221-1/+1
| | | | | | | although technically-speaking a lost macro is an error (e.g., MANDOCERR_MACRO), casting out some extra whitespace (note, IGNPAR only happens in conditions where whitespace already exists!) is hardly an error matter.
* Add a "last child" member of struct mdoc_node.Kristaps Dzonsons2010-12-151-1/+1
| | | | | | | Remove `Pp' or `Lp' if it is the FIRST or LAST child of an `Sh' or `Sh' body. Make "skipping paragraph" be an error, not a warning, as information (an invoked macro) is ignored.
* Abort endless loops during roff macro and string expansion.Ingo Schwarze2010-12-101-0/+1
| | | | | | For now, use the simplest conceivable approach, like groff does: Just a fixed, ugly input stack limit. "check it in" kristaps@
* Bring schwarze@'s mandoc.h and main.c errors and warnings entirely in sync,Kristaps Dzonsons2010-12-061-42/+54
| | | | except for the tbl one which will be the focus of later study.
* Add support for `ft' macro found in groff(7). Based on a patch byKristaps Dzonsons2010-12-061-0/+1
| | | | | schwarze@, but without the -T[x]html handling, which structurally does not work. Also add man.7 documentation (not in original patch).
* Merge schwarze@'s relaxation of scope-breaking rules: allow implicitKristaps Dzonsons2010-12-061-0/+1
| | | | ending of scopes and drop stray scope-endings.
* Remove long-standing FIXME regarding the consolidation of WIDTHARG andKristaps Dzonsons2010-12-051-2/+0
| | | | NOARGV warnings. From patch by schwarze@.
* Merge schwarze@'s patch to allow uname() to fail without causing an exit.Kristaps Dzonsons2010-12-051-1/+1
|
* Merge schwarze@'s changes allowing nested displays. Tweak the patch byKristaps Dzonsons2010-12-051-2/+1
| | | | | | | making sure output doesn't add a superfluous newline with the nested displays. Also add a COMPATIBILITY note. Rename a macro (DATESIZ) to be in line with OpenBSD (DATESIZE).
* Merge OpenBSD's `so' handling (plus some documentation). Great work toKristaps Dzonsons2010-12-011-0/+2
| | | | schwarze@ and joerg@ for his comments!
* Re-ordering of roff requests as per OpenBSD.Kristaps Dzonsons2010-12-011-0/+1
| | | | Made `rm' be an error (again, OpenBSD...).
* Remove left-over rsord[] in mdoc_actions.c.Kristaps Dzonsons2010-11-291-2/+1
| | | | | | | | | Remove MANDOCERR_BADLIB (not used). Moved `St' handling from mdoc_action.c into mdoc_validate.c. Moved relevant MDOC_LITERAL macros (`Dl', `Bd' subtypes) from mdoc_action.c into mdoc_validate.c.
* Use proper error for `An' multiple arguments.Kristaps Dzonsons2010-10-111-1/+1
| | | | Making IGNARGV be an ERROR, not a WARNING, as information is lost.
* Revert merging of {mdoc,man}.h -> mandoc.h.Kristaps Dzonsons2010-10-041-406/+28
| | | | While I'm add it, properly document all structures in these files.
* Unify mdoc and man enums and structs into mandoc.h. This is part of theKristaps Dzonsons2010-10-021-11/+400
| | | | | slow process of logically splitting formatting frontend and parser backend without pollution.
* Ignore double-`Pp' and `Pp' before `Bd' and `Bl' (unless -compact isKristaps Dzonsons2010-09-271-0/+1
| | | | specified).
* If an explicit scope is still open at the end of an input file,Ingo Schwarze2010-09-261-2/+1
| | | | | | | | | | report an ERROR: We can still render the page by just closing the open scope, but it is likely that information will be missing or document structure mangled. Before, man(7) only reported a WARNING (which is dangerous because we cannot be sure rendering is correct) and mdoc(7) ran into FATAL (which is too drastic, there is no reason not to show what we have). "looks good" kristaps@
* Implement a simple, consistent user interface for error handling.Ingo Schwarze2010-08-201-1/+12
| | | | | | | | | | | | | | | | | 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.
* Strip non-graphable input characters from input. The manualsKristaps Dzonsons2010-07-201-0/+1
| | | | | | | | | specifically say that this is not allowed, and were it allowed, output would be inconsistent across output media (-Tps will puke, non-your-charset terminals will puke, etc.). With this done, simplify check_text() to only check escapes and for tabs. Add in a new tab warning, too.
* Move register information into mandoc.h, which is where it should haveKristaps Dzonsons2010-07-051-3/+37
| | | | been in the first place (mandoc.h contains system-wide declarations).
* Stash `Bf' parameters into struct mdoc_bf.Kristaps Dzonsons2010-07-021-2/+1
|
* Improve .Nm indentation in the SYNOPSIS;Ingo Schwarze2010-07-011-2/+3
| | | | | | | kristaps@ will do the missing HTML part soon. "looks nicer" jmc@ "seems perfect to me" sobrado@ "slap it in" kristaps@
* improve error reporting:Ingo Schwarze2010-06-301-6/+10
| | | | | | | | | * avoid error exit code after mere warnings * add ERROR: and FATAL: to messages when appropriate * sort the code in mmsg() to make it easier on the eye * make the mandocerrs[] list easier to maintain * update a few comments in mandoc.h ok kristaps@
* Removed stipulation that an empty `Bd -offset' will default to 6n. NotKristaps Dzonsons2010-06-121-0/+2
| | | | | | | sure where this came about. Added regression tests to convince myself that this is so. Also consolidated COMPATIBILITY notes regarding `Bd'. Added COMPATIBILITY note to the effect that old groff pukes on `Bd -compact -ragged' (regression test will fail on old groff).
* Added enum mdoc_disp (similar to enum mdoc_list). Display types are nowKristaps Dzonsons2010-06-121-2/+2
| | | | | | | | | | | only calculated once in mdoc_validate.c. Noted that `Bd -file xxx' is not supported: it now raises a fatal warning. This is noted in mdoc.7. Empty `Bd' now defaults to LIST_ragged, which is not quite what groff does, but close enough (gross just throws away the `Bd' and gets upset when it encounters an `Ed').
* Consolidated list processing to a single loop in mdoc_validate.c. ThisKristaps Dzonsons2010-06-031-2/+1
| | | | | | | | | | relieves having to repeat running over the argument list in mdoc_action.c and mdoc_validate.c. Default to LIST_item for type-less lists (groff technically doesn't do this: it just ignores the `It' lines altogether). Make MANDOC_LISTTYPE be a recoverable error.
* Spelling patches provided by Ulrich Spoerlein.Kristaps Dzonsons2010-06-011-2/+2
|
* Cleanup post_bl_head() to use enum mdoc_list (avoid traversing thatKristaps Dzonsons2010-05-311-1/+1
| | | | | | | | list). Reverted MANDOC_COLUMNS to be a bad-bad syntax error: we don't, and apparently never have, allowed mixing of -column syntaxes. This would have segfaulted if encountered.
* Modified version of Ingo Schwarze's patch for hyphen-breaking.Kristaps Dzonsons2010-05-251-0/+4
| | | | | | | Breakable hyphens are cued in the back-ends (with ASCII_HYPH) and acted upon in term.c or ignored in html.c. Also cleaned up XML decl printing (no need for extra vars).
* fix an obvious oversight introduced in rev. 1.5:Ingo Schwarze2010-05-241-1/+1
| | | | | MANDOCERR_BODYLOST is not intended to be fatal; required to unbreak the OpenBSD build
* Enable the unified error/warning enumeration in mandoc.h that'sKristaps Dzonsons2010-05-171-2/+64
| | | | | | | | | | | 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.
* `ig' support in all its glory. TryKristaps Dzonsons2010-05-161-2/+2
| | | | | | | | | | | | | | | | | | .ig ig asdf .ig fdsa .. or .ig if asdf .if n \ foo for a laugh. It all works. Lots of regression tests supporting this and documentation for the same.
* Regression tests in place for `.if' in libroff.Kristaps Dzonsons2010-05-161-0/+1
| | | | | Check against some strange `.if' constructs I missed. Added initial roff.7 manual.
* The `ig' now supports `ig end-macro'.Kristaps Dzonsons2010-05-151-0/+3
| | | | Initial warning/error messages in place (still experimental).
* Add mandoc.h, which will eventually replace compilers' inner enum errors ↵Kristaps Dzonsons2010-05-151-0/+39
with unified ones. Add initial roff pre-processor shim, a compiler sitting outside of the other compilers that processes pure roff instructions.