repl setup
parent
8be5afd15c
commit
5cc0f73028
@ -1,12 +1,16 @@
|
|||||||
#lang br
|
#lang br
|
||||||
(require (prefix-in basic: (submod "main.rkt" reader)))
|
(require "parser.rkt" "tokenizer.rkt")
|
||||||
(provide current-basic-port configure-repl!)
|
(provide current-basic-port configure-repl!)
|
||||||
|
|
||||||
(define current-basic-port (make-parameter #f))
|
(define current-basic-port (make-parameter #f))
|
||||||
|
|
||||||
(define (configure-repl!)
|
(define (configure-repl!)
|
||||||
;; wrap REPL interactions with pollen expression support
|
(define statement-parser (make-rule-parser b-statement))
|
||||||
(define racket-read (current-read-interaction))
|
(define (read-one-line path port)
|
||||||
(define (basic-read src in)
|
(define one-line (read-line port))
|
||||||
(basic:read-syntax src in))
|
(if (eof-object? one-line)
|
||||||
(current-read-interaction basic-read))
|
eof
|
||||||
|
(statement-parser (make-tokenizer (open-input-string one-line)))))
|
||||||
|
(current-read-interaction read-one-line))
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,2 +1,4 @@
|
|||||||
#lang basic-demo-3
|
#lang basic-demo-3
|
||||||
10 print "got shell arg" : print arg0 : print arg1
|
10 print "got shell arg" : print arg0 : print arg1
|
||||||
|
20 a = 5
|
||||||
|
30 def f(x) = x ^ x
|
Loading…
Reference in New Issue