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

16 lines
586 B
Racket

#lang racket/base
(provide schema->module-stx)
(require (only-in "compiler.rkt" schema->module-stx))
(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) (error 'read-preserves-schema-module "~a" module-path))
(port->schema src p))))