mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Syntax] Rewrite SyntaxParsingContext
Read RawSyntaxToken along with Parser::consumeToken() * Single Lexer pass * Backtracking support * Split token support
This commit is contained in:
@@ -83,7 +83,6 @@ namespace syntax {
|
||||
class SourceFileSyntax;
|
||||
class SyntaxParsingContext;
|
||||
class SyntaxParsingContextRoot;
|
||||
struct RawSyntaxInfo;
|
||||
}
|
||||
|
||||
/// Discriminator for file-units.
|
||||
@@ -1083,21 +1082,15 @@ public:
|
||||
bool shouldKeepSyntaxInfo() const;
|
||||
|
||||
syntax::SourceFileSyntax getSyntaxRoot() const;
|
||||
void setSyntaxRoot(syntax::SourceFileSyntax &&Root);
|
||||
bool hasSyntaxRoot() const;
|
||||
|
||||
private:
|
||||
friend class syntax::SyntaxParsingContext;
|
||||
friend class syntax::SyntaxParsingContextRoot;
|
||||
|
||||
/// If not None, the underlying vector should contain tokens of this source file.
|
||||
Optional<std::vector<Token>> AllCorrectedTokens;
|
||||
|
||||
/// All of the raw token syntax nodes in the underlying source.
|
||||
std::vector<syntax::RawSyntaxInfo> AllRawTokenSyntax;
|
||||
|
||||
SourceFileSyntaxInfo &SyntaxInfo;
|
||||
|
||||
void setSyntaxRoot(syntax::SourceFileSyntax &&Root);
|
||||
bool hasSyntaxRoot() const;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user