Age | Commit message (Collapse) | Author |
|
Fix memory leaks in regex. Simplify regex check (if we matched, subexpression
had to match). Don't exit() from a command, set exitval and return.
|
|
eliminate syntax_error() function (just call error_exit() directly),
eliminate advance() wrapper, pipe expected error messages in test to /dev/null
|
|
All tests pass now; this fixes the 2 remaining failures, including a
segfault.
The structure of the code has changed a lot -- instead of having a tiny
function per operator, we have eval_op() which does common type coercion
and then evaluates the operator. I tried writing it a couple different
ways, and this was the cleanest.
The OPS table now contains the operator string, precedence level,
signature for type coercion, and operator ID.
|
|
expr now uses the precedence table specified by POSIX, implemented using
the "precedence climbing" algorithm. See the references at the top of
eval_expr().
This fixes 3 of 4 failing tests.
I also added more tests for correct behavior and for syntax errors.
This includes a new test exposing a segfault, related to type coercion.
|
|
|
|
|
|
with the one in pending.
|
|
|
|
and make ctrl-c kill "make test" more reliably.
|