Permalink
Browse files

adding module records

  • Loading branch information...
1 parent 558d92e commit 3c1229e2c29b278f123d09c46b67a3b28ae66ebe Danny Yoo committed Aug 23, 2010
Showing with 42 additions and 0 deletions.
  1. +36 −0 src/compiler/mzscheme-vm/module-record.ss
  2. +6 −0 src/compiler/mzscheme-vm/parameters.ss
View
36 src/compiler/mzscheme-vm/module-record.ss
@@ -0,0 +1,36 @@
+#lang racket/base
+
+(require scheme/contract)
+
+(require
+ (prefix-in bcode:
+ "../../../support/externals/mzscheme-vm/src/bytecode-structs.ss"))
+
+
+;; module-record:
+;; name is a resolved module path
+;; exports is a (listof symbol)
+;; impl is an impl
+(define-struct module-record (name exports impl))
+
+
+;; An impl is one of the following:
+(define-struct impl ())
+
+;; impl:bytecode:
+;; bytecode: is a bytecode-structs compilation-top.
+(define-struct (impl:bytecode impl) (bytecode))
+
+;; impl:js: impl
+;; js-path is a complete system path.
+(define-struct (impl:js impl) (js-path))
+
+
+
+(provide/contract
+ [struct module-record ([name resolved-module-path?]
+ [exports (listof symbol?)]
+ [impl impl?])]
+ [struct impl ()]
+ [struct (impl:bytecode impl) ([bytecode (or/c bcode:form? bcode:indirect? any/c)])]
+ [struct (impl:js impl) ([js-path complete-path?])])
View
6 src/compiler/mzscheme-vm/parameters.ss
@@ -0,0 +1,6 @@
+#lang racket/base
+
+(define current-module-name
+ (make-parameter #f))
+
+(provide current-module-name)

0 comments on commit 3c1229e

Please sign in to comment.