CVS log for mandoc/eqn.c

[BACK] Up to [cvsweb.bsd.lv] / mandoc

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.86 / (download) - annotate - [select for diffs], Fri Apr 28 19:11:03 2023 UTC (11 months ago) by schwarze
Branch: MAIN
CVS Tags: HEAD
Changes since 1.85: +2 -2 lines
Diff to previous 1.85 (colored) to selected 1.19 (colored)

spelling fixes from Paul Tagliamonte via tech@ and jmc@

Revision 1.85 / (download) - annotate - [select for diffs], Wed Apr 13 20:26:19 2022 UTC (23 months, 2 weeks ago) by schwarze
Branch: MAIN
Changes since 1.84: +15 -11 lines
Diff to previous 1.84 (colored) to selected 1.19 (colored)

To prevent infinite recursion while expanding eqn(7) definitions,
we must not reset the recursion counter when moving beyond the end
of the *previous* expansion, but we may only do so when moving
beyond the rightmost position reached by *any* expansion in the
current equation.  This matters because definitions can nest;
consider:

.EQ
define inner "content"
define outer "inner outer"
outer
.EN

This endless loop was found by tb@ using afl(1).

Incidentally, GNU eqn(1) also performs an infinite loop in this
situation and then crashes when memory runs out, but that's not an
excuse for nasty behaviour of mandoc(1).

While here, consistently print the expanded content even when the
expansion is finally truncated.  While that is not likely to help
end-users, it may help authors of eqn(7) code to understand what's
going on.  Besides, it sends a very clear signal that something is
amiss, which was easy to miss in the past unless people
enabled -W error or used -T lint.

