From 47d140d72be67d5bcca50c68faabeb096a8e20d4 Mon Sep 17 00:00:00 2001 From: kyessenov Date: Sat, 9 Oct 2010 06:44:08 +0000 Subject: Chalice: permit replaces by to match assign clauses --- Chalice/src/Ast.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Chalice') 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) -- cgit v1.2.3