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)))))