We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bedefe7 commit c0fcf69Copy full SHA for c0fcf69
www/notes/loot/compile-file.rkt
@@ -0,0 +1,19 @@
1
+#lang racket
2
+(provide (all-defined-out))
3
+(require "compile.rkt" #;"syntax.rkt" "asm/printer.rkt")
4
+
5
+;; String -> Void
6
+;; Compile contents of given file name,
7
+;; emit asm code on stdout
8
+(define (main fn)
9
+ (with-input-from-file fn
10
+ (λ ()
11
+ (let ((p (read-program)))
12
+ ; assumed OK for now
13
+ ;(unless (and (prog? p) (closed? p))
14
+ ; (error "syntax error"))
15
+ (asm-display (compile p))))))
16
17
+(define (read-program)
18
+ (regexp-match "^#lang racket" (current-input-port))
19
+ (read))
0 commit comments