Skip to content

Commit a10eed9

Browse files
committed
[api-digester] For readFileLineByLine() ignore lines that are comments
Allows us to add informational comments in the text files that are used as inputs for the digester.
1 parent d800f35 commit a10eed9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tools/swift-api-digester/swift-api-digester.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2208,8 +2208,11 @@ static int readFileLineByLine(StringRef Path, llvm::StringSet<> &Lines) {
22082208
StringRef Line;
22092209
std::tie(Line, BufferText) = BufferText.split('\n');
22102210
Line = Line.trim();
2211-
if (!Line.empty())
2212-
Lines.insert(Line);
2211+
if (Line.empty())
2212+
continue;
2213+
if (Line.startswith("// ")) // comment.
2214+
continue;
2215+
Lines.insert(Line);
22132216
}
22142217
return 0;
22152218
}

0 commit comments

Comments
 (0)