Syntax parse for better error messages

This commit is contained in:
William J. Bowman 2015-09-22 22:59:07 -04:00
parent eeb2b9182a
commit e4bf99c277
No known key found for this signature in database
GPG Key ID: DDD48D26958F0D1A

View File

@ -423,12 +423,11 @@
(syntax-case syn ()
[(_ . id) (normalize/syn #'id)]))
;; TODO: Syntax-parse
(define-syntax (dep-define syn)
(syntax-case syn (:)
[(_ (name (x : t)) e)
(syntax-parse syn
[(_ (name:id (x:id : t)) e)
#'(dep-define name (dep-lambda (x : t) e))]
[(_ id e)
[(_ id:id e)
(let ([e (cur->datum #'e)]
[id (syntax->datum #'id)])
(extend-Γ/term! gamma id (type-infer/term e))