Open mbutterick opened 8 years ago
It turns out that indenting doesn't change the content of the at-expression, because the at-reader is defined to discard any leading whitespace that appears on all lines.
A better example, perhaps:
#lang at-exp racket
@list|{
{
bar
}
}|
'("{" "\n" "bar" "\n" "}")
Gets indented like so:
#lang at-exp racket
@list|{
{
bar
}
}|
Which changes the result:
'(" " "{" "\n" " " "bar" "\n" "}")
Of course, I can use a here-string instead (the indenter seems to leave those alone). Maybe the more specific problem here is that the indenter is mishandling the special case of alternate curly delimiters.
Yeah, the whole point of the @-syntax is that tools (like indenters) can invade the text part, but only if the relative indentation in there isn't changed -- but in the last example you have it does indeed change that. It also looks broken with plain {}
delimiters: it looks like it's indenting the text inside nested braces by one space.
Before indentation:
After:
Note the space inserted before
"foo"
, which changes the data represented by this at-expression. Since whitespace is meaningful inside curly braces, the indenter should always leave those sections alone.