summaryrefslogtreecommitdiff
path: root/Source/Dafny/Printer.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Dafny/Printer.cs')
-rw-r--r--Source/Dafny/Printer.cs15
1 files changed, 13 insertions, 2 deletions
diff --git a/Source/Dafny/Printer.cs b/Source/Dafny/Printer.cs
index 145e82e7..0a25b941 100644
--- a/Source/Dafny/Printer.cs
+++ b/Source/Dafny/Printer.cs
@@ -841,11 +841,22 @@ namespace Microsoft.Dafny {
wr.Write("}");
} else if (stmt is ForallStmt) {
- var s = (ForallStmt)stmt;
+ var s = (ForallStmt)stmt;
+ Attributes attributes = s.Attributes;
+ if (attributes == null && s.ForallExpressions != null) {
+ foreach (Expression expr in s.ForallExpressions) {
+ ForallExpr e = (ForallExpr)expr;
+ while (e != null && attributes == null) {
+ attributes = e.Attributes;
+ e = (ForallExpr)e.SplitQuantifierExpression;
+ }
+ if (attributes != null) { break; }
+ }
+ }
wr.Write("forall");
if (s.BoundVars.Count != 0) {
wr.Write(" ");
- PrintQuantifierDomain(s.BoundVars, s.Attributes, s.Range);
+ PrintQuantifierDomain(s.BoundVars, attributes, s.Range);
}
if (s.Ens.Count == 0) {
wr.Write(" ");