by writing compiled output into a token queue, then running
an emphasis maker on that queue. The token queue is an array
of TEXT and EMPHASIS tokens -- `TEXT` being what you'd expect,
and `EMPHASIS` holding counts of consecutive emphasis characters.
It's easier to explain with pretty pictures:
During the process of compiling the string `***HI***`, it gets
broken into five tokens:
1. TEXT `<p>`
2. EMPHASIS `*`3
3. TEXT `HI`
4. EMPHASIS `*`3
5. TEXT `</p>`
and then pasted together into a compiled document. During the
pasting, emphasis tokens are paired with the next matching emphasis
token, then rewritten into two text sections (opens & closes) which
are treated as normal text during the pasting.
The above tokens are processed like so; first to
1. TEXT `<p>`
2. EMPHASIS `*`1 [] [`<strong>`]
3. TEXT `HI`
4. EMPHASIS `*`1 [`</strong>`] []
5. TEXT `</p>`
then to
1. TEXT `<p>`
2. EMPHASIS `*`0 [] [`<strong><em>`]
3. TEXT `HI`
4. EMPHASIS `*`0 [`</em></strong>`] []
5. TEXT `</p>`
which is then concatenated to
<p><strong><em>HI</em></strong></p>
And Bob's your uncle.
--enable-amalloc) replaced malloc and its ilk with
versions that attempt to maintain a linked list of
allocated blocks that can be printed to stderr with
the `adump()` function.
2. Clean up a couple more places where I leak memory
during the first level parse.
3. tweak cstring.h to try to chase down places where
the C compiler might optimize EXPAND() into producing
broken code.