scribble-enhanced/collects/tests/scribble/docs/diamond.rkt
Matthew Flatt 6d84b17b7c scribble/reader: allow escape character to be non-ASCII
original commit: 96c5521196dc1fe19c401950775b2c8f8e80991f
2013-04-19 20:46:25 -06:00

16 lines
458 B
Racket

#lang racket/base
(require (only-in scribble/reader make-at-readtable))
(provide (rename-out [diamond-read read]
[diamond-read-syntax read-syntax]))
(define diamond-readtable (make-at-readtable #:command-char #\◇))
(define (diamond-read p)
(parameterize ([current-readtable diamond-readtable])
(read p)))
(define (diamond-read-syntax name p)
(parameterize ([current-readtable diamond-readtable])
(read-syntax name p)))