preserves/implementations/racket/preserves/preserves-schema/main.rkt

20 lines
740 B
Racket

#lang racket/base
(provide (all-from-out "compiler.rkt"))
(require "compiler.rkt")
(module+ reader
(provide (rename-out [read-preserves-schema-module read-syntax]))
(require (only-in "reader.rkt" port->schema))
(define (read-preserves-schema-module src [p (current-input-port)])
(define-values (_dirname filename _must-be-dir) (split-path src))
(schema->module-stx
(string->symbol (path->string (path-replace-extension filename "")))
(lambda (module-path) #f)
(port->schema src p)
#:translation-paths (schema-translation-paths src
filename
#f
#f))))