Skip to content

Commit

Permalink
Merge pull request #23 from cmsc430/crook
Browse files Browse the repository at this point in the history
crook
  • Loading branch information
dvanhorn authored Dec 3, 2024
2 parents 11bf381 + 2d5ce23 commit 7ae6c06
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions loot/parse.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
;; Parse a (potentially open) expression
(define (parse-e s)
(match (parse-e/acc s '() '())
[(list _ _ e) e]))
[(list _ e) e]))

;; S-Expr -> Expr
;; Parse a (potentially open) definition
Expand Down Expand Up @@ -149,7 +149,7 @@
[(list 'if e1 e2 e3)
(list ys (If e1 e2 e3))]
[(list-rest g es)
(list (cons g ys) (App g es))])])])]
(list (cons g ys) (App (Var g) es))])])])]
[(cons s sr)
(match (parse-e/acc s xs ys)
[(list ys e)
Expand Down
3 changes: 3 additions & 0 deletions loot/test/parse.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,7 @@
(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 ; Loot
(check-equal? (parse '(f x))
(p (App (Var 'f) (list (Var 'x))))))

0 comments on commit 7ae6c06

Please sign in to comment.