From 6f663028cba42af3106ce75cd0aeefb2363b069c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Georges=20Dup=C3=A9ron?= Date: Thu, 17 May 2018 02:28:45 +0200 Subject: [PATCH] Compatibility with Racket 7: the syntax? field of attribute-mapping is now called check, and holds a different value. --- untyped-only/syntax-parse.rkt | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/untyped-only/syntax-parse.rkt b/untyped-only/syntax-parse.rkt index 014c025..e39f49f 100644 --- a/untyped-only/syntax-parse.rkt +++ b/untyped-only/syntax-parse.rkt @@ -9,14 +9,22 @@ (version-case [(version< (version) "6.90.0.24") - (require (prefix-in - syntax/parse/private/residual))] + (require (prefix-in - syntax/parse/private/residual)) + (define-for-syntax (compatibility-syntax-or-check syntax?) + syntax?)] [else (require (rename-in (prefix-in - racket/private/template) - [-attribute-mapping -make-attribute-mapping])) + [-attribute-mapping -make-attribute-mapping]) + (only-in syntax/parse/private/residual ;; must be an absolute path + check-attr-value)) (define-for-syntax (-attribute-mapping-syntax? x) ;; attribute-mapping-check is actually false when attribute-mapping-syntax? ;; would have been true (thanks rmculpepper !) - (not (-attribute-mapping-check x)))]) + (not (-attribute-mapping-check x))) + (define-for-syntax (compatibility-syntax-or-check syntax?) + (if syntax? + #f + (quote-syntax check-attr-value)))]) (provide attribute* (for-syntax attribute-info) @@ -90,7 +98,7 @@ (-make-attribute-mapping (quote-syntax valvar) 'name 'depth - 'syntax?)) + (compatibility-syntax-or-check 'syntax?))) (define-syntax name (make-syntax-mapping 'depth (quote-syntax tmp-attr)))))