From 82efccf1b9603bbf13c4ad8c817e614003796ed0 Mon Sep 17 00:00:00 2001 From: dvanhorn Date: Tue, 3 Dec 2024 01:45:23 +0000 Subject: [PATCH] crook --- knock-plus/parse.rkt | 2 +- knock-plus/test/parse.rkt | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/knock-plus/parse.rkt b/knock-plus/parse.rkt index 63e0955..3909b18 100644 --- a/knock-plus/parse.rkt +++ b/knock-plus/parse.rkt @@ -213,7 +213,7 @@ ['_ (list ys xs gs (Var '_))] [(? symbol?) (list ys (cons p xs) gs (Var p))] [(list 'quote '()) - (list ys xs (Lit '()))] + (list ys xs gs (Lit '()))] [(list 'box s) (match (rec s xs ys gs) [(list ys xs gs p) diff --git a/knock-plus/test/parse.rkt b/knock-plus/test/parse.rkt index 7ec85c3..e24f612 100644 --- a/knock-plus/test/parse.rkt +++ b/knock-plus/test/parse.rkt @@ -71,6 +71,8 @@ (p (Match (Lit 1) (list (Var 'x)) (list (Var 'x))))) (check-equal? (parse '(match 1 [x y])) (p (Match (Lit 1) (list (Var 'x)) (list (Var 'y))))) + (check-equal? (parse '(match x ['() 1])) + (p (Match (Var 'x) (list (Lit '())) (list (Lit 1))))) (check-exn exn:fail? (λ () (parse-closed '(match 1 [x y]))))) (begin ; Knock+ (check-equal? (parse '(match 1 [(? f?) #t]))