Skip to content
This repository was archived by the owner on Oct 26, 2023. It is now read-only.

Commit 3a7388b

Browse files
rmculpepperjeapostrophe
authored andcommitted
fix macro for new syntax form
Racket's syntax form now interprets ??, so that identifier should be quoted (or escaped) so that it gets interpreted as part of the inner template.
1 parent be0b883 commit 3a7388b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

json-util.rkt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,18 @@
1111
(with-syntax ([(key_ ...) (generate-temporaries #'(key ...))]
1212
[(keyword ...)
1313
(for/list ([k (syntax->datum #'(key ...))])
14-
(string->keyword (symbol->string k)))])
14+
(string->keyword (symbol->string k)))]
15+
[??-id (quote-syntax ??)])
1516
(syntax/loc stx
1617
(define-match-expander name
1718
(λ (stx)
1819
(syntax-parse stx
1920
[(_ (~optional (~seq keyword key_)) ...)
20-
(quasitemplate/loc stx (hash-table (?? ['key (? ctc key_)]) ...))]))
21+
(quasitemplate/loc stx (hash-table (??-id ['key (? ctc key_)]) ...))]))
2122
(λ (stx)
2223
(syntax-parse stx
2324
[(_ (~optional (~seq keyword key_)) ...)
2425
(syntax/loc stx
2526
(make-hasheq (list (cons 'key key_) ...)))])))))]))
2627

27-
(provide define-json-expander)
28+
(provide define-json-expander)

0 commit comments

Comments
 (0)