Skip to content

Commit

Permalink
add failure check on match-define
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwparas committed Dec 29, 2023
1 parent 7c4fccc commit a172638
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions crates/steel-core/src/scheme/modules/match.scm
Original file line number Diff line number Diff line change
Expand Up @@ -250,14 +250,12 @@
(define final-expr
`(define-values (,@list-identifiers)
(let ([,temp ,(go-match pattern variable `(list ,@list-identifiers) (mutable-vector))])
(if (not (equal? #f))
(if (not (equal? #f ,temp))
,temp
(error-with-span (quote ,(syntax-span (third unwrapped)))
"Unable to match the given expression: "
,variable
"to any of the patterns")))))
; (displayln (syntax-span expression))
; (displayln final-expr)
(syntax/loc final-expr
(syntax-span expression)))

Expand Down

0 comments on commit a172638

Please sign in to comment.