syntax/parse/experimental/template: make errors consistent with 'syntax'

This commit is contained in:
Ryan Culpepper 2012-09-26 20:41:35 -04:00
parent d9a58e5a6d
commit d8296a31f5
2 changed files with 3 additions and 6 deletions

View File

@ -224,7 +224,7 @@ An VarRef is one of
(parameterize ((current-template-metafunction-introducer mark))
(let ([r (call-with-continuation-barrier (lambda () (mf (mark (old-mark v)))))])
(unless (syntax? r)
(raise-syntax-error 'template "result of metafunction was not syntax" stx))
(raise-syntax-error #f "result of template metafunction was not syntax" stx))
(restx stx (old-mark (mark r))))))))]
[(vector 'vector g1)

View File

@ -508,7 +508,7 @@ instead of integers and integer vectors.
[(tdrivers tguide tprops-guide)
(parse-t tail depth esc?)])
(when (set-empty? hdrivers)
(wrong-syntax #'head "no pattern variables in term before ellipsis"))
(wrong-syntax #'head "no pattern variables before ellipsis in template"))
(when (set-empty? (set-filter hdrivers (pvar/dd<=? depth)))
;; FIXME: improve error message?
(let ([bad-dots
@ -626,10 +626,7 @@ instead of integers and integer vectors.
[(>= depth pvar-depth)
(pvar v attr (- depth pvar-depth))]
[else
(wrong-syntax id
(string-append "pattern variable used at wrong ellipsis depth "
"(expected at least ~s, used at ~s)")
pvar-depth depth)]))]
(wrong-syntax id "missing ellipses with pattern variable in template")]))]
[(template-metafunction? v)
v]
[else