mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Comment parsing: keep the column number of the first character to strip ASCII
art correctly when indentation is present Swift SVN r16656
This commit is contained in:
@@ -421,11 +421,13 @@ public:
|
||||
F.getContext().AllocateUninitialized<SingleRawComment>(NumComments);
|
||||
|
||||
for (unsigned i = 0; i != NumComments; ++i) {
|
||||
unsigned StartColumn =
|
||||
endian::readNext<uint32_t, little, unaligned>(data);
|
||||
unsigned RawSize = endian::readNext<uint32_t, little, unaligned>(data);
|
||||
auto RawText = StringRef(reinterpret_cast<const char *>(data), RawSize);
|
||||
data += RawSize;
|
||||
|
||||
new (&Comments[i]) SingleRawComment(RawText);
|
||||
new (&Comments[i]) SingleRawComment(RawText, StartColumn);
|
||||
}
|
||||
result.Raw = RawComment(Comments);
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user