summaryrefslogtreecommitdiff
path: root/Dafny/DafnyAst.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Dafny/DafnyAst.cs')
-rw-r--r--Dafny/DafnyAst.cs20
1 files changed, 20 insertions, 0 deletions
diff --git a/Dafny/DafnyAst.cs b/Dafny/DafnyAst.cs
index 2d6d353c..39bfbdd3 100644
--- a/Dafny/DafnyAst.cs
+++ b/Dafny/DafnyAst.cs
@@ -1279,6 +1279,9 @@ namespace Microsoft.Dafny {
string/*!*/ Name {
get;
}
+ string/*!*/ DisplayName { // what the user thinks he wrote
+ get;
+ }
string/*!*/ UniqueName {
get;
}
@@ -1303,6 +1306,12 @@ namespace Microsoft.Dafny {
throw new NotImplementedException();
}
}
+ public string DisplayName {
+ get {
+ Contract.Ensures(Contract.Result<string>() != null);
+ throw new NotImplementedException();
+ }
+ }
public string UniqueName {
get {
Contract.Ensures(Contract.Result<string>() != null);
@@ -1350,6 +1359,9 @@ namespace Microsoft.Dafny {
return name;
}
}
+ public string/*!*/ DisplayName {
+ get { return VarDecl.DisplayNameHelper(this); }
+ }
readonly int varId = varIdCount++;
public string UniqueName {
get {
@@ -2224,6 +2236,14 @@ namespace Microsoft.Dafny {
return name;
}
}
+ public static string DisplayNameHelper(IVariable v) {
+ Contract.Requires(v != null);
+ string name = v.Name;
+ return name.StartsWith("_") ? "_" : name;
+ }
+ public string/*!*/ DisplayName {
+ get { return DisplayNameHelper(this); }
+ }
readonly int varId = NonglobalVariable.varIdCount++;
public string/*!*/ UniqueName {
get {