From e162455ebb545ea33580e58f52ebe424ef9e68fa Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sun, 5 Sep 2010 01:38:47 -0400 Subject: Minor simplifications to valexpr parser The most significant change is the way CONS sequences are parsed, and that now instead of =/:=, the operators are ==/=. --- src/compare.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/compare.cc') diff --git a/src/compare.cc b/src/compare.cc index 99e430a7..12114c7d 100644 --- a/src/compare.cc +++ b/src/compare.cc @@ -42,8 +42,10 @@ void push_sort_value(std::list& sort_values, expr_t::ptr_op_t node, scope_t& scope) { if (node->kind == expr_t::op_t::O_CONS) { - push_sort_value(sort_values, node->left(), scope); - push_sort_value(sort_values, node->right(), scope); + while (node && node->kind == expr_t::op_t::O_CONS) { + push_sort_value(sort_values, node->left(), scope); + node = node->right(); + } } else { bool inverted = false; @@ -54,7 +56,7 @@ void push_sort_value(std::list& sort_values, sort_values.push_back(sort_value_t()); sort_values.back().inverted = inverted; - sort_values.back().value = expr_t(node).calc(scope).simplified(); + sort_values.back().value = expr_t(node).calc(scope).simplified(); if (sort_values.back().value.is_null()) throw_(calc_error, -- cgit v1.2.3