From d6310bd62842855ad4207be55a3a71f769955046 Mon Sep 17 00:00:00 2001 From: dvanhorn Date: Tue, 28 Oct 2025 20:36:17 +0000 Subject: [PATCH] crook --- hoax/compile-ops.rkt | 1 + hoax/test/test-runner.rkt | 1 + iniquity/compile-ops.rkt | 1 + iniquity/interp.rkt | 9 +++------ iniquity/test/test-runner.rkt | 1 + jig/compile-ops.rkt | 1 + jig/interp.rkt | 9 +++------ jig/test/test-runner.rkt | 1 + knock/compile-ops.rkt | 1 + knock/interp.rkt | 9 +++------ knock/test/test-runner.rkt | 1 + loot/compile-ops.rkt | 1 + loot/interp.rkt | 9 +++------ loot/test/test-runner.rkt | 1 + 14 files changed, 22 insertions(+), 24 deletions(-) diff --git a/hoax/compile-ops.rkt b/hoax/compile-ops.rkt index 8657643..138c4d1 100644 --- a/hoax/compile-ops.rkt +++ b/hoax/compile-ops.rkt @@ -161,6 +161,7 @@ (theend (gensym 'theend))) (seq (Pop r8) (assert-natural r8) + (assert-char rax) ; special case for length = 0 (Cmp r8 0) diff --git a/hoax/test/test-runner.rkt b/hoax/test/test-runner.rkt index 9f1053a..29eff4b 100644 --- a/hoax/test/test-runner.rkt +++ b/hoax/test/test-runner.rkt @@ -143,6 +143,7 @@ (check-equal? (run '"") "") (check-equal? (run '"fred") "fred") (check-equal? (run '"wilma") "wilma") + (check-equal? (run '(make-string 0 #t)) 'err) (check-equal? (run '(make-string 0 #\f)) "") (check-equal? (run '(make-string 3 #\f)) "fff") (check-equal? (run '(make-string 3 #\g)) "ggg") diff --git a/iniquity/compile-ops.rkt b/iniquity/compile-ops.rkt index 8657643..138c4d1 100644 --- a/iniquity/compile-ops.rkt +++ b/iniquity/compile-ops.rkt @@ -161,6 +161,7 @@ (theend (gensym 'theend))) (seq (Pop r8) (assert-natural r8) + (assert-char rax) ; special case for length = 0 (Cmp r8 0) diff --git a/iniquity/interp.rkt b/iniquity/interp.rkt index f749efd..80f12e9 100644 --- a/iniquity/interp.rkt +++ b/iniquity/interp.rkt @@ -66,16 +66,13 @@ (interp-e e (zip xs vs) ds) (raise 'err))]))])) -;; (Listof Expr) REnv Defns -> (Listof Value) | 'err +;; (Listof Expr) REnv Defns -> (Listof Value) { raises 'err } (define (interp-e* es r ds) (match es ['() '()] [(cons e es) - (match (interp-e e r ds) - ['err 'err] - [v (match (interp-e* es r ds) - ['err 'err] - [vs (cons v vs)])])])) + (cons (interp-e e r ds) + (interp-e* es r ds))])) ;; Defns Symbol -> Defn (define (defns-lookup ds f) diff --git a/iniquity/test/test-runner.rkt b/iniquity/test/test-runner.rkt index 6e4acb5..558308f 100644 --- a/iniquity/test/test-runner.rkt +++ b/iniquity/test/test-runner.rkt @@ -143,6 +143,7 @@ (check-equal? (run '"") "") (check-equal? (run '"fred") "fred") (check-equal? (run '"wilma") "wilma") + (check-equal? (run '(make-string 0 #t)) 'err) (check-equal? (run '(make-string 0 #\f)) "") (check-equal? (run '(make-string 3 #\f)) "fff") (check-equal? (run '(make-string 3 #\g)) "ggg") diff --git a/jig/compile-ops.rkt b/jig/compile-ops.rkt index 8657643..138c4d1 100644 --- a/jig/compile-ops.rkt +++ b/jig/compile-ops.rkt @@ -161,6 +161,7 @@ (theend (gensym 'theend))) (seq (Pop r8) (assert-natural r8) + (assert-char rax) ; special case for length = 0 (Cmp r8 0) diff --git a/jig/interp.rkt b/jig/interp.rkt index f749efd..80f12e9 100644 --- a/jig/interp.rkt +++ b/jig/interp.rkt @@ -66,16 +66,13 @@ (interp-e e (zip xs vs) ds) (raise 'err))]))])) -;; (Listof Expr) REnv Defns -> (Listof Value) | 'err +;; (Listof Expr) REnv Defns -> (Listof Value) { raises 'err } (define (interp-e* es r ds) (match es ['() '()] [(cons e es) - (match (interp-e e r ds) - ['err 'err] - [v (match (interp-e* es r ds) - ['err 'err] - [vs (cons v vs)])])])) + (cons (interp-e e r ds) + (interp-e* es r ds))])) ;; Defns Symbol -> Defn (define (defns-lookup ds f) diff --git a/jig/test/test-runner.rkt b/jig/test/test-runner.rkt index 6e4acb5..558308f 100644 --- a/jig/test/test-runner.rkt +++ b/jig/test/test-runner.rkt @@ -143,6 +143,7 @@ (check-equal? (run '"") "") (check-equal? (run '"fred") "fred") (check-equal? (run '"wilma") "wilma") + (check-equal? (run '(make-string 0 #t)) 'err) (check-equal? (run '(make-string 0 #\f)) "") (check-equal? (run '(make-string 3 #\f)) "fff") (check-equal? (run '(make-string 3 #\g)) "ggg") diff --git a/knock/compile-ops.rkt b/knock/compile-ops.rkt index 8657643..138c4d1 100644 --- a/knock/compile-ops.rkt +++ b/knock/compile-ops.rkt @@ -161,6 +161,7 @@ (theend (gensym 'theend))) (seq (Pop r8) (assert-natural r8) + (assert-char rax) ; special case for length = 0 (Cmp r8 0) diff --git a/knock/interp.rkt b/knock/interp.rkt index 9e264c2..9b91055 100644 --- a/knock/interp.rkt +++ b/knock/interp.rkt @@ -70,16 +70,13 @@ (let ((v (interp-e e r ds))) (interp-match v ps es r ds))])) -;; (Listof Expr) REnv Defns -> (Listof Value) | 'err +;; (Listof Expr) REnv Defns -> (Listof Value) { raises 'err } (define (interp-e* es r ds) (match es ['() '()] [(cons e es) - (match (interp-e e r ds) - ['err 'err] - [v (match (interp-e* es r ds) - ['err 'err] - [vs (cons v vs)])])])) + (cons (interp-e e r ds) + (interp-e* es r ds))])) ;; Value [Listof Pat] [Listof Expr] Env Defns -> Answer (define (interp-match v ps es r ds) diff --git a/knock/test/test-runner.rkt b/knock/test/test-runner.rkt index a7c0fef..68306a3 100644 --- a/knock/test/test-runner.rkt +++ b/knock/test/test-runner.rkt @@ -143,6 +143,7 @@ (check-equal? (run '"") "") (check-equal? (run '"fred") "fred") (check-equal? (run '"wilma") "wilma") + (check-equal? (run '(make-string 0 #t)) 'err) (check-equal? (run '(make-string 0 #\f)) "") (check-equal? (run '(make-string 3 #\f)) "fff") (check-equal? (run '(make-string 3 #\g)) "ggg") diff --git a/loot/compile-ops.rkt b/loot/compile-ops.rkt index 63090ff..14ae7d9 100644 --- a/loot/compile-ops.rkt +++ b/loot/compile-ops.rkt @@ -161,6 +161,7 @@ (theend (gensym 'theend))) (seq (Pop r8) (assert-natural r8) + (assert-char rax) ; special case for length = 0 (Cmp r8 0) diff --git a/loot/interp.rkt b/loot/interp.rkt index a1dfb50..1964be3 100644 --- a/loot/interp.rkt +++ b/loot/interp.rkt @@ -75,16 +75,13 @@ (interp-e e (append (zip xs vs) r) ds) (raise 'err)))])) -;; (Listof Expr) REnv Defns -> (Listof Value) | 'err +;; (Listof Expr) REnv Defns -> (Listof Value) { raises 'err } (define (interp-e* es r ds) (match es ['() '()] [(cons e es) - (match (interp-e e r ds) - ['err 'err] - [v (match (interp-e* es r ds) - ['err 'err] - [vs (cons v vs)])])])) + (cons (interp-e e r ds) + (interp-e* es r ds))])) ;; Id Env [Listof Defn] -> Answer (define (interp-var x r ds) diff --git a/loot/test/test-runner.rkt b/loot/test/test-runner.rkt index 9d32fe3..d5ecf65 100644 --- a/loot/test/test-runner.rkt +++ b/loot/test/test-runner.rkt @@ -143,6 +143,7 @@ (check-equal? (run '"") "") (check-equal? (run '"fred") "fred") (check-equal? (run '"wilma") "wilma") + (check-equal? (run '(make-string 0 #t)) 'err) (check-equal? (run '(make-string 0 #\f)) "") (check-equal? (run '(make-string 3 #\f)) "fff") (check-equal? (run '(make-string 3 #\g)) "ggg")