-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Add 'EscapedFromIfConfig' bit to Decl #6963
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
Add 'EscapedFromIfConfig' bit to Decl #6963
Conversation
This is a temporary stop-gap for getting round-trip parsing off the ground. The real fix, not re-injecting declarations into an if-config's declaration context, is a deep dive and is still ongoing.
@swift-ci Please smoke test |
@DougGregor – are you ok with this temporary fix? I'm a bit stuck on conversions between operands of binary operators that I'll probably need your help with and I want to keep going getting round-trip printing up and running |
I'll make you a deal. If you delete an equivalent number of lines of code from another file, you can merge this :-) |
FWIW I have a branch looking at what I think the "deep dive" to fix this looks like. It ain't pretty, and it might cost us a pointer or two space in some AST nodes, but it gets the job done. @DougGregor It would be helpful to know what parts of the ASTScope haven't been hammered out yet. |
I don't believe you need to add any additional storage to stop leaking decls from if-configs. |
Not under the current model. But to make this more dynamic (that is, to divest Parse of the responsibility) it has to be remodeled. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm okay with this, but of course I'd love to see @slavapestov 's code-deletion challenge met :)
@CodaFi |
Thanks @DougGregor. I'll do my best to improve IfConfigDecl this week but I don't know if it will result in a net loss of LOC. I'll try to find some blank lines to sacrifice. ;-) |
This is a temporary stop-gap for getting round-trip parsing
off the ground. The real fix, not re-injecting declarations
into an if-config's declaration context, is a deep dive and
is still ongoing.