mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
libSyntax: rename KeepTokensInSourceFile to KeepSyntaxInfoInSourceFile.
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user