summaryrefslogtreecommitdiff
path: root/Source/Dafny/Printer.cs
diff options
context:
space:
mode:
authorGravatar chmaria <unknown>2013-07-11 11:45:00 -0700
committerGravatar chmaria <unknown>2013-07-11 11:45:00 -0700
commit4eb70b6a0d4f4e2cedff4d4014911127d320a3b9 (patch)
tree6f1f37a4e70dfd30228e8483a2fbf5e8d2632ba8 /Source/Dafny/Printer.cs
parent139f5b8e0901d33703a687892b6eac93c879ef08 (diff)
Fixed printer bug to handle static receivers in function call expressions. (Thanks to Patrick Spettel.)
Diffstat (limited to 'Source/Dafny/Printer.cs')
-rw-r--r--Source/Dafny/Printer.cs11
1 files changed, 7 insertions, 4 deletions
diff --git a/Source/Dafny/Printer.cs b/Source/Dafny/Printer.cs
index 3f6203b0..0f5801e7 100644
--- a/Source/Dafny/Printer.cs
+++ b/Source/Dafny/Printer.cs
@@ -672,9 +672,9 @@ namespace Microsoft.Dafny {
if (!s.Op.Equals(op)) {
PrintCalcOp(op);
wr.Write(" ");
- }
+ }
PrintExpression(e, lineInd);
- wr.WriteLine(";");
+ wr.WriteLine(";");
}
Indent(indent);
wr.Write("}");
@@ -990,7 +990,10 @@ namespace Microsoft.Dafny {
Contract.Requires(-1 <= indent);
Contract.Requires(expr != null);
- if (expr is LiteralExpr) {
+ if (expr is StaticReceiverExpr) {
+ StaticReceiverExpr e = (StaticReceiverExpr)expr;
+ wr.Write(e.Type);
+ } else if (expr is LiteralExpr) {
LiteralExpr e = (LiteralExpr)expr;
if (e.Value == null) {
wr.Write("null");
@@ -1354,7 +1357,7 @@ namespace Microsoft.Dafny {
var e = (NamedExpr)expr;
wr.Write("expr {0}: ", e.Name);
PrintExpression(e.Body);
-
+
} else if (expr is SetComprehension) {
var e = (SetComprehension)expr;
bool parensNeeded = !isRightmost;