summaryrefslogtreecommitdiff
path: root/Dafny/Compiler.cs
diff options
context:
space:
mode:
authorGravatar Jason Koenig <unknown>2012-06-26 17:06:33 -0700
committerGravatar Jason Koenig <unknown>2012-06-26 17:06:33 -0700
commit1fbd28ebc465f94cc783e5d9dcc7c5f206c81e69 (patch)
treeef703551d73c683958b4503e03abb471928dad26 /Dafny/Compiler.cs
parent4f2f785d121651c62cf0a7da7c7bcaef13ee14b4 (diff)
Dafny: Implemented abstract modules
Diffstat (limited to 'Dafny/Compiler.cs')
-rw-r--r--Dafny/Compiler.cs8
1 files changed, 5 insertions, 3 deletions
diff --git a/Dafny/Compiler.cs b/Dafny/Compiler.cs
index e72c04dd..7f48e551 100644
--- a/Dafny/Compiler.cs
+++ b/Dafny/Compiler.cs
@@ -66,7 +66,7 @@ namespace Microsoft.Dafny {
ReadRuntimeSystem();
CompileBuiltIns(program.BuiltIns);
- foreach (ModuleDecl m in program.Modules) {
+ foreach (ModuleDefinition m in program.Modules) {
if (m.IsGhost) {
// the purpose of a ghost module is to skip compilation
continue;
@@ -91,7 +91,7 @@ namespace Microsoft.Dafny {
wr.WriteLine(" { }");
CompileDatatypeConstructors(dt, indent);
CompileDatatypeStruct(dt, indent);
- } else {
+ } else if (d is ClassDecl) {
ClassDecl cl = (ClassDecl)d;
Indent(indent);
wr.Write("public class @{0}", cl.CompileName);
@@ -101,7 +101,9 @@ namespace Microsoft.Dafny {
wr.WriteLine(" {");
CompileClassMembers(cl, indent+IndentAmount);
Indent(indent); wr.WriteLine("}");
- }
+ } else if (d is ModuleDecl) {
+ // nop
+ } else { Contract.Assert(false); }
}
if (!m.IsDefaultModule) {
wr.WriteLine("}} // end of namespace {0}", m.CompileName);