From a992664ffbef704f88a77cbcb99ea27c32d8fe63 Mon Sep 17 00:00:00 2001 From: AlexKnauth Date: Thu, 24 May 2018 16:11:34 -0400 Subject: [PATCH] add scopes within boxes, vectors, hashes, and prefab structs --- superscripts.rkt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/superscripts.rkt b/superscripts.rkt index 7667b45..83b7566 100644 --- a/superscripts.rkt +++ b/superscripts.rkt @@ -1,6 +1,7 @@ #lang racket (require racket/syntax + racket/struct racket/string racket/format debug-scopes/named-scopes-sli-parameter) @@ -114,6 +115,16 @@ [(syntax? e) (datum->syntax e (add-scopes (syntax-e e)) e e)] [(pair? e) (cons (add-scopes (car e)) (add-scopes (cdr e)))] + [(box? e) + (box-immutable (add-scopes (unbox e)))] + [(vector? e) + (apply vector-immutable (map add-scopes (vector->list e)))] + [(hash? e) + (for/fold ([e e]) ([k (in-hash-keys e)]) + (hash-update e k add-scopes))] + [(prefab-struct-key e) + (define key (prefab-struct-key e)) + (apply make-prefab-struct key (map add-scopes (struct->list e)))] [else e])) (define (sli/use whole-stx)