diff options
Diffstat (limited to 'Source/Dafny/Printer.ssc')
-rw-r--r-- | Source/Dafny/Printer.ssc | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/Source/Dafny/Printer.ssc b/Source/Dafny/Printer.ssc index 6f3629d6..1779f46b 100644 --- a/Source/Dafny/Printer.ssc +++ b/Source/Dafny/Printer.ssc @@ -143,21 +143,25 @@ namespace Microsoft.Dafny { PrintAttributes(a.Prev);
wr.Write("{ :{0}", a.Name);
- string prefix = " ";
- foreach (Attributes.Argument arg in a.Args) {
- wr.Write(prefix);
- prefix = ", ";
- if (arg.S != null) {
- wr.Write("\"{0}\"", arg.S);
- } else {
- assert arg.E != null;
- PrintExpression(arg.E);
- }
- }
+ PrintAttributeArgs(a.Args);
wr.Write(" } ");
}
}
+ public void PrintAttributeArgs(List<Attributes.Argument!>! args) {
+ string prefix = " ";
+ foreach (Attributes.Argument arg in args) {
+ wr.Write(prefix);
+ prefix = ", ";
+ if (arg.S != null) {
+ wr.Write("\"{0}\"", arg.S);
+ } else {
+ assert arg.E != null;
+ PrintExpression(arg.E);
+ }
+ }
+ }
+
public void PrintField(Field! field, int indent) {
Indent(indent);
if (field.IsGhost) {
@@ -333,6 +337,12 @@ namespace Microsoft.Dafny { PrintExpression(((UseStmt)stmt).Expr);
wr.Write(";");
+ } else if (stmt is PrintStmt) {
+ PrintStmt s = (PrintStmt)stmt;
+ wr.Write("print");
+ PrintAttributeArgs(s.Args);
+ wr.Write(";");
+
} else if (stmt is LabelStmt) {
wr.Write("label {0}:", ((LabelStmt)stmt).Label);
|