Preemptive bugfix

This commit is contained in:
Georges Dupéron 2016-09-23 00:31:08 +02:00
parent 0b6508958f
commit 354794a185
2 changed files with 19 additions and 14 deletions

View File

@ -6,7 +6,8 @@
syntax/parse
phc-toolkit/untyped)
"no-order.rkt"
"pre.rkt")
"pre.rkt"
"parameters.rkt")
(provide ~before
~after
@ -19,9 +20,10 @@
[(_ other message pat )
(and (identifier? #'other)
(string? (syntax-e #'message)))
#'{~order-point pt
{~seq pat }
{~pre-fail message #:when (order-point> pt other)}}])))
(with-syntax ([pt (get-new-clause!)])
#'{~order-point pt
{~seq pat }
{~pre-fail message #:when (order-point> pt other)}})])))
(define-eh-mixin-expander ~after
(λ (stx)
@ -29,9 +31,10 @@
[(_ other message pat )
(and (identifier? #'other)
(string? (syntax-e #'message)))
#'{~order-point pt
{~seq pat }
{~pre-fail message #:when (order-point< pt other)}}])))
(with-syntax ([pt (get-new-clause!)])
#'{~order-point pt
{~seq pat }
{~pre-fail message #:when (order-point< pt other)}})])))
(define-eh-mixin-expander ~try-before
(λ (stx)
@ -39,9 +42,10 @@
[(_ other message pat )
(and (identifier? #'other)
(string? (syntax-e #'message)))
#'{~order-point pt
{~seq pat }
{~pre-fail message #:when (try-order-point> pt other)}}])))
(with-syntax ([pt (get-new-clause!)])
#'{~order-point pt
{~seq pat }
{~pre-fail message #:when (try-order-point> pt other)}})])))
(define-eh-mixin-expander ~try-after
(λ (stx)
@ -49,6 +53,7 @@
[(_ other message pat )
(and (identifier? #'other)
(string? (syntax-e #'message)))
#'{~order-point pt
{~seq pat }
{~pre-fail message #:when (try-order-point< pt other)}}])))
(with-syntax ([pt (get-new-clause!)])
#'{~order-point pt
{~seq pat }
{~pre-fail message #:when (try-order-point< pt other)}})])))

View File

@ -216,7 +216,7 @@
1)
(string-append "more than one of the lifted rest"
" patterns matched")}))))
((λ (x) #;(pretty-write (syntax->datum x)) x)
((λ (x) (pretty-write (syntax->datum x)) x)
#`(~delimit-cut
(~and #,(fix-disappeared-uses)
whole-clause-pat