[honu] ignore braces when computing syntax result for a pattern

This commit is contained in:
Jon Rafkind 2012-11-02 15:51:45 -06:00
parent 7ac80bbb01
commit 5d1bb74b42

View File

@ -391,7 +391,12 @@
(with-syntax ([(new-pattern ...) (convert-pattern honu-pattern mapping)] (with-syntax ([(new-pattern ...) (convert-pattern honu-pattern mapping)]
[((withs ...) ...) (set->list withs)] [((withs ...) ...) (set->list withs)]
[(result-with ...) (if (syntax-e maybe-out) [(result-with ...) (if (syntax-e maybe-out)
(with-syntax ([(out ...) maybe-out]) (with-syntax ([(out ...)
(syntax-parse maybe-out
#:literal-sets (cruft)
[(#%braces what ...)
#'(what ...)])
])
#'(#:with result (parse-stuff honu-syntax (#%parens out ...)))) #'(#:with result (parse-stuff honu-syntax (#%parens out ...))))
#'(#:with result #'()))]) #'(#:with result #'()))])
(syntax/loc honu-pattern (syntax/loc honu-pattern
@ -423,10 +428,11 @@
new-pattern ... new-pattern ...
#; #;
[pattern (~seq new-pattern ...) [pattern x #:when (begin
withs ... ... (debug "All patterns failed for ~a\n" 'name)
result-with ... #f)]
])))))
)))))
(debug "Output is ~a\n" (pretty-syntax output)) (debug "Output is ~a\n" (pretty-syntax output))
output)]))) output)])))