summaryrefslogtreecommitdiff
path: root/Source/Dafny/DafnyMain.cs
diff options
context:
space:
mode:
authorGravatar Bryan Parno <parno@microsoft.com>2014-10-27 14:42:42 -0700
committerGravatar Bryan Parno <parno@microsoft.com>2014-10-27 14:42:42 -0700
commit9fdc6978e972ce79f21f2a5d470d15fc6fc7c089 (patch)
tree3003dcd3abd38378fac4c62f75bca33ff8ea142b /Source/Dafny/DafnyMain.cs
parentc4333fa28b0ebd00e4b159dcafe87fc2a0264c59 (diff)
Ensure that no file is processed twice, even if one command-line file is included by another command-line file.
Diffstat (limited to 'Source/Dafny/DafnyMain.cs')
-rw-r--r--Source/Dafny/DafnyMain.cs7
1 files changed, 5 insertions, 2 deletions
diff --git a/Source/Dafny/DafnyMain.cs b/Source/Dafny/DafnyMain.cs
index 34b509a0..7c522bd8 100644
--- a/Source/Dafny/DafnyMain.cs
+++ b/Source/Dafny/DafnyMain.cs
@@ -54,7 +54,7 @@ namespace Microsoft.Dafny {
}
if (!DafnyOptions.O.DisallowIncludes) {
- string errString = ParseIncludes(module, builtIns, new Errors());
+ string errString = ParseIncludes(module, builtIns, fileNames, new Errors());
if (errString != null) {
return errString;
}
@@ -84,8 +84,11 @@ namespace Microsoft.Dafny {
}
}
- public static string ParseIncludes(ModuleDecl module, BuiltIns builtIns, Errors errs) {
+ public static string ParseIncludes(ModuleDecl module, BuiltIns builtIns, List<string> excludeFiles, Errors errs) {
SortedSet<Include> includes = new SortedSet<Include>(new IncludeComparer());
+ foreach (string fileName in excludeFiles) {
+ includes.Add(new Include(null, fileName, Path.GetFullPath(fileName)));
+ }
bool newlyIncluded;
do {
newlyIncluded = false;