Revision 1.84 / (download) - annotate - [select for diffs], Wed Jan 8 12:16:24 2020 UTC (4 years, 2 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_6
Changes since 1.83: +11 -3 lines
Diff to previous 1.83 (colored) to selected 1.19 (colored)

Skip whitespace before tokens, too.
Bug found by bentley@ with input like "delim $$ delim off".

Revision 1.83 / (download) - annotate - [select for diffs], Fri Dec 14 06:33:14 2018 UTC (5 years, 3 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_5
Changes since 1.82: +2 -3 lines
Diff to previous 1.82 (colored) to selected 1.19 (colored)

Cleanup, no functional change:
Now that message handling is properly encapsulated,
remove struct mparse pointers from four structs (roff, roff_man,
tbl_node, eqn_node) and from the argument lists of five functions
(roff_alloc, roff_man_alloc, mandoc_getarg, tbl_alloc, eqn_alloc).
Except for being passed to the main program as an opaque object,
it now only occurs in read.c, as it should, and not across 15 files
like in the past.

Revision 1.82 / (download) - annotate - [select for diffs], Fri Dec 14 05:18:02 2018 UTC (5 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.81: +30 -30 lines
Diff to previous 1.81 (colored) to selected 1.19 (colored)

Almost mechanical diff to remove the "struct mparse *" argument
from mandoc_msg(), where it is no longer used.
While here, rename mandoc_vmsg() to mandoc_msg() and retire the
old version:  There is really no point in having another function
merely to save "%s" in a few places.
Minus 140 lines of code.

Revision 1.81 / (download) - annotate - [select for diffs], Thu Dec 13 05:23:38 2018 UTC (5 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.80: +14 -4 lines
Diff to previous 1.80 (colored) to selected 1.19 (colored)

Cleanup, no functional change:
No need to expose the eqn(7) syntax tree data structures everywhere.
Move them to their own include file, "eqn.h".
While here, delete the unused enum eqn_pilet.

Revision 1.80 / (download) - annotate - [select for diffs], Thu Dec 13 03:40:13 2018 UTC (5 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.79: +14 -3 lines
Diff to previous 1.79 (colored) to selected 1.19 (colored)

Cleanup, no functional change:
In libroff.h, nothing was left except the eqn(7) parser interface, which
isn't really part of the roff(7) parser, so rename it to eqn_parse.h.

While here, move struct eqn_def to eqn.c because that's the only
file using it, and let eqn_box_free() and eqn_free() handle NULL.

Revision 1.79 / (download) - annotate - [select for diffs], Wed Dec 12 21:54:35 2018 UTC (5 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.78: +2 -1 lines
Diff to previous 1.78 (colored) to selected 1.19 (colored)

Cleanup, no functional change:
No need to expose the tbl(7) syntax tree data structures everywhere.
Move them to their own include file, "tbl.h", and improve comments.

Revision 1.78 / (download) - annotate - [select for diffs], Sat Jul 15 16:26:17 2017 UTC (6 years, 8 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_4, VERSION_1_14_3, VERSION_1_14_2
Changes since 1.77: +2 -2 lines
Diff to previous 1.77 (colored) to selected 1.19 (colored)

print the right character for mathematical overbar; from bentley@

Revision 1.77 / (download) - annotate - [select for diffs], Fri Jul 14 18:18:26 2017 UTC (6 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.76: +2 -2 lines
Diff to previous 1.76 (colored) to selected 1.19 (colored)

always give commas their own <mo> element,
suggested by bentley@, improves e.g. glMultMatrix(3)

Revision 1.76 / (download) - annotate - [select for diffs], Sat Jul 8 14:51:04 2017 UTC (6 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.75: +55 -103 lines
Diff to previous 1.75 (colored) to selected 1.19 (colored)

1. Eliminate struct eqn, instead use the existing members
of struct roff_node which is allocated for each equation anyway.
2. Do not keep a list of equation parsers, one parser is enough.
Minus fifty lines of code, no functional change.

Revision 1.75 / (download) - annotate - [select for diffs], Fri Jul 7 17:16:17 2017 UTC (6 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.74: +11 -13 lines
Diff to previous 1.74 (colored) to selected 1.19 (colored)

simplify the eqn_box_makebinary() function by removing the trivial pos
parameter; also minus two lines of code; no functional change

Revision 1.74 / (download) - annotate - [select for diffs], Thu Jul 6 00:19:54 2017 UTC (6 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.73: +20 -11 lines
Diff to previous 1.73 (colored) to selected 1.19 (colored)

Fix operator precedence according to Brian W. Kernighan and Lorinda
L. Cherry, "Typesetting Mathematics - User's Guide (Second Edition)",
August 15, 1978, paragraph 23; swarm of bugs pointed out by bentley@.

Revision 1.73 / (download) - annotate - [select for diffs], Wed Jul 5 15:03:27 2017 UTC (6 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.72: +11 -8 lines
Diff to previous 1.72 (colored) to selected 1.19 (colored)

The EQN_LISTONE box type is pointless.
Simplify by just using EQN_LIST with expectargs = 1.
Noticed while investigating a bug report from bentley@.
No functional change.

Revision 1.72 / (download) - annotate - [select for diffs], Thu Jun 29 16:31:15 2017 UTC (6 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.71: +2 -2 lines
Diff to previous 1.71 (colored) to selected 1.19 (colored)

Skip whitespace at the beginning of eqn(7) nodes,
in particular ~ and ^ that misrendered;
found by bentley@ in glCopyTexSubImage1D(3); also affected
glAccum(3), glClipPlane(3), glDrawPixels(3), glEvalMesh(3), and others.

Revision 1.71 / (download) - annotate - [select for diffs], Mon Jun 26 20:09:04 2017 UTC (6 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.70: +161 -241 lines
Diff to previous 1.70 (colored) to selected 1.19 (colored)

Complete rewrite of the lexer in a single function with four operation
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).

Revision 1.70 / (download) - annotate - [select for diffs], Mon Jun 26 11:04:47 2017 UTC (6 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.69: +10 -7 lines
Diff to previous 1.69 (colored) to selected 1.19 (colored)

when splitting a composite word,
do not forget to close the inserted list box

Revision 1.69 / (download) - annotate - [select for diffs], Fri Jun 23 21:04:57 2017 UTC (6 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.68: +20 -2 lines
Diff to previous 1.68 (colored) to selected 1.19 (colored)

splitting a text box sometimes requires wrapping it in a list

Revision 1.68 / (download) - annotate - [select for diffs], Fri Jun 23 00:30:38 2017 UTC (6 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.67: +41 -37 lines
Diff to previous 1.67 (colored) to selected 1.19 (colored)

Simplify font handling:
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.

Revision 1.67 / (download) - annotate - [select for diffs], Thu Jun 22 00:30:20 2017 UTC (6 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.66: +22 -8 lines
Diff to previous 1.66 (colored) to selected 1.19 (colored)

Fix font selection for text boxes in the terminal formatter.
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.

Revision 1.66 / (download) - annotate - [select for diffs], Wed Jun 21 20:50:50 2017 UTC (6 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.65: +45 -14 lines
Diff to previous 1.65 (colored) to selected 1.19 (colored)

Outside explicit font context, give every letter its own box.
The formatters need this to correctly select fonts.
Missing feature reported by bentley@.

Revision 1.65 / (download) - annotate - [select for diffs], Wed Jun 21 18:38:26 2017 UTC (6 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.64: +11 -12 lines
Diff to previous 1.64 (colored) to selected 1.19 (colored)

quoted words are not parsed for defined keys

Revision 1.64 / (download) - annotate - [select for diffs], Wed Jun 21 18:04:34 2017 UTC (6 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.63: +38 -17 lines
Diff to previous 1.63 (colored) to selected 1.19 (colored)

Recognize well-known functions names (the same that Heirloom recognizes,
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@.

Revision 1.63 / (download) - annotate - [select for diffs], Tue Jun 20 17:24:35 2017 UTC (6 years, 9 months ago) by schwarze
Branch: MAIN
Changes since 1.62: +71 -71 lines
Diff to previous 1.62 (colored) to selected 1.19 (colored)

KNF: remove parentheses from switch case labels; no binary change

Revision 1.62 / (download) - annotate - [select for diffs], Sat Mar 11 15:43:04 2017 UTC (7 years ago) by schwarze
Branch: MAIN
Changes since 1.61: +8 -3 lines
Diff to previous 1.61 (colored) to selected 1.19 (colored)

Improve detection of recursive eqn(7) "define" statements:
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).

Revision 1.61 / (download) - annotate - [select for diffs], Fri Jan 8 00:50:45 2016 UTC (8 years, 2 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_14_1, VERSION_1_13_4, VERSION_1_13
Changes since 1.60: +2 -2 lines
Diff to previous 1.60 (colored) to selected 1.19 (colored)

The root of an .EQ tree is always EQN_ROOT, never EQN_LIST,
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.

Revision 1.60 / (download) - annotate - [select for diffs], Thu Jan 7 20:19:01 2016 UTC (8 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.59: +2 -1 lines
Diff to previous 1.59 (colored) to selected 1.19 (colored)

Recursive "define" was not detected because "lim" was never
incremented, causing infinite loops.
Fixing CID 1288962.  From christos@ via wiz@, both at NetBSD.

Revision 1.59 / (download) - annotate - [select for diffs], Tue Oct 6 18:32:19 2015 UTC (8 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.58: +21 -21 lines
Diff to previous 1.58 (colored) to selected 1.19 (colored)

modernize style: "return" is not a function

Revision 1.58 / (download) - annotate - [select for diffs], Wed Mar 4 12:19:49 2015 UTC (9 years ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_13_3
Changes since 1.57: +4 -2 lines
Diff to previous 1.57 (colored) to selected 1.19 (colored)

in eqn, "prime" is equivalent to \(fm, and - is equivalent to \(mi;
patch from bentley@

Revision 1.57 / (download) - annotate - [select for diffs], Wed Jan 28 21:11:53 2015 UTC (9 years, 2 months ago) by schwarze
Branch: MAIN
Changes since 1.56: +73 -52 lines
Diff to previous 1.56 (colored) to selected 1.19 (colored)

Clean up eqn(7) error handling:
* 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.

Revision 1.56 / (download) - annotate - [select for diffs], Sat Oct 25 15:06:30 2014 UTC (9 years, 5 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_13_2
Changes since 1.55: +4 -2 lines
Diff to previous 1.55 (colored) to selected 1.19 (colored)

Fix a NULL pointer dereference reported
by Theo Buehler <theo at math dot ethz dot ch> on tech at openbsd:
Do not attempt to parse empty equations.

Revision 1.55 / (download) - annotate - [select for diffs], Sat Oct 25 14:35:37 2014 UTC (9 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.54: +2 -17 lines
Diff to previous 1.54 (colored) to selected 1.19 (colored)

Report arguments to .EQ as an error, and simplify the code:
* 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.

Revision 1.54 / (download) - annotate - [select for diffs], Thu Oct 16 01:11:20 2014 UTC (9 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.53: +27 -1 lines
Diff to previous 1.53 (colored) to selected 1.19 (colored)

Implement in-line equations, much needed by Xenocara manuals.
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.

Revision 1.53 / (download) - annotate - [select for diffs], Sun Oct 12 20:08:58 2014 UTC (9 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.52: +11 -1 lines
Diff to previous 1.52 (colored) to selected 1.19 (colored)

bugfix: do not parse quoted strings for tokens; fixes glFrustum(3)

Revision 1.52 / (download) - annotate - [select for diffs], Sun Oct 12 19:31:41 2014 UTC (9 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.51: +84 -102 lines
Diff to previous 1.51 (colored) to selected 1.19 (colored)

Improve error handling in the eqn(7) parser.
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.

Revision 1.51 / (download) - annotate - [select for diffs], Fri Oct 10 14:27:46 2014 UTC (9 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.50: +21 -22 lines
Diff to previous 1.50 (colored) to selected 1.19 (colored)

Drop trailing whitespace, adjust a few indentations,
and update Copyright year while here; no code change.

Revision 1.50 / (download) - annotate - [select for diffs], Fri Oct 10 14:02:02 2014 UTC (9 years, 5 months ago) by schwarze
Branch: MAIN
Changes since 1.49: +1 -4 lines
Diff to previous 1.49 (colored) to selected 1.19 (colored)

No need to assert() that a pointer is non-null right before dereferencing it.
The assert message contains no more information than the segfault.

Revision 1.49 / (download) - annotate - [select for diffs], Fri Oct 10 09:12:44 2014 UTC (9 years, 5 months ago) by kristaps
Branch: MAIN
Changes since 1.48: +2 -1 lines
Diff to previous 1.48 (colored) to selected 1.19 (colored)

Ignore "delim" command.
This fixes run-time assertions regarding "tok".

Revision 1.48 / (download) - annotate - [select for diffs], Fri Oct 10 08:44:24 2014 UTC (9 years, 5 months ago) by kristaps
Branch: MAIN
Changes since 1.47: +741 -612 lines
Diff to previous 1.47 (colored) to selected 1.19 (colored)

Re-write of eqn(7) parser and MathML output.
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.

Revision 1.47 / (download) - annotate - [select for diffs], Sun Sep 28 14:05:11 2014 UTC (9 years, 6 months ago) by kristaps
Branch: MAIN
Changes since 1.46: +7 -2 lines
Diff to previous 1.46 (colored) to selected 1.19 (colored)

Parse from/to clauses in eqn.

Revision 1.46 / (download) - annotate - [select for diffs], Sun Sep 28 11:32:08 2014 UTC (9 years, 6 months ago) by kristaps
Branch: MAIN
Changes since 1.45: +24 -6 lines
Diff to previous 1.45 (colored) to selected 1.19 (colored)

Add support for EQNPOS_SUBSUP and a doubly-linked eqn_box list.

Revision 1.45 / (download) - annotate - [select for diffs], Sun Aug 10 23:54:41 2014 UTC (9 years, 7 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_12_4, VERSION_1_12
Changes since 1.44: +3 -3 lines
Diff to previous 1.44 (colored) to selected 1.19 (colored)

Get rid of HAVE_CONFIG_H, it is always defined; idea from libnbcompat.
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.

Revision 1.44 / (download) - annotate - [select for diffs], Sun Jul 6 19:09:00 2014 UTC (9 years, 8 months ago) by schwarze
Branch: MAIN
CVS Tags: VERSION_1_13_1
Changes since 1.43: +2 -2 lines
Diff to previous 1.43 (colored) to selected 1.19 (colored)

Clean up messages related to plain text and to escape sequences.
* Mention invalid escape sequences and string names, and fallbacks.
* Hierarchical naming.

Revision 1.43 / (download) - annotate - [select for diffs], Fri Jul 4 16:12:08 2014 UTC (9 years, 8 months ago) by schwarze
Branch: MAIN
Changes since 1.42: +3 -2 lines
Diff to previous 1.42 (colored) to selected 1.19 (colored)

Clean up messages regarding excess arguments:
* Downgrade ".Bf -emphasis Em" from FATAL to WARNING.
* Mention the macros, the arguments, and the fallbacks.
* Hierarchical naming.

Revision 1.42 / (download) - annotate - [select for diffs], Wed Apr 23 21:06:41 2014 UTC (9 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.41: +3 -3 lines
Diff to previous 1.41 (colored) to selected 1.19 (colored)

Audit malloc(3)/calloc(3)/realloc(3) usage.
* 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).

Revision 1.41 / (download) - annotate - [select for diffs], Sun Apr 20 19:40:13 2014 UTC (9 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.40: +2 -2 lines
Diff to previous 1.40 (colored) to selected 1.19 (colored)

make sure static buffers for snprintf(3) are large enough
and cast snprintf return value to (void) where they are

Revision 1.40 / (download) - annotate - [select for diffs], Sun Apr 20 16:46:04 2014 UTC (9 years, 11 months ago) by schwarze
Branch: MAIN
Changes since 1.39: +31 -34 lines
Diff to previous 1.39 (colored) to selected 1.19 (colored)

KNF: case (FOO):  ->  case FOO:, remove /* LINTED */ and /* ARGSUSED */,
remove trailing whitespace and blanks before tabs, improve some indenting;
no functional change

Revision 1.39 / (download) - annotate - [select for diffs], Sun Mar 23 11:25:26 2014 UTC (10 years ago) by schwarze
Branch: MAIN
Changes since 1.38: +2 -1 lines
Diff to previous 1.38 (colored) to selected 1.19 (colored)

The files mandoc.c and mandoc.h contained both specialised low-level
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.

Revision 1.38 / (download) - annotate - [select for diffs], Mon Jul 25 15:37:00 2011 UTC (12 years, 8 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_12_3, VERSION_1_12_2, VERSION_1_12_1, VERSION_1_12_0, VERSION_1_11_7, VERSION_1_11_6
Changes since 1.37: +8 -5 lines
Diff to previous 1.37 (colored) to selected 1.19 (colored)

Implement the first steps of equation parsing from within libmdoc.
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.

Revision 1.37 / (download) - annotate - [select for diffs], Sat Jul 23 18:44:42 2011 UTC (12 years, 8 months ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_11_5
Changes since 1.36: +3 -1 lines
Diff to previous 1.36 (colored) to selected 1.19 (colored)

Note GNU extensions in eqn.7.  Also add `col' and `pile', which are
mentioned briefly in the eqn User's Manual, but otherwise are
unspecified.

Revision 1.36 / (download) - annotate - [select for diffs], Sat Jul 23 18:41:18 2011 UTC (12 years, 8 months ago) by kristaps
Branch: MAIN
Changes since 1.35: +55 -24 lines
Diff to previous 1.35 (colored) to selected 1.19 (colored)

Add support for tdefine and ndefine.  Consolidate some error messages.  Add
somem more version notes (getting there).  Have the equation nanme be captured.

Revision 1.35 / (download) - annotate - [select for diffs], Sat Jul 23 13:31:03 2011 UTC (12 years, 8 months ago) by kristaps
Branch: MAIN
Changes since 1.34: +8 -2 lines
Diff to previous 1.34 (colored) to selected 1.19 (colored)

Raise a warning when text follows the `EN'.

Revision 1.34 / (download) - annotate - [select for diffs], Sat Jul 23 12:10:16 2011 UTC (12 years, 8 months ago) by kristaps
Branch: MAIN
Changes since 1.33: +2 -1 lines
Diff to previous 1.33 (colored) to selected 1.19 (colored)

Add `fat' font.  This pretty much brings us in line with the second
edition of eqn.

Revision 1.33 / (download) - annotate - [select for diffs], Sat Jul 23 12:08:43 2011 UTC (12 years, 8 months ago) by kristaps
Branch: MAIN
Changes since 1.32: +30 -4 lines
Diff to previous 1.32 (colored) to selected 1.19 (colored)

Ignore `back', `fwd', `up', `down', `mark', and `lineup'.

Revision 1.32 / (download) - annotate - [select for diffs], Sat Jul 23 12:01:54 2011 UTC (12 years, 8 months ago) by kristaps
Branch: MAIN
Changes since 1.31: +57 -2 lines
Diff to previous 1.31 (colored) to selected 1.19 (colored)

Add matrix support.  Also remove "above" notion, as all elements in a
list are delimited by their "aboveness" and it's superfluous.

Revision 1.31 / (download) - annotate - [select for diffs], Sat Jul 23 09:47:25 2011 UTC (12 years, 8 months ago) by kristaps
Branch: MAIN
Changes since 1.30: +3 -2 lines
Diff to previous 1.30 (colored) to selected 1.19 (colored)

The circumflex is also a special space character.
Note this and clean up some documentation in eqn.7.
Also add some version notes, although I'm not ready for a release yet.

Revision 1.30 / (download) - annotate - [select for diffs], Fri Jul 22 14:59:02 2011 UTC (12 years, 8 months ago) by kristaps
Branch: MAIN
Changes since 1.29: +17 -2 lines
Diff to previous 1.29 (colored) to selected 1.19 (colored)

Check for and throw away `gfont' eqn macros.

Revision 1.29 / (download) - annotate - [select for diffs], Fri Jul 22 14:55:07 2011 UTC (12 years, 8 months ago) by kristaps
Branch: MAIN
Changes since 1.28: +32 -12 lines
Diff to previous 1.28 (colored) to selected 1.19 (colored)

Add support for `gsize' eqn token (introduced in second-edition troff).

Revision 1.28 / (download) - annotate - [select for diffs], Fri Jul 22 14:26:32 2011 UTC (12 years, 8 months ago) by kristaps
Branch: MAIN
Changes since 1.27: +88 -43 lines
Diff to previous 1.27 (colored) to selected 1.19 (colored)

Add all rendered symbols used by eqn.  I use the Second-Edition User's
Manual (1978) for this, so it should catch most of them.  They just map
into the mandoc_char escaped characters.

Revision 1.27 / (download) - annotate - [select for diffs], Fri Jul 22 13:40:15 2011 UTC (12 years, 8 months ago) by kristaps
Branch: MAIN
Changes since 1.26: +95 -1 lines
Diff to previous 1.26 (colored) to selected 1.19 (colored)

Support translating Greek characters in eqn.

Revision 1.26 / (download) - annotate - [select for diffs], Fri Jul 22 12:55:02 2011 UTC (12 years, 8 months ago) by kristaps
Branch: MAIN
Changes since 1.25: +8 -4 lines
Diff to previous 1.25 (colored) to selected 1.19 (colored)

Fix left/right nesting in eqn.

Revision 1.25 / (download) - annotate - [select for diffs], Fri Jul 22 10:36:58 2011 UTC (12 years, 8 months ago) by kristaps
Branch: MAIN
Changes since 1.24: +2 -2 lines
Diff to previous 1.24 (colored) to selected 1.19 (colored)

Protect macro expansion.

Revision 1.24 / (download) - annotate - [select for diffs], Fri Jul 22 10:22:47 2011 UTC (12 years, 8 months ago) by kristaps
Branch: MAIN
Changes since 1.23: +24 -29 lines
Diff to previous 1.23 (colored) to selected 1.19 (colored)

Use a macro instead of doing a string-fragment compare.  I just get
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.

Revision 1.23 / (download) - annotate - [select for diffs], Fri Jul 22 09:57:04 2011 UTC (12 years, 8 months ago) by kristaps
Branch: MAIN
Changes since 1.22: +51 -36 lines
Diff to previous 1.22 (colored) to selected 1.19 (colored)

Give lists their own eqn function.

Revision 1.22 / (download) - annotate - [select for diffs], Fri Jul 22 00:16:37 2011 UTC (12 years, 8 months ago) by kristaps
Branch: MAIN
Changes since 1.21: +17 -5 lines
Diff to previous 1.21 (colored) to selected 1.19 (colored)

Accomodate for hard-spaces with tildes.  For now, consider them regular
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.

Revision 1.21 / (download) - annotate - [select for diffs], Thu Jul 21 23:42:28 2011 UTC (12 years, 8 months ago) by kristaps
Branch: MAIN
Changes since 1.20: +15 -18 lines
Diff to previous 1.20 (colored) to selected 1.19 (colored)

Fix eqn handling of PILE clauses (multiple ABOVE statements may be
specified for each PILE).

Revision 1.20 / (download) - annotate - [select for diffs], Thu Jul 21 23:30:39 2011 UTC (12 years, 8 months ago) by kristaps
Branch: MAIN
Changes since 1.19: +232 -117 lines
Diff to previous 1.19 (colored)

Complete eqn.7 parsing.  Features all productions from the original 1975
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.

Revision 1.19 / (download) - annotate - [selected], Thu Jul 21 15:21:13 2011 UTC (12 years, 8 months ago) by kristaps
Branch: MAIN
Changes since 1.18: +13 -3 lines
Diff to previous 1.18 (colored)

Support `size' constructs in eqn.7.  Generalise mandoc_strontou to this
effect.

Revision 1.18 / (download) - annotate - [select for diffs], Thu Jul 21 14:13:00 2011 UTC (12 years, 8 months ago) by kristaps
Branch: MAIN
Changes since 1.17: +22 -3 lines
Diff to previous 1.17 (colored) to selected 1.19 (colored)

Full support for eqn positionals (above, over, sup, sub, etc.).

Revision 1.17 / (download) - annotate - [select for diffs], Thu Jul 21 13:37:04 2011 UTC (12 years, 8 months ago) by kristaps
Branch: MAIN
Changes since 1.16: +32 -13 lines
Diff to previous 1.16 (colored) to selected 1.19 (colored)

Add eqn subexpression fonts.

Revision 1.16 / (download) - annotate - [select for diffs], Thu Jul 21 13:18:24 2011 UTC (12 years, 8 months ago) by kristaps
Branch: MAIN
Changes since 1.15: +34 -6 lines
Diff to previous 1.15 (colored) to selected 1.19 (colored)

Add support for markers.  These decorate the last box: see eqn.7.

Revision 1.15 / (download) - annotate - [select for diffs], Thu Jul 21 12:30:44 2011 UTC (12 years, 8 months ago) by kristaps
Branch: MAIN
Changes since 1.14: +50 -11 lines
Diff to previous 1.14 (colored) to selected 1.19 (colored)

Support nested `{, }' subexpressions in eqn.  Document in code.

Revision 1.14 / (download) - annotate - [select for diffs], Thu Jul 21 11:57:56 2011 UTC (12 years, 8 months ago) by kristaps
Branch: MAIN
Changes since 1.13: +22 -16 lines
Diff to previous 1.13 (colored) to selected 1.19 (colored)

Make `undef' not expand its argument before undefining it.  Document
this and have the same behaviour apply to `set' and `define'.

Revision 1.13 / (download) - annotate - [select for diffs], Thu Jul 21 11:34:53 2011 UTC (12 years, 8 months ago) by kristaps
Branch: MAIN
Changes since 1.12: +65 -32 lines
Diff to previous 1.12 (colored) to selected 1.19 (colored)

Flip eqn into using parsed nodes.  I've temporarily disabled printing
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.

Revision 1.12 / (download) - annotate - [select for diffs], Thu Jul 21 10:24:35 2011 UTC (12 years, 8 months ago) by kristaps
Branch: MAIN
Changes since 1.11: +181 -185 lines
Diff to previous 1.11 (colored) to selected 1.19 (colored)

Finish the eqn syntactic parser.  This correctly parses terms and does
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.

Revision 1.11 / (download) - annotate - [select for diffs], Mon Jul 18 13:35:07 2011 UTC (12 years, 8 months ago) by kristaps
Branch: MAIN
Changes since 1.10: +30 -8 lines
Diff to previous 1.10 (colored) to selected 1.19 (colored)

Definitions in eqn.7 are actually recursive.  Do this and add crude
protection that we don't nest back to ourselves.

Revision 1.10 / (download) - annotate - [select for diffs], Sun Jul 17 14:15:11 2011 UTC (12 years, 8 months ago) by kristaps
Branch: MAIN
Changes since 1.9: +1 -3 lines
Diff to previous 1.9 (colored) to selected 1.19 (colored)

Fix lost allocation.

Revision 1.9 / (download) - annotate - [select for diffs], Sun Jul 17 14:11:25 2011 UTC (12 years, 8 months ago) by kristaps
Branch: MAIN
Changes since 1.8: +2 -1 lines
Diff to previous 1.8 (colored) to selected 1.19 (colored)

Remember to NULL-ify new keys/vals.

Revision 1.8 / (download) - annotate - [select for diffs], Sun Jul 17 14:08:49 2011 UTC (12 years, 8 months ago) by kristaps
Branch: MAIN
Changes since 1.7: +198 -57 lines
Diff to previous 1.7 (colored) to selected 1.19 (colored)

Provide implementations of `define', `set', and `unset'.
Tie them into the stream of data.
Document these appropriate, bringing in the grammar as defined by the
original eqn manual (Kernighan/Richie).

Revision 1.7 / (download) - annotate - [select for diffs], Sun Jul 17 12:52:54 2011 UTC (12 years, 8 months ago) by kristaps
Branch: MAIN
Changes since 1.6: +17 -5 lines
Diff to previous 1.6 (colored) to selected 1.19 (colored)

Warn if equation `define' key is quoted (groff-ism).

Revision 1.6 / (download) - annotate - [select for diffs], Sun Jul 17 12:13:37 2011 UTC (12 years, 8 months ago) by kristaps
Branch: MAIN
Changes since 1.5: +112 -7 lines
Diff to previous 1.5 (colored) to selected 1.19 (colored)

Add initial `define' support for eqn(7).
This works by iterating over a simple list.  It's a slow, auditable
early implementation.  Data is read (the reading function will be
reused) then parsed, then the line re-run if remaining stuff exists.
Note this function isn't the same as mandoc_getarg(), as eqn(7) uses a
different system for reading quoted strings.
This doesn't actually use the defines.

Revision 1.5 / (download) - annotate - [select for diffs], Tue Jul 12 21:32:43 2011 UTC (12 years, 8 months ago) by kristaps
Branch: MAIN
Changes since 1.4: +4 -2 lines
Diff to previous 1.4 (colored) to selected 1.19 (colored)

Have equation be allocated with mparse.  Will be needed for logging of
messages.

Revision 1.4 / (download) - annotate - [select for diffs], Tue Mar 22 09:48:13 2011 UTC (13 years ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_11_4, VERSION_1_11_3, VERSION_1_11_2, VERSION_1_11_1
Changes since 1.3: +1 -2 lines
Diff to previous 1.3 (colored) to selected 1.19 (colored)

Step 1 of restructuring: libmandoc.h.  Move all compiler-set-specific
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.

Revision 1.3 / (download) - annotate - [select for diffs], Tue Mar 15 16:23:51 2011 UTC (13 years ago) by kristaps
Branch: MAIN
CVS Tags: VERSION_1_10_10
Changes since 1.2: +2 -1 lines
Diff to previous 1.2 (colored) to selected 1.19 (colored)

Make lint shut up a little bit.

Revision 1.2 / (download) - annotate - [select for diffs], Wed Feb 9 09:05:52 2011 UTC (13 years, 1 month ago) by kristaps
Branch: MAIN
Changes since 1.1: +3 -3 lines
Diff to previous 1.1 (colored) to selected 1.19 (colored)

Allow EQN data to be pushed down into libmdoc via mdoc_addeqn().  Only
the adding itself is implemented; equation data is not yet shown.

Revision 1.1 / (download) - annotate - [select for diffs], Sun Feb 6 20:36:36 2011 UTC (13 years, 1 month ago) by kristaps
Branch: MAIN
Diff to selected 1.19 (colored)

Add initial EQN support to mandoc.  This parses, then throws away, data
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.

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.




CVSweb