diff --git a/loot/parse.rkt b/loot/parse.rkt index 113085f..07fe29f 100644 --- a/loot/parse.rkt +++ b/loot/parse.rkt @@ -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 @@ -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) diff --git a/loot/test/parse.rkt b/loot/test/parse.rkt index 14b56e2..839f472 100644 --- a/loot/test/parse.rkt +++ b/loot/test/parse.rkt @@ -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))))))