~yerinalexey/csq

bfc33e58f19831882e6e7f178104babeb577272f — Alexey Yerin a month ago 0019ab9 master
Improve validation of impure expressions
1 files changed, 8 insertions(+), 0 deletions(-)

M parse.ha
M parse.ha => parse.ha +8 -0
@@ 39,6 39,14 @@ fn expr_pure(e: *expr) bool = {
	match (*e) {
	case let opt: option_expr =>
		return !(opt.1 is *expr);
	case let op: op_expr =>
		return expr_pure(op.lhs) && expr_pure(op.rhs);
	case let s: sqrt_expr =>
		return expr_pure(s);
	case let n: negate_expr =>
		return expr_pure(n);
	case let f: factorial_expr =>
		return expr_pure(f);
	case =>
		return true;
	};