summaryrefslogtreecommitdiffstatshomepage
path: root/read.c
Commit message (Collapse)AuthorAgeFilesLines
* Add support for tdefine and ndefine. Consolidate some error messages. AddKristaps Dzonsons2011-07-231-2/+1
| | | | somem more version notes (getting there). Have the equation nanme be captured.
* Add support for `gsize' eqn token (introduced in second-edition troff).Kristaps Dzonsons2011-07-221-2/+1
|
* Complete eqn.7 parsing. Features all productions from the original 1975Kristaps Dzonsons2011-07-211-1/+4
| | | | | | | | 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 nested `{, }' subexpressions in eqn. Document in code.Kristaps Dzonsons2011-07-211-1/+3
|
* Forgot to add these bits to the last commit.Kristaps Dzonsons2011-07-181-1/+2
|
* Make `struct roff' be passed into libmdoc and libman upon creation.Kristaps Dzonsons2011-07-181-9/+6
| | | | | This is required for supporting in-line equations. While here, push registers properly into roff and add an set/get/mod interface.
* 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
|
* At least in theory, this patch lets us compile on Windows (which doesKristaps Dzonsons2011-05-261-4/+10
| | | | not have mmap(), from what I can tell).
* No code change: fixing spelling errors. From a patch by uqs@. Thanks!Kristaps Dzonsons2011-04-301-2/+2
|
* Ignore \# lines alongside \". From groff(7):Kristaps Dzonsons2011-04-111-2/+2
| | | | | | \# Everything up to and including the next newline is ignored. This is interpreted in copy mode. This is like \" except that the terminating newline is ignored as well.
* Remove a2roffdeco() and mandoc_special() functions and replace them withKristaps Dzonsons2011-04-091-2/+2
| | | | | | | | | | | | | | | | | | 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.
* Add config.h Glue for OpenIndiana (and older OpenSolaris) to build.Kristaps Dzonsons2011-04-041-1/+5
| | | | From a patch by Yuri Pankov, thanks!
* If wlevel in mparse_alloc() is greater than MANDOCLEVEL_FATAL, we'llKristaps Dzonsons2011-04-031-1/+3
| | | | | | throw assertions due to per-file-error not being properly set in mmsg(). This is reasonable behaviour (we shouldn't be able to ignore FATAL after all). Thus, make sure wlevel is sanitised.
* Allow mparse_result() pointers to be NULL.Kristaps Dzonsons2011-04-031-3/+5
|
* Allow a NULL mmsg passed to libmandoc.Kristaps Dzonsons2011-03-311-2/+3
|
* Put mandocerrs and mandoclevels arrays into libmandoc with accessorsKristaps Dzonsons2011-03-281-1/+132
| | | | mparse_strerror() and mparse_strlevel().
* Add a FATAL error for when no manual type was assigned (you can repeatKristaps Dzonsons2011-03-221-8/+3
| | | | this for yourself by having a file consisting only of comments).
* Step 2: blow away roff.h, as all of its functions have been moved intoKristaps Dzonsons2011-03-221-2/+1
| | | | libmandoc.h and there's nothing left.
* Let read.c worry about the currently-open file instead of having thisKristaps Dzonsons2011-03-201-13/+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-27/+62
| | | | | | | | | 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.
* Change around include ordering for compilation on OpenBSD.Kristaps Dzonsons2011-03-201-2/+2
|
* Split the document parsing sequence out of main.c and into read.c,Kristaps Dzonsons2011-03-201-0/+611
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.).