Skip to content

Commit 84accb0

Browse files
committed
Merge branch 'main' of github.com:cmsc430/www
2 parents 3ead054 + 32133e3 commit 84accb0

35 files changed

Lines changed: 159 additions & 121 deletions

langs/a86/printer.rkt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@
206206
[(Label g)
207207
(begin
208208
(write-string (string-append
209-
tab "global " (label-symbol->string g) "\n"
209+
; tab "global " (label-symbol->string g) "\n"
210210
tab "default rel\n"
211211
tab "section .text\n"))
212212
(instrs-display a))]

langs/dodger/test/all.rkt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@
3232
;; Dupe examples
3333
(check-equal? (run #t) #t)
3434
(check-equal? (run #f) #f)
35-
(check-equal? (run (if #t 1 2)) 1)
36-
(check-equal? (run (if #f 1 2)) 2)
37-
(check-equal? (run (if 0 1 2)) 1)
35+
(check-equal? (run '(if #t 1 2)) 1)
36+
(check-equal? (run '(if #f 1 2)) 2)
37+
(check-equal? (run '(if 0 1 2)) 1)
3838
(check-equal? (run '(if #t 3 4)) 3)
3939
(check-equal? (run '(if #f 3 4)) 4)
4040
(check-equal? (run '(if 0 3 4)) 3)

langs/dupe/compile/help.rkt

Lines changed: 0 additions & 15 deletions
This file was deleted.

langs/dupe/test/all.rkt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@
3333
;; Dupe examples
3434
(check-equal? (run #t) #t)
3535
(check-equal? (run #f) #f)
36-
(check-equal? (run (if #t 1 2)) 1)
37-
(check-equal? (run (if #f 1 2)) 2)
38-
(check-equal? (run (if 0 1 2)) 1)
36+
(check-equal? (run '(if #t 1 2)) 1)
37+
(check-equal? (run '(if #f 1 2)) 2)
38+
(check-equal? (run '(if 0 1 2)) 1)
3939
(check-equal? (run '(if #t 3 4)) 3)
4040
(check-equal? (run '(if #f 3 4)) 4)
4141
(check-equal? (run '(if 0 3 4)) 3)

langs/evildoer/build-runtime.rkt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#lang racket
2+
(provide runtime-path)
3+
4+
(require racket/runtime-path)
5+
(define-runtime-path here ".")
6+
7+
(system (string-append "make -C "
8+
(path->string (normalize-path here))
9+
" runtime.o"))
10+
11+
(define runtime-path
12+
(normalize-path (build-path here "runtime.o")))

langs/evildoer/test/all.rkt

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@
44
"../interp-io.rkt"
55
"../parse.rkt"
66
"../types.rkt"
7+
"../build-runtime.rkt"
78
a86/interp
89
rackunit)
910

1011
;; link with runtime for IO operations
11-
(unless (file-exists? "../runtime.o")
12-
(system "make -C .. runtime.o"))
1312
(current-objs
14-
(list (path->string (normalize-path "../runtime.o"))))
13+
(list (path->string runtime-path)))
1514

1615
(define (test-runner run)
1716
;; Abscond examples
@@ -38,9 +37,9 @@
3837
;; Dupe examples
3938
(check-equal? (run #t) #t)
4039
(check-equal? (run #f) #f)
41-
(check-equal? (run (if #t 1 2)) 1)
42-
(check-equal? (run (if #f 1 2)) 2)
43-
(check-equal? (run (if 0 1 2)) 1)
40+
(check-equal? (run '(if #t 1 2)) 1)
41+
(check-equal? (run '(if #f 1 2)) 2)
42+
(check-equal? (run '(if 0 1 2)) 1)
4443
(check-equal? (run '(if #t 3 4)) 3)
4544
(check-equal? (run '(if #f 3 4)) 4)
4645
(check-equal? (run '(if 0 3 4)) 3)

langs/extort/build-runtime.rkt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#lang racket
2+
(provide runtime-path)
3+
4+
(require racket/runtime-path)
5+
(define-runtime-path here ".")
6+
7+
(system (string-append "make -C "
8+
(path->string (normalize-path here))
9+
" runtime.o"))
10+
11+
(define runtime-path
12+
(normalize-path (build-path here "runtime.o")))

langs/extort/compile-ops.rkt

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
(define rax 'rax) ; return
66
(define rdi 'rdi) ; arg
7-
(define r8 'r8) ; scratch in +, -
87
(define r9 'r9) ; scratch in assert-type
98

109
;; Op0 -> Asm
@@ -56,20 +55,6 @@
5655
(Call 'write_byte)
5756
(Mov rax val-void))]))
5857

59-
;; Op2 -> Asm
60-
(define (compile-op2 p)
61-
(match p
62-
['+
63-
(seq (Pop r8)
64-
(assert-integer r8)
65-
(assert-integer rax)
66-
(Add rax r8))]
67-
['-
68-
(seq (Pop r8)
69-
(assert-integer r8)
70-
(assert-integer rax)
71-
(Sub r8 rax)
72-
(Mov rax r8))]))
7358

7459
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
7560

langs/extort/compile.rkt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,6 @@
4747
(seq (compile-e e)
4848
(compile-op1 p)))
4949

50-
;; Op2 Expr Expr -> Asm
51-
(define (compile-prim2 p e1 e2)
52-
(seq (compile-e e1)
53-
(Push rax)
54-
(compile-e e2)
55-
(compile-op2 p)))
56-
5750
;; Expr Expr Expr -> Asm
5851
(define (compile-if e1 e2 e3)
5952
(let ((l1 (gensym 'if))

langs/extort/compile/help.rkt

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)