Removing even/odd reading hack and just protecting parser from eof-ing ports
This commit is contained in:
parent
829a640299
commit
41e07b0cc6
|
@ -1,20 +1,18 @@
|
||||||
#lang racket/base
|
#lang racket/base
|
||||||
|
|
||||||
(define (configure data)
|
(define (configure data)
|
||||||
;; (printf "Configuring\n")
|
(current-read-interaction the-read))
|
||||||
(current-read-interaction even-read))
|
|
||||||
(provide configure)
|
(provide configure)
|
||||||
|
|
||||||
(require datalog/parse
|
(require datalog/parse
|
||||||
datalog/private/compiler)
|
datalog/private/compiler)
|
||||||
|
|
||||||
; XXX This is almost certainly wrong.
|
(define (the-read src ip)
|
||||||
(define (even-read src ip)
|
(cond
|
||||||
(begin0
|
[(or (not (char-ready? ip))
|
||||||
(compile-statement
|
(eof-object? (peek-char ip)))
|
||||||
(parameterize ([current-source-name src])
|
eof]
|
||||||
(parse-statement ip)))
|
[else
|
||||||
(current-read-interaction odd-read)))
|
(compile-statement
|
||||||
(define (odd-read src ip)
|
(parameterize ([current-source-name src])
|
||||||
(current-read-interaction even-read)
|
(parse-statement ip)))]))
|
||||||
eof)
|
|
||||||
|
|
|
@ -1,20 +1,18 @@
|
||||||
#lang racket/base
|
#lang racket/base
|
||||||
|
|
||||||
(define (configure data)
|
(define (configure data)
|
||||||
;; (printf "Configuring\n")
|
(current-read-interaction the-read))
|
||||||
(current-read-interaction even-read))
|
|
||||||
(provide configure)
|
(provide configure)
|
||||||
|
|
||||||
(require datalog/parse
|
(require datalog/parse
|
||||||
racklog/lang/compiler)
|
racklog/lang/compiler)
|
||||||
|
|
||||||
; XXX This is almost certainly wrong.
|
(define (the-read src ip)
|
||||||
(define (even-read src ip)
|
(cond
|
||||||
(begin0
|
[(or (not (char-ready? ip))
|
||||||
(compile-statement
|
(eof-object? (peek-char ip)))
|
||||||
(parameterize ([current-source-name src])
|
eof]
|
||||||
(parse-statement ip)))
|
[else
|
||||||
(current-read-interaction odd-read)))
|
(compile-statement
|
||||||
(define (odd-read src ip)
|
(parameterize ([current-source-name src])
|
||||||
(current-read-interaction even-read)
|
(parse-statement ip)))]))
|
||||||
eof)
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user