-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Parser] Decouple the parser from AST creation (part 1) #25193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Instead of creating the AST directly in the parser (and libSyntax or SwiftSyntax via SyntaxParsingContext), make Parser to explicitly create a tree of ParsedSyntaxNodes. Their OpaqueSyntaxNodes can be either libSyntax or SwiftSyntax. If AST is needed, it can be generated from the libSyntax tree.
@swift-ci Please test |
Build failed |
@swift-ci Please test |
@jansvoboda11 Unfortunately, I had to revert this change because a few of our CI bots had trouble building after it was merged. From what I can see, the problem is that I also noticed a leaks test run with failures that may stem from this PR. I don't think there's a way to ask the CI bot to run a leaks test, but you can use |
Thanks for the heads-up @brentdax, I'll look into it ASAP. |
In my experience with unified builds, the project CMake files are already brittle in this regard. I think the following needs to be added in a few more CMakeLists.txt files but I haven't looked into it thoroughly:
|
Instead of creating the AST directly in the parser (and libSyntax or SwiftSyntax via SyntaxParsingContext), make Parser to explicitly create a tree of ParsedSyntaxNodes. Their OpaqueSyntaxNodes can be either libSyntax or SwiftSyntax. If AST is needed, it can be generated from the libSyntax tree.
This PR contains the infrastructure to achieve the goal in an incremental way and also refactored literal parsing.
This PR is a part of a Google Summer of Code 2019 project.