diff options
author | Unknown <leino@LEINO6.redmond.corp.microsoft.com> | 2012-08-30 14:18:47 -0700 |
---|---|---|
committer | Unknown <leino@LEINO6.redmond.corp.microsoft.com> | 2012-08-30 14:18:47 -0700 |
commit | 40d21f0057a4d0ce9fc184aae375e2404f00f51e (patch) | |
tree | 4e20f85a55662c6f018932065f1185aeabf8d077 /Source/Dafny | |
parent | 71b527bf4084763bb48c5c9fc44fc2ee456415d6 (diff) |
DafnyExtension: changed how "_" is displayed (now display as a keyword, not as an identifier definition)
Diffstat (limited to 'Source/Dafny')
-rw-r--r-- | Source/Dafny/DafnyAst.cs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Source/Dafny/DafnyAst.cs b/Source/Dafny/DafnyAst.cs index 39bfbdd3..021a0ba7 100644 --- a/Source/Dafny/DafnyAst.cs +++ b/Source/Dafny/DafnyAst.cs @@ -2236,10 +2236,13 @@ namespace Microsoft.Dafny { return name;
}
}
+ public static bool HasWildcardName(IVariable v) {
+ Contract.Requires(v != null);
+ return v.Name.StartsWith("_");
+ }
public static string DisplayNameHelper(IVariable v) {
Contract.Requires(v != null);
- string name = v.Name;
- return name.StartsWith("_") ? "_" : name;
+ return HasWildcardName(v) ? "_" : v.Name;
}
public string/*!*/ DisplayName {
get { return DisplayNameHelper(this); }
|