-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreader.rkt
More file actions
22 lines (17 loc) · 746 Bytes
/
reader.rkt
File metadata and controls
22 lines (17 loc) · 746 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#lang racket/base
(require (only-in racket/sequence sequence->list))
(provide
(rename-out [cli-read-syntax read-syntax]
[cli-read read]))
(define (cli-read port)
(cli-read-syntax #f port))
(define (cli-read-syntax path port)
;; this reads symexes from the source file
(define src-datums (sequence->list (in-port read port)))
(define module-datum `(module cli-mod cli/expander
;; since the cli lang syntax is symex-oriented
;; we just use the read input directly.
;; the individual forms of the language will
;; be compiled by the expander
,@src-datums))
(datum->syntax #f module-datum))