Skip to content

Commit 2358c89

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 c2280ab commit 2358c89

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
@@ -2192,8 +2192,11 @@ static int readFileLineByLine(StringRef Path, llvm::StringSet<> &Lines) {
21922192
StringRef Line;
21932193
std::tie(Line, BufferText) = BufferText.split('\n');
21942194
Line = Line.trim();
2195-
if (!Line.empty())
2196-
Lines.insert(Line);
2195+
if (Line.empty())
2196+
continue;
2197+
if (Line.startswith("// ")) // comment.
2198+
continue;
2199+
Lines.insert(Line);
21972200
}
21982201
return 0;
21992202
}

0 commit comments

Comments
 (0)