aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mandoc.h
Commit message (Collapse)AuthorAgeFilesLines
* Const-ify some mchars arguments. I think these are non-const for historicalKristaps Dzonsons2011-11-081-3/+3
| | | | dumbness on my part.
* When the HEAD scope of .TP is broken by another block macro,Ingo Schwarze2011-11-071-2/+1
| | | | | | | | do not abort with a FATAL error, but report a report a WARNING, remove the broken .TP from the syntax tree, and prod on. Reported repeatedly by ports people, at least by brad@ and jeremy@. Also fixes rendition(4) in Xenocara. ok kristaps@
* If -Tman is specified and input is -man, echo the preprocessed (`so'Kristaps Dzonsons2011-10-061-17/+18
| | | | | | | | | | | | | | replaced by file) input. This replaces earlier behaviour of doing nothing, which I found unexpected (mandoc should always output). This requires a buffer in read.c that saves the input lines before being parsed, with a special hook if `so' is invoked. This buffer is just flushed to output if -mman is the input. While mucking around doing this, I also alpha-ordered the mandoc.h functions. Ok schwarze@, with no screaming when the polished patch was published.
* Note GNU extensions in eqn.7. Also add `col' and `pile', which areKristaps Dzonsons2011-07-231-1/+3
| | | | | mentioned briefly in the eqn User's Manual, but otherwise are unspecified.
* Add support for tdefine and ndefine. Consolidate some error messages. AddKristaps Dzonsons2011-07-231-2/+2
| | | | somem more version notes (getting there). Have the equation nanme be captured.
* Add `fat' font. This pretty much brings us in line with the secondKristaps Dzonsons2011-07-231-1/+2
| | | | edition of eqn.
* Add matrix support. Also remove "above" notion, as all elements in aKristaps Dzonsons2011-07-231-3/+6
| | | | list are delimited by their "aboveness" and it's superfluous.
* Add support for `gsize' eqn token (introduced in second-edition troff).Kristaps Dzonsons2011-07-221-2/+1
|
* Give lists their own eqn function.Kristaps Dzonsons2011-07-221-2/+3
|
* Complete eqn.7 parsing. Features all productions from the original 1975Kristaps Dzonsons2011-07-211-5/+22
| | | | | | | | 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-1/+3
| | | | effect.
* Full support for eqn positionals (above, over, sup, sub, etc.).Kristaps Dzonsons2011-07-211-1/+17
|
* Add eqn subexpression fonts.Kristaps Dzonsons2011-07-211-3/+12
|
* Add support for markers. These decorate the last box: see eqn.7.Kristaps Dzonsons2011-07-211-1/+15
|
* Support nested `{, }' subexpressions in eqn. Document in code.Kristaps Dzonsons2011-07-211-8/+15
|
* Flip eqn into using parsed nodes. I've temporarily disabled printingKristaps Dzonsons2011-07-211-3/+14
| | | | | | | 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.
* Finish the eqn syntactic parser. This correctly parses terms and doesKristaps Dzonsons2011-07-211-2/+2
| | | | | | | the proper `define' dance, which amounts to pure word-replace (you can, say, define `foo' as `define' then define `define' as something else). eqn.c is now ready for some semantic parsing of `box' and `eqn' productions as defined by the grammar.
* Forgot to add these bits to the last commit.Kristaps Dzonsons2011-07-181-1/+2
|
* Provide implementations of `define', `set', and `unset'.Kristaps Dzonsons2011-07-171-1/+4
| | | | | | Tie them into the stream of data. Document these appropriate, bringing in the grammar as defined by the original eqn manual (Kernighan/Richie).
* Warn if equation `define' key is quoted (groff-ism).Kristaps Dzonsons2011-07-171-1/+4
|
* Expose mandoc_strdup() to the outside world.Kristaps Dzonsons2011-07-151-1/+2
|
* Remove all references to ESCAPE_PREDEF, which is now not exposed passedKristaps Dzonsons2011-05-241-4/+1
| | | | the libroff point. This clears up a nice chunk of code.
* Flip on unicode output (via \[uNNNN]) in -T[x]html. Here we go!Kristaps Dzonsons2011-05-171-1/+2
|
* Support groff's escape for Unicode input. SeeKristaps Dzonsons2011-05-151-1/+2
| | | | | | http://mdocml.bsd.lv/archives/tech/0368.html For the time being, we just throw it away.
* Make mchars_num2char() return a char like it says.Kristaps Dzonsons2011-04-301-2/+2
|
* Rename mchars_init() -> mchars_alloc() for consistency.Kristaps Dzonsons2011-04-301-2/+2
|
* Remove enum mcharst, which hasn't been used in quite some time.Kristaps Dzonsons2011-04-301-7/+2
|
* Move "chars" interface out of out.h and into mandoc.h. This doesn'tKristaps Dzonsons2011-04-291-1/+16
| | | | | | | | | | change any code but for renaming functions and types to be consistent with other mandoc.h stuff. The reason for moving into libmandoc is that the rendering of special characters is part of mandoc itself---not an external part. From mandoc(1)'s perspective, this changes nothing, but for other utilities, it's important to have these part of libmandoc. Note this isn't documented [yet] in mandoc.3 because there are some parts I'd like to change around beforehand.
* Remove a2roffdeco() and mandoc_special() functions and replace them withKristaps Dzonsons2011-04-091-1/+17
| | | | | | | | | | | | | | | | | | a public (mandoc.h) function mandoc_escape(), which merges the functionality of both prior functions. Reason: code duplication. The a2roffdeco() and mandoc_special() functions were pretty much the same thing and both quite complex. This allows one function to receive improvements in (e.g.) subexpression handling and performance, instead of having to replicate functionality. As such, the mandoc_escape() function already handles a superset of the escapes handled in previous versions and has improvements in performance (using strcspn(), for example) and reliable handling of subexpressions. This code Works For Me, but may need work to catch any regressions. Since the benefits are great (leaner code, simpler API), I'd rather have it in-tree than floating as a patch.
* Put mandocerrs and mandoclevels arrays into libmandoc with accessorsKristaps Dzonsons2011-03-281-1/+3
| | | | mparse_strerror() and mparse_strlevel().
* Make (e.g.) `SM' before `B' be only a warning. In reality, this refersKristaps Dzonsons2011-03-231-2/+2
| | | | | | | to ELINE macros ("next-line", but not unbreakable like the next-line paragraph macros) followed by other macros. This addresses a report by Christian Weisgerber, posted in the TODO by schwarze@, and aired on discuss@ (22/03/2011) for whether a fix is warranted.
* Move mandoc_isdelim() back into libmdoc.h. This fixes an unreportedKristaps Dzonsons2011-03-221-19/+1
| | | | | | | | | error where (1) -man pages were punctuating delimiters (e.g., `.B a ;') and where (2) standalone punctuation in -mdoc or -man (e.g., ";" on its own line) would also be punctuated. This introduces a small amount of complexity of mdoc_{html,term}.c must manage their own spacing with running print_word() or print_text(). The check for delimiting now happens in mdoc_macro.c's dword().
* Add a FATAL error for when no manual type was assigned (you can repeatKristaps Dzonsons2011-03-221-1/+2
| | | | this for yourself by having a file consisting only of comments).
* Step 1 of restructuring: libmandoc.h. Move all compiler-set-specificKristaps Dzonsons2011-03-221-37/+1
| | | | | | | | | | stuff into libmandoc.h, including old mdoc.h/man.h/roff.h functions now used by read.c. The motivation behind this is to tighten the relationship between the underlying compilers while keeping parse data hidden from general callers (e.g., main.c). While here, also move register values from mandoc.h into libmandoc.h as noted by schwarze@. See above for explanation.
* Let read.c worry about the currently-open file instead of having thisKristaps Dzonsons2011-03-201-5/+2
| | | | | | information duplicated in main.c. For the time being, remove evt_close and evt_open, as the only known mparse interface (main.c) doesn't need them.
* Consolidate messages. Have all parse-time messages (in libmdoc,Kristaps Dzonsons2011-03-201-5/+5
| | | | | | | | | libroff, etc., etc.) route into mandoc_msg() and mandoc_vmsg(), for the time being in libmandoc.h. This requires struct mparse to be passed into the allocation routines instead of mandocmsg and a void pointer. Then, move some of the functionality of the old mmsg() into read.c's mparse_mmsg() (check against wlevel and setting of file_status) and use main.c's mmsg() as simply a printing tool.
* Split the document parsing sequence out of main.c and into read.c,Kristaps Dzonsons2011-03-201-1/+26
| | | | | | | | putting the interface into mandoc.h. This effectively makes the function of main.c be command-line handling, invoking the parser, and sending its output to the output handler. The sequence of parsing (pfile(), pdesc(), etc.) has changed very little but for clean-up of some state variables (curp->fd, etc.).
* mandocmsg finally has no return value.Kristaps Dzonsons2011-03-171-2/+2
|
* Move mdoc_isdelim() into mandoc.h as mandoc_isdelim(). This allows theKristaps Dzonsons2011-03-171-1/+19
| | | | | | removal of manual delimiter checks in html.c and term.c. Finally, add the escaped period as a closing delimiter, removing a TODO to this effect.
* Move mandoc_{realloc,malloc,calloc} out of libmandoc.h and into mandoc.hKristaps Dzonsons2011-03-171-7/+7
| | | | | | | | so that everybody can use them. This follows the convention of libXXXX.h being internal to a library and XXXX.h being the external interface. Not only does this allow the removal of lots of redundant NULL-checking code, it also sets the tone for adding new mandoc-global routines.
* Clean up date handling,Ingo Schwarze2011-03-071-2/+3
| | | | | | | | | | | | as a first step to get rid of the frequent petty warnings in this area: - always store dates as strings, not as seconds since the Epoch - for input, try the three most common formats everywhere - for unrecognized format, just pass the date though verbatim - when there is no date at all, still use the current date Originally triggered by a one-line patch from Tim van der Molen, <tbvdm at xs4all dot nl>, which is included here. Feedback and OK on manual parts from jmc@. "please check this in" kristaps@
* Allow EQN data to be pushed down into libmdoc via mdoc_addeqn(). OnlyKristaps Dzonsons2011-02-091-1/+3
| | | | 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-1/+2
|
* Add initial EQN support to mandoc. This parses, then throws away, dataKristaps Dzonsons2011-02-061-1/+6
| | | | | | | | between EQ and EN roff blocks. EQN is different from TBL in that data after .EQ is unilaterally considered an equation until an .EN. Thus, there's no need to jump through hoops in having table spans and so on. This is ONLY the parse code framework in libroff. EQN is not yet passed into the backends.
* If `Ns' is specified on its own line, it should be ignored. This isKristaps Dzonsons2011-02-021-1/+2
| | | | | shitty groff behaviour. Do the same, but raise a warning to this effect. This from a TODO noted by schwarze@.
* Make out-of-context `fi' invocations not cause an error, but just aKristaps Dzonsons2011-01-121-1/+2
| | | | warning. From a TODO by schwarze@, originally noted by Brad Smith.
* Refactoring in preparation for .rm support:Ingo Schwarze2011-01-111-1/+2
| | | | | | | | | | Unify parsing of names given as roff request arguments into a new function roff_getname(), which is rather different from the parsing function for normal arguments, mandoc_getarg(), because names cannot be quoted and cannot contain whitespace or escaped characters. The new function now throws an ERROR when finding escaped characters in a name. "I'm fine with this." kristaps@
* Clarify what members may be NULL or not in calculating widths. MakeKristaps Dzonsons2011-01-101-11/+11
| | | | | sure signedness is correct. Verify that layouts MUST exit for data cells.
* First, make extra data cells be thrown away. This makes "dp->layout"Kristaps Dzonsons2011-01-101-4/+3
| | | | | | | | | | | | 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.
* Remove delims from struct tbl (not used anywhere and never will be).Kristaps Dzonsons2011-01-061-2/+1
|