mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[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.
This commit is contained in:
@@ -2192,8 +2192,11 @@ static int readFileLineByLine(StringRef Path, llvm::StringSet<> &Lines) {
|
||||
StringRef Line;
|
||||
std::tie(Line, BufferText) = BufferText.split('\n');
|
||||
Line = Line.trim();
|
||||
if (!Line.empty())
|
||||
Lines.insert(Line);
|
||||
if (Line.empty())
|
||||
continue;
|
||||
if (Line.startswith("// ")) // comment.
|
||||
continue;
|
||||
Lines.insert(Line);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user