We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e3f8597 commit e5ecc98Copy full SHA for e5ecc98
2 files changed
www/notes/fraud/compile.rkt
@@ -1,6 +1,5 @@
1
#lang racket
2
(provide (all-defined-out))
3
-(require "compile/help.rkt")
4
5
;; type CEnv = [Listof Variable]
6
@@ -42,9 +41,6 @@
42
41
(jne ,l0)
43
(mov rax #b11) ; #t
44
,l0))]
45
- [(? symbol? x)
46
- (let ((i (lookup x c)))
47
- `((mov rax (offset rsp ,(- (add1 i))))))]
48
[`(if ,e0 ,e1 ,e2)
49
(let ((c0 (compile-e e0 c))
50
(c1 (compile-e e1 c))
@@ -59,6 +55,9 @@
59
55
,l0
60
56
,@c2
61
57
,l1))]
58
+ [(? symbol? x)
+ (let ((i (lookup x c)))
+ `((mov rax (offset rsp ,(- (add1 i))))))]
62
[`(let ((,x ,e0)) ,e1)
63
64
(c1 (compile-e e1 (cons x c))))
@@ -74,3 +73,9 @@
74
73
(match (symbol=? x y)
75
[#t (length cenv)]
76
[#f (lookup x cenv)])]))
+
77
+(define assert-integer
78
+ `((mov rbx rax)
79
+ (and rbx 1)
80
+ (cmp rbx 0)
81
+ (jne err)))
www/notes/fraud/compile/help.rkt
0 commit comments