summaryrefslogtreecommitdiff
path: root/Source/Dafny/Printer.cs
diff options
context:
space:
mode:
authorGravatar leino <unknown>2015-08-11 19:07:42 -0700
committerGravatar leino <unknown>2015-08-11 19:07:42 -0700
commit3bf4b44b821dca5017017e99502f263e636d5e84 (patch)
treeb9a2f6d58de3e17db6a49b5177dbd49a9cc9fdfe /Source/Dafny/Printer.cs
parent2a921fb2a765d91bba47901144845b0102edbcbb (diff)
Moved discovery of induction variables into a Rewriter.
Generate warnings for malformed :induction arguments. Removed the functionality that allowed induction on 'this'.
Diffstat (limited to 'Source/Dafny/Printer.cs')
-rw-r--r--Source/Dafny/Printer.cs8
1 files changed, 4 insertions, 4 deletions
diff --git a/Source/Dafny/Printer.cs b/Source/Dafny/Printer.cs
index 1fa90e41..7a93a140 100644
--- a/Source/Dafny/Printer.cs
+++ b/Source/Dafny/Printer.cs
@@ -109,11 +109,11 @@ namespace Microsoft.Dafny {
}
}
- public static string OneAttributeToString(Attributes a) {
+ public static string OneAttributeToString(Attributes a, string nameSubstitution = null) {
Contract.Requires(a != null);
using (var wr = new System.IO.StringWriter()) {
var pr = new Printer(wr);
- pr.PrintOneAttribute(a);
+ pr.PrintOneAttribute(a, nameSubstitution);
return ToStringWithoutNewline(wr);
}
}
@@ -441,9 +441,9 @@ namespace Microsoft.Dafny {
PrintOneAttribute(a);
}
}
- public void PrintOneAttribute(Attributes a) {
+ public void PrintOneAttribute(Attributes a, string nameSubstitution = null) {
Contract.Requires(a != null);
- wr.Write(" {{:{0}", a.Name);
+ wr.Write(" {{:{0}", nameSubstitution ?? a.Name);
if (a.Args != null) {
PrintAttributeArgs(a.Args, false);
}