summaryrefslogtreecommitdiff
path: root/Source/Dafny/DafnyOptions.cs
diff options
context:
space:
mode:
authorGravatar Rustan Leino <unknown>2015-07-02 20:00:11 -0700
committerGravatar Rustan Leino <unknown>2015-07-02 20:00:11 -0700
commit4d11b8d19bab3c4b37914f12226e19ac6d68ffb1 (patch)
tree4fba3b306d72e26bdce96b52d1ff9f24beaab673 /Source/Dafny/DafnyOptions.cs
parente10098cde7bac9a7a1576000fa29d15f1fcd8970 (diff)
Added command-line option /warnShadowing, which emits warnings if variables shadow other variables (Issue #86)
Diffstat (limited to 'Source/Dafny/DafnyOptions.cs')
-rw-r--r--Source/Dafny/DafnyOptions.cs7
1 files changed, 7 insertions, 0 deletions
diff --git a/Source/Dafny/DafnyOptions.cs b/Source/Dafny/DafnyOptions.cs
index af940439..a3b26f2a 100644
--- a/Source/Dafny/DafnyOptions.cs
+++ b/Source/Dafny/DafnyOptions.cs
@@ -58,6 +58,7 @@ namespace Microsoft.Dafny
public bool Optimize = false;
public bool PrintStats = false;
public bool PrintFunctionCallGraph = false;
+ public bool WarnShadowing = false;
protected override bool ParseOption(string name, Bpl.CommandLineOptionEngine.CommandLineParseState ps) {
var args = ps.args; // convenient synonym
@@ -183,6 +184,10 @@ namespace Microsoft.Dafny
PrintFunctionCallGraph = true;
return true;
+ case "warnShadowing":
+ WarnShadowing = true;
+ return true;
+
case "countVerificationErrors": {
int countErrors = 1; // defaults to reporting verification errors
if (ps.GetNumericArgument(ref countErrors, 2)) {
@@ -294,6 +299,8 @@ namespace Microsoft.Dafny
- passes /optimize flag to csc.exe.
/stats Print interesting statistics about the Dafny files supplied.
/funcCallGraph Print out the function call graph. Format is: func,mod=callee*
+ /warnShadowing Emits a warning if the name of a declared variable caused another variable
+ to be shadowed
");
base.Usage(); // also print the Boogie options
}