libSyntax: rename KeepTokensInSourceFile to KeepSyntaxInfoInSourceFile.

This commit is contained in:
Xi Ge
2017-11-03 16:56:04 -07:00
parent 4ee32a125e
commit 6af5d3c0bf
12 changed files with 29 additions and 30 deletions

View File

@@ -1346,7 +1346,7 @@ static void performAutoImport(
SourceFile::SourceFile(ModuleDecl &M, SourceFileKind K,
Optional<unsigned> bufferID,
ImplicitModuleImportKind ModImpKind,
bool KeepTokens)
bool KeepSyntaxInfo)
: FileUnit(FileUnitKind::Source, M),
BufferID(bufferID ? *bufferID : -1),
Kind(K), SyntaxInfo(*new SourceFileSyntaxInfo()) {
@@ -1358,7 +1358,7 @@ SourceFile::SourceFile(ModuleDecl &M, SourceFileKind K,
assert(!problem && "multiple main files?");
(void)problem;
}
if (KeepTokens) {
if (KeepSyntaxInfo) {
AllCorrectedTokens = std::vector<Token>();
}
}
@@ -1366,16 +1366,16 @@ SourceFile::SourceFile(ModuleDecl &M, SourceFileKind K,
SourceFile::~SourceFile() { delete &SyntaxInfo; }
std::vector<Token> &SourceFile::getTokenVector() {
assert(shouldKeepTokens() && "Disabled");
assert(shouldKeepSyntaxInfo() && "Disabled");
return *AllCorrectedTokens;
}
ArrayRef<Token> SourceFile::getAllTokens() const {
assert(shouldKeepTokens() && "Disabled");
assert(shouldKeepSyntaxInfo() && "Disabled");
return *AllCorrectedTokens;
}
bool SourceFile::shouldKeepTokens() const {
bool SourceFile::shouldKeepSyntaxInfo() const {
switch (Kind) {
case SourceFileKind::Library:
case SourceFileKind::Main: