1#lang racket/base 2(require "module.rkt" 3 "../host/linklet.rkt" 4 "../common/module-path.rkt" 5 "../syntax/module-binding.rkt" 6 "../namespace/provided.rkt" 7 "link.rkt" 8 "variable.rkt") 9 10(provide get-module-export-variables) 11 12(define (get-module-export-variables lnk 13 #:compiled-modules compiled-modules 14 #:cache cache) 15 (define name (link-name lnk)) 16 (define phase (link-phase lnk)) 17 (define root-name (if (pair? name) (car name) name)) ; strip away submodule path 18 (define comp-mod 19 (get-compiled-module name root-name 20 #:compiled-modules compiled-modules 21 #:cache cache)) 22 23 (define provs (instance-variable-value (compiled-module-declaration comp-mod) 'provides)) 24 25 (for/hash ([(sym binding/p) (in-hash (hash-ref provs 0 #hasheq()))]) 26 (define binding (provided-as-binding binding/p)) 27 (values sym (variable (link (module-path-index->module-name (module-binding-module binding) name) 28 (module-binding-phase binding)) 29 (module-binding-sym binding))))) 30