From 3060eadcbabba50fd6a5d633fea710b6b6bed614 Mon Sep 17 00:00:00 2001 From: Tim Chevalier Date: Mon, 2 May 2011 14:28:35 -0700 Subject: Check well-formedness of constraints Check that the operand in a constraint is an explicit name, and that the operands are all local variables or literals. Still need to check that the name refers to a pure function. --- src/comp/front/ast.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/comp/front') diff --git a/src/comp/front/ast.rs b/src/comp/front/ast.rs index 1f123f74..cc7569e1 100644 --- a/src/comp/front/ast.rs +++ b/src/comp/front/ast.rs @@ -563,6 +563,20 @@ fn is_call_expr(@expr e) -> bool { } } +fn is_constraint_arg(@expr e) -> bool { + alt (e.node) { + case (expr_lit(_,_)) { + ret true; + } + case (expr_path(_, option.some[def](def_local(_)), _)) { + ret true; + } + case (_) { + ret false; + } + } +} + // // Local Variables: // mode: rust -- cgit v1.2.3