Skip to content

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

Merged
merged 1 commit into from
Jan 23, 2017
Merged

Add 'EscapedFromIfConfig' bit to Decl #6963

merged 1 commit into from
Jan 23, 2017

Conversation

bitjammer
Copy link
Contributor

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.

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.
@bitjammer
Copy link
Contributor Author

@swift-ci Please smoke test

@bitjammer bitjammer requested a review from DougGregor January 21, 2017 05:51
@bitjammer
Copy link
Contributor Author

@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

@slavapestov
Copy link
Contributor

I'll make you a deal. If you delete an equivalent number of lines of code from another file, you can merge this :-)

@CodaFi
Copy link
Contributor

CodaFi commented Jan 22, 2017

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.

@bitjammer
Copy link
Contributor Author

I don't believe you need to add any additional storage to stop leaking decls from if-configs.

@CodaFi
Copy link
Contributor

CodaFi commented Jan 22, 2017

Not under the current model. But to make this more dynamic (that is, to divest Parse of the responsibility) it has to be remodeled.

Copy link
Member

@DougGregor DougGregor left a 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 :)

@DougGregor
Copy link
Member

@CodaFi ASTScope is still a bit broken, actually. It blows up still on some invalid code, mainly because the parser doesn't create sensible source ranges for broken code all the time. There might be some other oddities it doesn't handle well. I don't think it's hard to fix, but it just takes time to turn it on in stages and fix the breakage.

@bitjammer
Copy link
Contributor Author

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. ;-)

@bitjammer bitjammer merged commit 902880a into swiftlang:master Jan 23, 2017
@bitjammer bitjammer deleted the decl-escaped-from-ifconfig-bit branch January 23, 2017 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants