Omit sli= when not transforming

This commit is contained in:
Georges Dupéron 2017-02-01 07:54:29 +01:00
parent c50e014c78
commit 4c07fc08b7

View File

@ -118,6 +118,7 @@
(define (sli/use whole-stx)
;(…)ˢˡⁱ⁼ ᵘˢᵉ⁼
;(…)ₛₗᵢ₌ ᵤₛₑ₌
(if (syntax-transforming?)
(let* ([stx (datum->syntax whole-stx 'to-id)]
[sli (syntax-local-introduce stx)]
[stx-ids (extract-scope-ids stx)]
@ -128,11 +129,14 @@
[sli-binding (extract-scope-ids sli-slb)]
[use (append (set-symmetric-difference stx-ids stx-binding)
(set-symmetric-difference sli-ids sli-binding))]
[stx/sli-use (set-subtract (set-symmetric-difference stx-ids sli-ids)
[stx/sli-use (set-subtract (set-symmetric-difference stx-ids
sli-ids)
use)])
(format "ˢˡⁱ⁼~a⁺ᵘˢᵉ⁼~a~a"
(string-join (map digits->superscripts (map ~a stx/sli-use)) " ")
(string-join (map digits->superscripts (map ~a use)) " ")
(string-join (map digits->superscripts (map ~a stx/sli-use))
" ")
(string-join (map digits->superscripts (map ~a use))
" ")
(if (sli-scopes)
(let* ([named ((sli-scopes) (datum->syntax #f 'zero))]
[named-scope-id (extract-scope-ids named)])
@ -140,7 +144,8 @@
(string-join (map digits->superscripts
(map ~a named-scope-id))
" ")))
""))))
"")))
""))
(define (+scopes stx)
(format "~a~a"