Fixing PR12085
This commit is contained in:
parent
f0e52b80df
commit
a4f70ae598
20
collects/racklog/lang/configure-runtime.rkt
Normal file
20
collects/racklog/lang/configure-runtime.rkt
Normal file
|
@ -0,0 +1,20 @@
|
|||
#lang racket/base
|
||||
|
||||
(define (configure data)
|
||||
;; (printf "Configuring\n")
|
||||
(current-read-interaction even-read))
|
||||
(provide configure)
|
||||
|
||||
(require datalog/parse
|
||||
racklog/lang/compiler)
|
||||
|
||||
; XXX This is almost certainly wrong.
|
||||
(define (even-read src ip)
|
||||
(begin0
|
||||
(compile-statement
|
||||
(parameterize ([current-source-name src])
|
||||
(parse-statement ip)))
|
||||
(current-read-interaction odd-read)))
|
||||
(define (odd-read src ip)
|
||||
(current-read-interaction even-read)
|
||||
eof)
|
10
collects/racklog/lang/lang-info.rkt
Normal file
10
collects/racklog/lang/lang-info.rkt
Normal file
|
@ -0,0 +1,10 @@
|
|||
#lang racket/base
|
||||
|
||||
(define (get-info data)
|
||||
(λ (key default)
|
||||
(case key
|
||||
[(configure-runtime)
|
||||
'(#(racklog/lang/configure-runtime configure #f))]
|
||||
[else
|
||||
default])))
|
||||
(provide get-info)
|
|
@ -4,6 +4,8 @@
|
|||
#:read (lambda ([in (current-input-port)]) (this-read-syntax #f in))
|
||||
#:read-syntax this-read-syntax
|
||||
#:whole-body-readers? #t
|
||||
#:language-info
|
||||
'#(racklog/lang/lang-info get-info #f)
|
||||
#:info (lambda (key defval default)
|
||||
; XXX Should have different comment character key
|
||||
(case key
|
||||
|
@ -11,8 +13,6 @@
|
|||
(dynamic-require 'datalog/tool/submit 'repl-submit?)]
|
||||
[(color-lexer)
|
||||
(dynamic-require 'datalog/tool/syntax-color 'get-syntax-token)]
|
||||
[(configure-runtime)
|
||||
(λ () (current-read-interaction even-read))]
|
||||
[else (default key defval)]))
|
||||
(require datalog/parse
|
||||
racklog/lang/compiler)
|
||||
|
@ -21,15 +21,4 @@
|
|||
(list
|
||||
(compile-program
|
||||
(parameterize ([current-source-name src])
|
||||
(parse-program in)))))
|
||||
|
||||
; XXX This is almost certainly wrong.
|
||||
(define (even-read src ip)
|
||||
(begin0
|
||||
(compile-statement
|
||||
(parameterize ([current-source-name src])
|
||||
(parse-statement ip)))
|
||||
(current-read-interaction odd-read)))
|
||||
(define (odd-read src ip)
|
||||
(current-read-interaction even-read)
|
||||
eof))
|
||||
(parse-program in))))))
|
||||
|
|
15
collects/tests/racklog/pr/pr12085.rkt
Normal file
15
collects/tests/racklog/pr/pr12085.rkt
Normal file
|
@ -0,0 +1,15 @@
|
|||
#lang racklog
|
||||
|
||||
% Run parent_child(P,C)?
|
||||
|
||||
mother_child(trude, sally).
|
||||
|
||||
father_child(tom, sally).
|
||||
father_child(tom, erica).
|
||||
father_child(mike, tom).
|
||||
|
||||
sibling(X, Y) :- parent_child(Z, X), parent_child(Z, Y).
|
||||
|
||||
parent_child(X, Y) :- father_child(X, Y).
|
||||
parent_child(X, Y) :- mother_child(X, Y).
|
||||
|
Loading…
Reference in New Issue
Block a user