diff options
author | kyessenov <unknown> | 2010-10-09 06:44:08 +0000 |
---|---|---|
committer | kyessenov <unknown> | 2010-10-09 06:44:08 +0000 |
commit | 47d140d72be67d5bcca50c68faabeb096a8e20d4 (patch) | |
tree | 2a2ce84b15cd6ea38ad0f089c32cd2071a673af6 /Chalice | |
parent | 269dc18327a1398372b704918c0621117baad8f0 (diff) |
Chalice: permit replaces by to match assign clauses
Diffstat (limited to 'Chalice')
-rw-r--r-- | Chalice/src/Ast.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Chalice/src/Ast.scala b/Chalice/src/Ast.scala index bd524ec3..2c9970c6 100644 --- a/Chalice/src/Ast.scala +++ b/Chalice/src/Ast.scala @@ -249,6 +249,7 @@ case class NonDetPat(is: List[String], code: List[Statement]) extends Transform def matches(s: Statement) = s match {
case _:Call => true
case _:SpecStmt => true
+ case _:Assign => true // declarative
case _ => false
}
}
@@ -621,8 +622,7 @@ object AST { case _ => Unmatched(wp)
}
// non det pat
- case (l @ List(_: Call), NonDetPat(_, code)) => new Matched(RefinementBlock(code, l))
- case (l @ List(_: SpecStmt), NonDetPat(_, code)) => new Matched(RefinementBlock(code, l))
+ case (l @ List(s), ndp @ NonDetPat(_, code)) if ndp matches s => new Matched(RefinementBlock(code, l))
// insert pat
case (Nil, InsertPat(code)) => new Matched(RefinementBlock(code, Nil))
// block pattern (greedy matching)
|