Closed AlexKnauth closed 9 years ago
The reason I wanted to do this was so that if I'm making a macro that will be used like this:
my-cond
#:if condition
body ...+
#:else
body ...+
So it will read to this:
(my-cond
#:if [condition
body ...]
#:else
:body-or-bodys ; depending on how many expressions there were
)
Where body-or-bodys is like this:
[pattern
(~and bodys [body:expr ...+])
#:when (syntax-property #'bodys 'sweet-exp-not-actual-parens)]
[pattern single-body #:with (body ...) #'(singe-body)]
But I don't what it to un-parenthesize things that actually were supposed to have parentheses, so I would want to look at the syntax-property to see whether those parens were put there by the user or by sweet-exp.
There's another problem with this as well, because if there is a single expression that was read as a sweet-exp, then it would un-parenthesize that, but I'm not sure there's a good way to solve that. The syntax-property could still be useful for other macros though.
I think a better way to solve problems like this would be to provide it as an extra option for the 'paren-shape syntax property, so I'm closing this.
If you, I, or someone else thinks providing it as a 'paren-shape property would be useful for something, then I'll make that a new pull request.
The srcloc tests are failing on Travis CI, but they work fine when I run it in DrRacket or with command-line racket.