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.
beautiful-racket/beautiful-racket-demo/basic-demo-3/setup.rkt

19 lines
497 B
Racket

8 years ago
#lang br
(require "parser.rkt" "tokenizer.rkt")
(provide basic-output-port do-setup!)
(define basic-output-port
(make-parameter (open-output-nowhere)))
8 years ago
(define repl-parse (make-rule-parser b-repl))
8 years ago
8 years ago
(define (read-one-line origin port)
8 years ago
(define one-line (read-line port))
(if (eof-object? one-line)
eof
8 years ago
(repl-parse
8 years ago
(make-tokenizer (open-input-string one-line)))))
7 years ago
(define (do-setup!)
8 years ago
(basic-output-port (current-output-port))
(current-read-interaction read-one-line))