* Provide some GNUisms as extensions.
* Provide dynamically growable string space.
* Make define(defn(foo)) work correctly for builtins.
(The current version is supposed to be capable of satisfying autoconf.)
All still relevant NetBSD changes have been preserved in this version, and
formatting and style fixes have been applied in various places.
Thanks to Masao Uebayashi <uebayasi@soum.co.jp> for pointing this out.
make sure that pushed-back 0xff character isn't accidentally
interpreted as an EOF because of sign extension when chars were being
assigned to pbents. (signed-char machines lost.) To do this, make
putback() and pbstr() operate only on unsigned chars, and add a
putbackeof() function to do the obvious thing when necessary.
that typedef 'short'. 'char' (which was previously used) because char
may be unsigned and ((char)EOF) != EOF if that is the case. That was
causing the (char)EOF (0xff) pushed back in main to be interepreted as
a character, and, in some cases, to be written to the output. 'short'
was used rather than 'signed char' because if the latter is used,
0xff characters in the input would confuse m4. (No point in introducing
(more?) 8-bit lossage.)
quotes. E.g. if left quote was "``" and right quote was "''", then
"``foo ``bar'' baz''" would yield "foo `bar' baz" when it should yield
"foo ``bar'' baz".
it uses pbstr() instead of doing the characters individually (in
reverse order) with putback().
Fix dodiv() so that divert(<out-of-range stream>) doesn't cause "divnum" to
return 0, but rather the stream number specified to divert(). Macros
like PUSHDIVERT/POPDIVERT rely on this. The new behaviour is compatible
with vendor m4 implementations.
in `The M4 Macro Processor', by Kernighan and Ritchie.
* `|' and `||' are both logical or. There is no binary or.
* `&' and `&&' are both logical and. There is no binary and.
* `!' has a much higher precedence.
* The equal and relation operators have the same precedence.
* `**' is implemented, and `^' is for exponentation (not xor).
* Unary `+' in implemented.
I've coded exponentiation to return what appears to be the same results
that other versions of m4 return.