aboutsummaryrefslogtreecommitdiff
path: root/src/comp/front
diff options
context:
space:
mode:
authorTim Chevalier <[email protected]>2011-05-02 14:28:35 -0700
committerGraydon Hoare <[email protected]>2011-05-05 11:26:07 -0700
commit3060eadcbabba50fd6a5d633fea710b6b6bed614 (patch)
tree600e724e9e29f38bddd2861c006f4da49e7fa2ee /src/comp/front
parentChange checks to asserts in test/bench files (diff)
downloadrust-3060eadcbabba50fd6a5d633fea710b6b6bed614.tar.xz
rust-3060eadcbabba50fd6a5d633fea710b6b6bed614.zip
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.
Diffstat (limited to 'src/comp/front')
-rw-r--r--src/comp/front/ast.rs14
1 files changed, 14 insertions, 0 deletions
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