Skip to content

Commit

Permalink
Log broken refactoring attempts as warnings
Browse files Browse the repository at this point in the history
This allows Resyntax to continue attempting to apply other refactoring rules when one rule breaks.
  • Loading branch information
jackfirth committed Aug 31, 2024
1 parent 9738e69 commit d80b31f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions main.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,9 @@
(with-handlers
([exn:fail?
(λ (e)
(define message
(format "~a: refactoring attempt failed\n syntax: ~e\n cause: ~e"
(object-name rule) syntax e))
(raise (exn:fail:refactoring message (current-continuation-marks) rule syntax e)))])
(log-resyntax-warning "~a: refactoring attempt failed\n syntax: ~e\n cause: ~e"
(object-name rule) syntax e)
absent)])
(guarded-block
(guard-match (present replacement)
(refactoring-rule-refactor rule syntax #:analysis analysis)
Expand Down

0 comments on commit d80b31f

Please sign in to comment.