scribble
scribble copied to clipboard
scribble/example does not preserve syntax properties
examples from scribble/example does not preserve the 'paren-shape syntax property, and presumably drops other syntax properties as well. Given the following program:
#lang scribble/manual
@(require scribble/example)
@(examples (syntax-property #'[1 2 3] 'paren-shape))
…it produces the following output:
> (syntax-property #'[1 2 3] 'paren-shape)
#f
This is not due to scribble/manual, because the following program works as expected:
@(println (syntax-property #'[1 2 3] 'paren-shape))
; => #\[
After doing some digging (with the intent to possibly come up with a fix), I found a workaround that seems to work well enough for me to use it without implementing a fix and worry about dealing with older versions of Racket: using the #:preserve-source-locations option preserves syntax-original?-ness and 'paren-shape (though, strangely, not other syntax properties).