Commit graph

36 commits

Author SHA1 Message Date
Paul Beckingham
9e0ea1cb4a Eval
- Better error message for malformed expressions, ie when a binary operator
  expects two values, and sees less then two or when a unary operator sees
  less than one.
2014-09-27 17:08:26 -04:00
Paul Beckingham
071cf55c00 Unit Tests
- Added a default 'hooks=off' to the basetest class, after it was discovered
  that the scan for runnable hooks takes non-trivial time.
2014-09-27 16:49:06 -04:00
Paul Beckingham
a77e50b441 Eval
- Converted from std::cout to Context::debug.  This is in preparation for
  supporting multiple debug levels.
2014-08-31 10:20:18 -04:00
Paul Beckingham
70156d3c3d L10N
- Localized Eval.
2014-07-04 17:40:11 -04:00
Paul Beckingham
d54afc844c Eval
- Improved formatting for diagnostics.
2014-06-28 12:40:27 -04:00
Paul Beckingham
0c4c665653 Eval
- Diagnostics now represent correct stack size.
2014-06-28 12:35:43 -04:00
Paul Beckingham
80c8daff08 Eval
- Removed Eval diagnostics that dispalyed the wrong type.
2014-06-28 12:33:22 -04:00
Paul Beckingham
f72aa7b02c Eval
- Updated Eval runtime diagnostics, so that all stack I/O is shown during
  evaluation.
2014-06-24 22:15:59 -04:00
Paul Beckingham
b7d668fb7d Eval
- Raises an exception if an expression evaluation yields an unexpected
  stack size at the end. This indicates that an expression like 'one two'
  was evaluated. Note that string field updates require evaluation, but
  this case occurs frequently.
2014-06-15 09:32:17 -04:00
Paul Beckingham
9318dced5a Eval
- Eval maps '!==' to Variant::operator!=, '!=' to Variant::operator_nopartial,
  '==' to Variant::operator== and '=' to Variant::operator_partial.
2014-06-14 15:59:31 -04:00
Paul Beckingham
05d4ac16a3 Eval
- Now prints the evaluated form, instead of the input form in debug mode, after
  successful source lookup.
2014-06-09 18:01:45 -04:00
Paul Beckingham
512fe2f6c7 Variant
- ::operator_match and ::operator_nomatch now take a 'const Task&' argument to
  use for description/annotation matching.
- Updated unit tests.
2014-06-03 01:27:02 -04:00
Paul Beckingham
ca6940ba2e Variant
::operator_hastag now uses contextTask for resolution.
2014-06-03 01:10:58 -04:00
Paul Beckingham
e88ccee1e6 Eval
- Added the new Variant::operator_hastag and Variant::operator_notag operators
  to the expression evaluator. All operators now implemented, at least in
  stubbed form.
2014-05-26 21:05:38 -04:00
Paul Beckingham
70620366c4 Eval
- Filter token diagnostics are color coded.
2014-05-26 12:55:22 -04:00
Paul Beckingham
bba0b75a3b Eval
- Cleaned up debug FILTER diagnostics.
2014-05-26 12:16:44 -04:00
Paul Beckingham
949063102a Diagnostics
- Further removal of diagnostic output.
2014-05-25 14:59:09 -04:00
Paul Beckingham
4a4cdd6324 Eval
- Removed more diagnostics.
2014-05-25 14:30:02 -04:00
Paul Beckingham
d62c4428a9 Eval
- Removed exception handlers in ::infixParse, thereby relying on the caller to
  set up appropriate handling.
2014-05-25 14:26:20 -04:00
Paul Beckingham
d79c86ebb5 Eval
- ::dump method now colorizeѕ tokens according to a map.
2014-05-25 14:22:19 -04:00
Paul Beckingham
fee493bcc0 Eval
- Removed std::cout diagnostics, stubbed the A3::dump replacement.
2014-05-25 14:11:55 -04:00
Paul Beckingham
6b2a71770d Code Cleanup
- Removed unnecessary diagnostics.
2014-05-25 13:48:26 -04:00
Paul Beckingham
cdf9f3c04e Eval
- Protection against array overrun.
- Typo in diagnostic output.
2014-05-23 15:49:15 -04:00
Paul Beckingham
42f3419bd3 Eval
- Added range checking to the while loop for the parser, to prevent
  runnig over, which caused some of the problems with segfaults on
  Debian & Ubuntu.
2014-05-22 22:52:23 -04:00
Paul Beckingham
d9e1607f05 Eval
- Attempts named source resolution as part of primitive parsing.
2014-05-19 22:06:58 -04:00
Paul Beckingham
592b3bdcb9 Eval
- Connected operator '=' to Variant::operator_partial.
2014-05-19 20:13:35 -04:00
Paul Beckingham
468e02c73b Eval
- Marked the partial match operator as needing special consideration for
  proejct and UUID.
2014-05-12 00:17:36 -04:00
Paul Beckingham
a97ce45cdf Eval
- Debug mode can now be disabled.
2014-05-11 10:15:10 -04:00
Paul Beckingham
fcb039f801 Eval
- Labeled the (now differentiated) = and == operators.
2014-05-02 23:09:00 -04:00
Paul Beckingham
e3a1789b3f Eval
- Added support for compiled expressions that are compiled once and
  evaluated multiple times in different contexts.
2014-04-27 10:07:11 -07:00
Paul Beckingham
bf30fb3085 Eval
- Added Eval::getOperators to expose suported operator symbols.
2014-04-16 00:38:43 -04:00
Paul Beckingham
05c90b1779 Bug
- Fixed bug in named entity lookup.
- Removed obsolete failing test.
2014-04-12 12:28:48 -04:00
Paul Beckingham
25b8082fbd Diagnostics
- Added diagnostic token dump to 'calc' in debug mode, after token substitution
  so the new tokens can be seen.
- Added unit tests to look for parser syntax errors.
- Added test for '2--3'.
2014-04-06 23:57:15 -04:00
Paul Beckingham
70ba19fd5e Bug TW-1254
- TW-1254 Calc command can segfault on negative numbers (thanks to Renato
          Alves).
- Implemented a recursive descent parser to syntax check the expression,
  and disambiguate unary minus. The syntax checking is not generating any
  diagnostics yet.
2014-04-06 00:29:14 -04:00
Paul Beckingham
f05b01f9fa Eval
- Enabled unary minus operator.
2014-03-14 23:46:14 -04:00
Paul Beckingham
0fd9c495bc Eval
- Merged libexpr Eval support.
2014-01-02 01:25:18 -05:00