commit | e6912f90d663120b32b894d1f10a0d8cd530e2e7 | [log] [tgz] |
---|---|---|
author | Andy Chu <andychu@google.com> | Tue Mar 15 13:52:25 2016 -0700 |
committer | Rob Landley <rob@landley.net> | Wed Mar 16 11:59:59 2016 -0500 |
tree | 08dda2bf28fd14768ddfa4f4e490539dcb631af3 | |
parent | 14c91c1ebd68daacce9794cf8894dcfea68efd7b [diff] |
Fix type coercion bugs in expr. 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.