Skip to content

Commit

Permalink
add fpcore check
Browse files Browse the repository at this point in the history
  • Loading branch information
bksaiki committed Aug 26, 2024
1 parent ca84d09 commit 2d446b3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/syntax/syntax.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -342,9 +342,11 @@
(cond
[fpcore ; provided -> TODO: check free variables, props
(match fpcore
[`(! ,props ... (,operator ,args ...)) (void)]
[`(! ,props ... (,operator ,args ...))
(unless (even? (length props))
(error 'register-operator-impl! "umatched property for ~a: ~a" name fpcore))]
[`(,operator ,args ...) (void)]
[_ (raise-herbie-syntax-error "Invalid fpcore for ~a: ~a" name fpcore)])
[_ (error 'register-operator-impl! "Invalid fpcore for ~a: ~a" name fpcore)])
fpcore]
[else ; not provided => need to generate it
(define repr (context-repr ctx))
Expand Down

0 comments on commit 2d446b3

Please sign in to comment.