repl setup
parent
8be5afd15c
commit
5cc0f73028
@ -1,12 +1,16 @@
|
||||
#lang br
|
||||
(require (prefix-in basic: (submod "main.rkt" reader)))
|
||||
(require "parser.rkt" "tokenizer.rkt")
|
||||
(provide current-basic-port configure-repl!)
|
||||
|
||||
(define current-basic-port (make-parameter #f))
|
||||
|
||||
(define (configure-repl!)
|
||||
;; wrap REPL interactions with pollen expression support
|
||||
(define racket-read (current-read-interaction))
|
||||
(define (basic-read src in)
|
||||
(basic:read-syntax src in))
|
||||
(current-read-interaction basic-read))
|
||||
(define statement-parser (make-rule-parser b-statement))
|
||||
(define (read-one-line path port)
|
||||
(define one-line (read-line port))
|
||||
(if (eof-object? one-line)
|
||||
eof
|
||||
(statement-parser (make-tokenizer (open-input-string one-line)))))
|
||||
(current-read-interaction read-one-line))
|
||||
|
||||
|
||||
|
@ -1,2 +1,4 @@
|
||||
#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