You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
typesetting/hyphenate/exception-prep.rkt

17 lines
655 B
Racket

#lang racket/base
(module reader racket/base
(require racket/port syntax/strip-context)
(provide (rename-out [exception-prep-read read]
[exception-prep-read-syntax read-syntax]))
(define (exception-prep-read in)
(syntax->datum (exception-prep-read-syntax #f in)))
(define (exception-prep-read-syntax src in)
(with-syntax ([str (port->string in)])
(strip-context
#'(module exception-prep racket/base
(require racket/string racket/list hyphenate/core)
(provide exceptions)
(define exceptions (apply hash (append-map convert-exception-word (string-split str)))))))))