Skip to content

Commit

Permalink
crook
Browse files Browse the repository at this point in the history
  • Loading branch information
dvanhorn committed Dec 2, 2024
1 parent 7d0c696 commit 576e4bc
Show file tree
Hide file tree
Showing 40 changed files with 45 additions and 82 deletions.
3 changes: 2 additions & 1 deletion blackmail/test/parse.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
(begin ; Abscond
(check-equal? (parse 42) (p (Lit 42)))
(check-equal? (parse -1) (p (Lit -1))))
(check-equal? (parse '(add1 42)) (p (Prim1 'add1 (Lit 42))))
(begin ; Blackmail
(check-equal? (parse '(add1 42)) (p (Prim1 'add1 (Lit 42)))))

1 change: 0 additions & 1 deletion con/parse.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
[(list s1)
(Prim1 o (parse s1))]
[_ (error "op1: bad syntax" s)])]

['if
(match sr
[(list (list 'zero? s1) s2 s3)
Expand Down
8 changes: 5 additions & 3 deletions con/test/parse.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
(begin ; Abscond
(check-equal? (parse 42) (p (Lit 42)))
(check-equal? (parse -1) (p (Lit -1))))
(check-equal? (parse '(add1 42)) (p (Prim1 'add1 (Lit 42))))
(check-equal? (parse '(if (zero? 1) 2 3))
(p (IfZero (Lit 1) (Lit 2) (Lit 3))))
(begin ; Blackmail
(check-equal? (parse '(add1 42)) (p (Prim1 'add1 (Lit 42)))))
(begin ; Con
(check-equal? (parse '(if (zero? 1) 2 3))
(p (IfZero (Lit 1) (Lit 2) (Lit 3)))))

1 change: 0 additions & 1 deletion dodger/parse.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
[(list s1)
(Prim1 o (parse s1))]
[_ (error "op1: bad syntax" s)])]

['if
(match sr
[(list s1 s2 s3)
Expand Down
3 changes: 2 additions & 1 deletion dodger/test/parse.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
(begin ; Abscond
(check-equal? (parse 42) (p (Lit 42)))
(check-equal? (parse -1) (p (Lit -1))))
(check-equal? (parse '(add1 42)) (p (Prim1 'add1 (Lit 42))))
(begin ; Blackmail
(check-equal? (parse '(add1 42)) (p (Prim1 'add1 (Lit 42)))))
(begin ; Dupe
(check-equal? (parse '(if (zero? 1) 2 3))
(p (If (Prim1 'zero? (Lit 1)) (Lit 2) (Lit 3))))
Expand Down
1 change: 0 additions & 1 deletion dupe/parse.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
[(list s1)
(Prim1 o (parse s1))]
[_ (error "op1: bad syntax" s)])]

['if
(match sr
[(list s1 s2 s3)
Expand Down
3 changes: 2 additions & 1 deletion dupe/test/parse.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
(begin ; Abscond
(check-equal? (parse 42) (p (Lit 42)))
(check-equal? (parse -1) (p (Lit -1))))
(check-equal? (parse '(add1 42)) (p (Prim1 'add1 (Lit 42))))
(begin ; Blackmail
(check-equal? (parse '(add1 42)) (p (Prim1 'add1 (Lit 42)))))
(begin ; Dupe
(check-equal? (parse '(if (zero? 1) 2 3))
(p (If (Prim1 'zero? (Lit 1)) (Lit 2) (Lit 3))))
Expand Down
1 change: 0 additions & 1 deletion evildoer/parse.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
[(list s1 s2)
(Begin (parse s1) (parse s2))]
[_ (error "begin: bad syntax" s)])]

['if
(match sr
[(list s1 s2 s3)
Expand Down
3 changes: 2 additions & 1 deletion evildoer/test/parse.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
(begin ; Abscond
(check-equal? (parse 42) (p (Lit 42)))
(check-equal? (parse -1) (p (Lit -1))))
(check-equal? (parse '(add1 42)) (p (Prim1 'add1 (Lit 42))))
(begin ; Blackmail
(check-equal? (parse '(add1 42)) (p (Prim1 'add1 (Lit 42)))))
(begin ; Dupe
(check-equal? (parse '(if (zero? 1) 2 3))
(p (If (Prim1 'zero? (Lit 1)) (Lit 2) (Lit 3))))
Expand Down
1 change: 0 additions & 1 deletion extort/parse.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
[(list s1 s2)
(Begin (parse s1) (parse s2))]
[_ (error "begin: bad syntax" s)])]

['if
(match sr
[(list s1 s2 s3)
Expand Down
3 changes: 2 additions & 1 deletion extort/test/parse.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
(begin ; Abscond
(check-equal? (parse 42) (p (Lit 42)))
(check-equal? (parse -1) (p (Lit -1))))
(check-equal? (parse '(add1 42)) (p (Prim1 'add1 (Lit 42))))
(begin ; Blackmail
(check-equal? (parse '(add1 42)) (p (Prim1 'add1 (Lit 42)))))
(begin ; Dupe
(check-equal? (parse '(if (zero? 1) 2 3))
(p (If (Prim1 'zero? (Lit 1)) (Lit 2) (Lit 3))))
Expand Down
3 changes: 1 addition & 2 deletions fraud/compile-stdin.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@
;; emit asm code on stdout
(define (main)
(read-line) ; ignore #lang racket line
(asm-display (compile
(parse-closed (read)))))
(asm-display (compile (parse-closed (read)))))

3 changes: 1 addition & 2 deletions fraud/interp-stdin.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@
;; print result on stdout
(define (main)
(read-line) ; ignore #lang racket line
(println (interp
(parse-closed (read)))))
(println (interp (parse-closed (read)))))

3 changes: 2 additions & 1 deletion fraud/test/parse.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
(begin ; Abscond
(check-equal? (parse 42) (p (Lit 42)))
(check-equal? (parse -1) (p (Lit -1))))
(check-equal? (parse '(add1 42)) (p (Prim1 'add1 (Lit 42))))
(begin ; Blackmail
(check-equal? (parse '(add1 42)) (p (Prim1 'add1 (Lit 42)))))
(begin ; Dupe
(check-equal? (parse '(if (zero? 1) 2 3))
(p (If (Prim1 'zero? (Lit 1)) (Lit 2) (Lit 3))))
Expand Down
5 changes: 0 additions & 5 deletions hoax/assert.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,8 @@

;; Register -> Asm


(define assert-char
(assert-type mask-char type-char))




(define assert-box
(assert-type ptr-mask type-box))
(define assert-cons
Expand Down
3 changes: 1 addition & 2 deletions hoax/compile-stdin.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@
;; emit asm code on stdout
(define (main)
(read-line) ; ignore #lang racket line
(asm-display (compile
(parse-closed (read)))))
(asm-display (compile (parse-closed (read)))))

3 changes: 1 addition & 2 deletions hoax/interp-stdin.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@
;; print result on stdout
(define (main)
(read-line) ; ignore #lang racket line
(println (interp
(parse-closed (read)))))
(println (interp (parse-closed (read)))))

3 changes: 2 additions & 1 deletion hoax/test/parse.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
(begin ; Abscond
(check-equal? (parse 42) (p (Lit 42)))
(check-equal? (parse -1) (p (Lit -1))))
(check-equal? (parse '(add1 42)) (p (Prim1 'add1 (Lit 42))))
(begin ; Blackmail
(check-equal? (parse '(add1 42)) (p (Prim1 'add1 (Lit 42)))))
(begin ; Dupe
(check-equal? (parse '(if (zero? 1) 2 3))
(p (If (Prim1 'zero? (Lit 1)) (Lit 2) (Lit 3))))
Expand Down
5 changes: 0 additions & 5 deletions hustle/assert.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,8 @@

;; Register -> Asm


(define assert-char
(assert-type mask-char type-char))




(define assert-box
(assert-type ptr-mask type-box))
(define assert-cons
Expand Down
3 changes: 1 addition & 2 deletions hustle/compile-stdin.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@
;; emit asm code on stdout
(define (main)
(read-line) ; ignore #lang racket line
(asm-display (compile
(parse-closed (read)))))
(asm-display (compile (parse-closed (read)))))

3 changes: 1 addition & 2 deletions hustle/interp-stdin.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@
;; print result on stdout
(define (main)
(read-line) ; ignore #lang racket line
(println (interp
(parse-closed (read)))))
(println (interp (parse-closed (read)))))

3 changes: 2 additions & 1 deletion hustle/test/parse.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
(begin ; Abscond
(check-equal? (parse 42) (p (Lit 42)))
(check-equal? (parse -1) (p (Lit -1))))
(check-equal? (parse '(add1 42)) (p (Prim1 'add1 (Lit 42))))
(begin ; Blackmail
(check-equal? (parse '(add1 42)) (p (Prim1 'add1 (Lit 42)))))
(begin ; Dupe
(check-equal? (parse '(if (zero? 1) 2 3))
(p (If (Prim1 'zero? (Lit 1)) (Lit 2) (Lit 3))))
Expand Down
5 changes: 0 additions & 5 deletions iniquity/assert.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,8 @@

;; Register -> Asm


(define assert-char
(assert-type mask-char type-char))




(define assert-box
(assert-type ptr-mask type-box))
(define assert-cons
Expand Down
3 changes: 1 addition & 2 deletions iniquity/compile-stdin.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@
;; emit asm code on stdout
(define (main)
(read-line) ; ignore #lang racket line
(asm-display (compile
(apply parse-closed (read-all)))))
(asm-display (compile (apply parse-closed (read-all)))))

3 changes: 1 addition & 2 deletions iniquity/interp-stdin.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@
;; print result on stdout
(define (main)
(read-line) ; ignore #lang racket line
(println (interp
(apply parse-closed (read-all)))))
(println (interp (apply parse-closed (read-all)))))

3 changes: 2 additions & 1 deletion iniquity/test/parse.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
(begin ; Abscond
(check-equal? (parse 42) (p (Lit 42)))
(check-equal? (parse -1) (p (Lit -1))))
(check-equal? (parse '(add1 42)) (p (Prim1 'add1 (Lit 42))))
(begin ; Blackmail
(check-equal? (parse '(add1 42)) (p (Prim1 'add1 (Lit 42)))))
(begin ; Dupe
(check-equal? (parse '(if (zero? 1) 2 3))
(p (If (Prim1 'zero? (Lit 1)) (Lit 2) (Lit 3))))
Expand Down
5 changes: 0 additions & 5 deletions jig/assert.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,8 @@

;; Register -> Asm


(define assert-char
(assert-type mask-char type-char))




(define assert-box
(assert-type ptr-mask type-box))
(define assert-cons
Expand Down
3 changes: 1 addition & 2 deletions jig/compile-stdin.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@
;; emit asm code on stdout
(define (main)
(read-line) ; ignore #lang racket line
(asm-display (compile
(apply parse-closed (read-all)))))
(asm-display (compile (apply parse-closed (read-all)))))

3 changes: 1 addition & 2 deletions jig/interp-stdin.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@
;; print result on stdout
(define (main)
(read-line) ; ignore #lang racket line
(println (interp
(apply parse-closed (read-all)))))
(println (interp (apply parse-closed (read-all)))))

3 changes: 2 additions & 1 deletion jig/test/parse.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
(begin ; Abscond
(check-equal? (parse 42) (p (Lit 42)))
(check-equal? (parse -1) (p (Lit -1))))
(check-equal? (parse '(add1 42)) (p (Prim1 'add1 (Lit 42))))
(begin ; Blackmail
(check-equal? (parse '(add1 42)) (p (Prim1 'add1 (Lit 42)))))
(begin ; Dupe
(check-equal? (parse '(if (zero? 1) 2 3))
(p (If (Prim1 'zero? (Lit 1)) (Lit 2) (Lit 3))))
Expand Down
5 changes: 0 additions & 5 deletions knock/assert.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,8 @@

;; Register -> Asm


(define assert-char
(assert-type mask-char type-char))




(define assert-box
(assert-type ptr-mask type-box))
(define assert-cons
Expand Down
3 changes: 1 addition & 2 deletions knock/compile-stdin.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@
;; emit asm code on stdout
(define (main)
(read-line) ; ignore #lang racket line
(asm-display (compile
(apply parse-closed (read-all)))))
(asm-display (compile (apply parse-closed (read-all)))))

3 changes: 1 addition & 2 deletions knock/interp-stdin.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@
;; print result on stdout
(define (main)
(read-line) ; ignore #lang racket line
(println (interp
(apply parse-closed (read-all)))))
(println (interp (apply parse-closed (read-all)))))

3 changes: 1 addition & 2 deletions knock/parse.rkt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#lang racket
(provide parse parse-closed parse-e parse-define
parse-pattern)
(provide parse parse-closed parse-e parse-define parse-pattern)
(require "ast.rkt")

;; [Listof S-Expr] -> Prog
Expand Down
3 changes: 2 additions & 1 deletion knock/test/parse.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
(begin ; Abscond
(check-equal? (parse 42) (p (Lit 42)))
(check-equal? (parse -1) (p (Lit -1))))
(check-equal? (parse '(add1 42)) (p (Prim1 'add1 (Lit 42))))
(begin ; Blackmail
(check-equal? (parse '(add1 42)) (p (Prim1 'add1 (Lit 42)))))
(begin ; Dupe
(check-equal? (parse '(if (zero? 1) 2 3))
(p (If (Prim1 'zero? (Lit 1)) (Lit 2) (Lit 3))))
Expand Down
5 changes: 0 additions & 5 deletions loot/assert.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,8 @@

;; Register -> Asm


(define assert-char
(assert-type mask-char type-char))




(define assert-box
(assert-type ptr-mask type-box))
(define assert-cons
Expand Down
3 changes: 1 addition & 2 deletions loot/compile-stdin.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@
;; emit asm code on stdout
(define (main)
(read-line) ; ignore #lang racket line
(asm-display (compile
(apply parse-closed (read-all)))))
(asm-display (compile (apply parse-closed (read-all)))))

3 changes: 1 addition & 2 deletions loot/interp-stdin.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@
;; print result on stdout
(define (main)
(read-line) ; ignore #lang racket line
(println (interp
(apply parse-closed (read-all)))))
(println (interp (apply parse-closed (read-all)))))

3 changes: 1 addition & 2 deletions loot/parse.rkt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#lang racket
(provide parse parse-closed parse-e parse-define
parse-pattern)
(provide parse parse-closed parse-e parse-define parse-pattern)
(require "ast.rkt")

;; [Listof S-Expr] -> Prog
Expand Down
3 changes: 2 additions & 1 deletion loot/test/parse.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
(begin ; Abscond
(check-equal? (parse 42) (p (Lit 42)))
(check-equal? (parse -1) (p (Lit -1))))
(check-equal? (parse '(add1 42)) (p (Prim1 'add1 (Lit 42))))
(begin ; Blackmail
(check-equal? (parse '(add1 42)) (p (Prim1 'add1 (Lit 42)))))
(begin ; Dupe
(check-equal? (parse '(if (zero? 1) 2 3))
(p (If (Prim1 'zero? (Lit 1)) (Lit 2) (Lit 3))))
Expand Down

0 comments on commit 576e4bc

Please sign in to comment.