www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit 68a7178b7e756620c014658418dda3cd66f3d0c9
parent 643988a0b9d559c321abb52c728062fb3fffc826
Author: Georges Dupéron <georges.duperon@gmail.com>
Date:   Mon, 29 Aug 2016 01:29:15 +0200

Removed automatic addition of -mixin, since now we don't implicitly define a splicing-syntax-class for each mixin.

Diffstat:
Mmain.rkt | 3+--
Mtest/test-structure-options.rkt | 12++++++++----
2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/main.rkt b/main.rkt @@ -58,9 +58,8 @@ (syntax-parser [(_ name ((~literal pattern) pat) ...) (let () - (define/with-syntax mixin (format-id #'name "~a-mixin" #'name)) (define-temp-ids "~a/clause" (pat ...)) - #'(define-eh-mixin-expander mixin + #'(define-eh-mixin-expander name (λ (_) (quote-syntax (~or pat ...)))))])) diff --git a/test/test-structure-options.rkt b/test/test-structure-options.rkt @@ -16,14 +16,14 @@ structure-kw-fields-mixin structure-kw-all-mixin) -(define-eh-alternative-mixin structure-kw-instance-or-builder +(define-eh-alternative-mixin structure-kw-instance-or-builder-mixin (pattern {~optional {~and instance-or-builder {~or {~global-or instance #:instance} {~global-or builder #:builder}}} #:name "either #:instance or #:builder"})) -(define-eh-alternative-mixin structure-kw-predicate +(define-eh-alternative-mixin structure-kw-predicate-mixin (pattern {~optional {~seq #:? predicate:id} #:name "#:? predicate"})) @@ -39,22 +39,26 @@ (~a "If no fields are specified, then either #:builder or #:instance" " must be present")) -(define-eh-alternative-mixin structure-kw-fields +(define-eh-alternative-mixin structure-kw-fields-mixin (pattern {~optional/else {~or {~seq {~or-bug [field:id] field:id} …+ {~global-or builder} + {~global-or no-types} {~post-fail no-values-err #:when (attribute instance)}} {~seq [field:id : type] …+ {~global-or builder} + {~global-or types} {~post-fail no-values-err #:when (attribute instance)}} {~seq [field:id value:expr] …+ {~global-or instance} + {~global-or no-types} {~post-fail values-err #:when (attribute builder)}} {~seq {~or-bug [field:id value:expr : type] [field:id : type value:expr]} …+ {~global-or instance} + {~global-or types} {~post-fail values-err #:when (attribute builder)}}} #:defaults ([(field 1) (list)] [(value 1) (list)] @@ -65,7 +69,7 @@ " [field value] or [field : type value]" " or [field value : type] for #:instance")})) -(define-eh-alternative-mixin structure-kw-all +(define-eh-alternative-mixin structure-kw-all-mixin (pattern {~or {structure-kw-instance-or-builder-mixin} {structure-kw-predicate-mixin} {structure-kw-fields-mixin}}))