Skip to content

Commit 4d93b68

Browse files
committed
Change compile-library to use a main function.
1 parent cc4224c commit 4d93b68

3 files changed

Lines changed: 7 additions & 8 deletions

File tree

langs/outlaw/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ runtime.o: $(objs)
3737
nasm -g -f $(format) -o $@ $<
3838

3939
stdlib.s: stdlib.rkt
40-
cat stdlib.rkt | racket -t compile-library.rkt > stdlib.s
40+
cat stdlib.rkt | racket -t compile-library.rkt -m > stdlib.s
4141

4242
%.s: %.rkt
4343
cat $< | racket -t compile-stdin.rkt > $@

langs/outlaw/compile-file.rkt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
#lang racket
2+
(require "parse.rkt" "compile.rkt" "read-all.rkt" "a86/printer.rkt")
23
(provide main)
3-
(require "parse.rkt"
4-
"compile.rkt"
5-
"read-all.rkt"
6-
"a86/printer.rkt")
74

85
;; -> Void
96
;; Compile contents of stdin

langs/outlaw/compile-library.rkt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
#lang racket
22
(require "parse.rkt" "compile.rkt" "read-all.rkt" "a86/printer.rkt")
3+
(provide main)
34

45
;; Compile contents of stdin
56
;; emit asm code on stdout
6-
(begin
7-
(void (read-line)) ; ignore #lang racket line
8-
(display (asm-string (compile-library (parse-library (read-all))))))
7+
(define (main)
8+
(begin
9+
(read-line) ; ignore #lang racket line
10+
(displayln (asm-string (compile-library (parse-library (read-all)))))))

0 commit comments

Comments
 (0)