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.
19 lines
508 B
Racket
19 lines
508 B
Racket
#lang br
|
|
(require "parser.rkt" "tokenizer.rkt")
|
|
(provide basic-output-port do-setup!)
|
|
|
|
(define basic-output-port
|
|
(make-parameter (open-output-nowhere)))
|
|
|
|
(define repl-parse (make-rule-parser b-repl))
|
|
|
|
(define (read-one-line origin port)
|
|
(define one-line (read-line port))
|
|
(if (eof-object? one-line)
|
|
eof
|
|
(repl-parse
|
|
(make-tokenizer (open-input-string one-line)))))
|
|
|
|
(define (do-setup! [where #f])
|
|
(basic-output-port (current-output-port))
|
|
(current-read-interaction read-one-line)) |