diff options
author | leino <unknown> | 2015-10-23 18:30:11 -0700 |
---|---|---|
committer | leino <unknown> | 2015-10-23 18:30:11 -0700 |
commit | 628acc07a07bd5516551dc2caa2c4612f70d2688 (patch) | |
tree | ae7493acba23e7c238ea8240b9f49ad38e9e244e /Source/Dafny/Cloner.cs | |
parent | ad8e5120533bbc694ecd81fccfa095a18a79cb84 (diff) |
Introduced new datatype update syntax: D.(f := E)
The old syntax, D[f := E], is still supported for a short while, but generates a warning about that syntax being deprecated.
The new syntax also supports multiple updates: D.(f := E0, g := E1, h := E2)
Diffstat (limited to 'Source/Dafny/Cloner.cs')
-rw-r--r-- | Source/Dafny/Cloner.cs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Source/Dafny/Cloner.cs b/Source/Dafny/Cloner.cs index 9a93a340..1c4275c5 100644 --- a/Source/Dafny/Cloner.cs +++ b/Source/Dafny/Cloner.cs @@ -323,6 +323,10 @@ namespace Microsoft.Dafny var e = (SeqUpdateExpr)expr;
return new SeqUpdateExpr(Tok(e.tok), CloneExpr(e.Seq), CloneExpr(e.Index), CloneExpr(e.Value));
+ } else if (expr is DatatypeUpdateExpr) {
+ var e = (DatatypeUpdateExpr)expr;
+ return new DatatypeUpdateExpr(Tok(e.tok), CloneExpr(e.Root), e.Updates.ConvertAll(t => Tuple.Create(Tok(t.Item1), t.Item2, CloneExpr(t.Item3))));
+
} else if (expr is FunctionCallExpr) {
var e = (FunctionCallExpr)expr;
return new FunctionCallExpr(Tok(e.tok), e.Name, CloneExpr(e.Receiver), e.OpenParen == null ? null : Tok(e.OpenParen), e.Args.ConvertAll(CloneExpr));
|