Closed lucaswerkmeister closed 10 years ago
The second line doesn’t even need to be indented. It’s just always aligned to the ``` of the string part it’s currently in, not the
"` of the proper string start.
String templates can be nested, by the way:
void testIssue39() {
print("This `` "
text `` "
has" ``" ``
nested `` "
templates" ``");
// but is printed without any indentation
}
Luckily, the grammar has different token types for string starts, mids, ends, and literals, so it should be possible to keep some stack of charPositionInLine
s.
Crud, even more problems. The (
’s indentAfter
can only start after the string is completely processed.
Oohh… I not only need to carry over the charPositionInLine
s for write
’s sourceColumn
, but also the targetColumn
, which currently comes from the countingWriter
.
YES! It works! Commit incoming, but YES!! Sorry, I’m excited, this bug had me really worried. Carry on.
Crud, even more problems. The
(
’s indentAfter can only start after the string is completely processed.
Somehow, this problem vanished, because I’m not dealing with it specifically… I’m okay with that :)
Input:
Output: