| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
modes instead of four functions, resulting in considerable
simplification, fifty lines less of code, fifteen fewer automatic
variables, and several bug fixes, for example:
1. The delim control statement consumes exactly two bytes of input,
requires no whitespace after these two bytes, and does not treat
quotes in any special way.
2. If the argument of left, right, gfont, gsize, or size is defined
as an alias, only the first word of the value is used as the
delimiter, font name, or font size.
3. If a back, fwd, down, or up keyword is followed by another keyword
instead of the required number, GNU eqn does nothing useful, but
typically errors out. So no need to have special handling (with
an ugly goto!) for it in mandoc.
Also getting rid of one pointless static buffer and twelve redundant
calls to strlcpy(3).
|
|
|
|
| |
do not forget to close the inserted list box
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1. Inherit the font attribute from the parent box, such that iteration
is no longer required to find the current font.
2. For well-known function name tokens, do not insert an EQN_LISTONE
box into the AST; simply set the font attribute of the text box
itself that contains the name.
Also improve word splitting of unquoted strings in default font mode:
3. Split between numbers and punctuation because both will soon get
different HTML markup.
4. Do not split between letters. With the newly ubiquitious font
attributes, all formatters will be able to figure out what to do
without putting each letter into a separate box.
|
|
|
|
|
|
|
|
| |
Issue reported by bentley@.
The AST data structure is powerful enough that all required
information can easily be provided in the parser, and no change
of the formatting code is needed.
|
|
|
|
|
| |
The formatters need this to correctly select fonts.
Missing feature reported by bentley@.
|
| |
|
|
|
|
|
|
| |
which includes those recognized by groff) and wrap them in a roman box
unless they already are in roman context.
Missing feature reported by bentley@.
|
| |
|
|
|
|
|
|
| |
Do not only catch "define key 'key other stuff'",
but also "define key 'other stuff key'".
Fixing infinite loop found by tb@ with afl(1).
|
|
|
|
|
|
| |
so delete a redundant NULL check that confused Coverity in CID 1257471;
issue reported by wiz@, patch differs from what christos@ did in NetBSD.
No functional change.
|
|
|
|
|
| |
incremented, causing infinite loops.
Fixing CID 1288962. From christos@ via wiz@, both at NetBSD.
|
| |
|
|
|
|
| |
patch from bentley@
|
|
|
|
|
|
|
|
| |
* When "define" fails, do not drop the whole equation.
* Free memory after "undef".
* Use standard mandoc error types instead of rolling our own.
* Delete obfuscating EQN_MSG() macro.
* Add function prototypes while here.
|
|
|
|
|
| |
by Theo Buehler <theo at math dot ethz dot ch> on tech at openbsd:
Do not attempt to parse empty equations.
|
|
|
|
|
|
|
| |
* drop trivial wrapper function roff_openeqn()
* drop unused first arg of function eqn_alloc()
* drop usused member "name" of struct eqn_node
While here, sync to OpenBSD by killing some trailing blanks.
|
|
|
|
|
|
|
|
| |
Put the steering into the roff parser rather than into the mdoc
parser such that it works for all macro languages and on both text
and macro lines.
Line breaks and blank characters generated before and after in-line
equations are not perfect yet, but let's do one thing at a time.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Get rid of the first fatal error, MANDOCERR_EQNSYNT.
In eqn(7), there is no need to be bug-compatible with groff, so there
is no need to abondon the whole equation in case of a syntax error.
In particular:
* Skip "back", "delim", "down", "fwd", "gfont", "gsize", "left",
"right", "size", and "up" without arguments.
* Skip "gsize" and "size" with a non-numeric argument.
* Skip closing delimiters that are not open.
* Skip "above" outside piles.
* For diacritic marks and binary operators without a left operand,
default to an empty box.
* Let piles and matrices take one argument rather than insisting
on a braced list. Let HTML output handle that, too.
* When rewinding, if the root box is guaranteed to match
the termination condition, no error handling is needed.
|
|
|
|
| |
and update Copyright year while here; no code change.
|
|
|
|
| |
The assert message contains no more information than the segfault.
|
|
|
|
| |
This fixes run-time assertions regarding "tok".
|
|
|
|
|
|
|
|
|
|
| |
This adds parser-level support for the grammar described by the eqn
second-edition technical paper, "Typesetting Mathematics — User's Guide"
(Kernighan, Cherry).
The reason for this re-write is the grouping rules, which were not
possible given the existing implementation.
The re-write has also considerably simplified the HTML (and, if it ever
is completed, terminal) front-end.
|
| |
|
| |
|
|
|
|
|
|
| |
Include <sys/types.h> where needed, it does not belong in config.h.
Remove <stdio.h> from config.h; if it is missing somewhere, it should
be added, but i cannot find a *.c file where it is missing.
|
|
|
|
|
| |
* Mention invalid escape sequences and string names, and fallbacks.
* Hierarchical naming.
|
|
|
|
|
|
| |
* Downgrade ".Bf -emphasis Em" from FATAL to WARNING.
* Mention the macros, the arguments, and the fallbacks.
* Hierarchical naming.
|
|
|
|
|
|
|
| |
* Change eight reallocs to reallocarray to be safe from overflows.
* Change one malloc to reallocarray to be safe from overflows.
* Change one calloc to reallocarray, no zeroing needed.
* Change the order of arguments of three callocs (aesthetical).
|
|
|
|
| |
and cast snprintf return value to (void) where they are
|
|
|
|
|
| |
remove trailing whitespace and blanks before tabs, improve some indenting;
no functional change
|
|
|
|
|
|
|
| |
functions used for multiple languages (mdoc, man, roff), for example
mandoc_escape(), mandoc_getarg(), mandoc_eos(), and generic auxiliary
functions. Split the auxiliaries out into their own file and header.
While here, do some #include cleanup.
|
|
|
|
|
|
| |
This consists of a shim around the text parser that calls out to libroff
if equation components exist on the line. Right now this will do
nothing, as the equation delimiter always returns nil.
|
|
|
|
|
| |
mentioned briefly in the eqn User's Manual, but otherwise are
unspecified.
|
|
|
|
| |
somem more version notes (getting there). Have the equation nanme be captured.
|
| |
|
|
|
|
| |
edition of eqn.
|
| |
|
|
|
|
| |
list are delimited by their "aboveness" and it's superfluous.
|
|
|
|
|
| |
Note this and clean up some documentation in eqn.7.
Also add some version notes, although I'm not ready for a release yet.
|
| |
|
| |
|
|
|
|
|
| |
Manual (1978) for this, so it should catch most of them. They just map
into the mandoc_char escaped characters.
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
worried that I'm going to write the wrong size on both sides of the
equality (I've already done it a few times). This cleans up the code
readability a bit.
|
| |
|
|
|
|
|
|
| |
spaces. Also allow for tabs. Finally, have the parser correctly handle
open and close brackets smooshed against other terms. All of these
handle "details" noted in the CACM paper.
|