Skip to content

Implement SE-0039 (Modernizing Playground Literals) #2215

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 14 commits into from
Apr 25, 2016
Merged

Implement SE-0039 (Modernizing Playground Literals) #2215

merged 14 commits into from
Apr 25, 2016

Conversation

tkremenek
Copy link
Member

Implements SE-0039 (Modernizing Playground Literals).

@tkremenek tkremenek self-assigned this Apr 16, 2016

// FIXME: It feels like a layering violation to mention the protocol
// kind and description here, but essentially there is a single
// delcarative way to specify the shape of object literals, their
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo "declarative".

I think this approach is reasonable, no need for the FIXME.

@lattner
Copy link
Contributor

lattner commented Apr 16, 2016

Aside from the one comment typo, the patch looks great! Question though: what is the migration plan for this? This isn't producing fixits from the old to new syntax, and we want to make sure that playgrounds which use these get moved forward. It is probably worth it to keep the lexer/parser support for the old syntax in just to provide support to move to the new syntax.

@tkremenek
Copy link
Member Author

I was thinking about the migration plan as well, and that we should have fix-its. I agree keeping the old parser support --- or reworking it for that use case --- makes that possible.

For example, parse "#Image(imageLiteral:...)" and provide a FixIt to
change it to "#imageLiteral(resourceName:...)".  Now we see something like:

test.swift:4:9: error: '#Image' has been renamed to '#imageLiteral
var y = #Image(imageLiteral: "image.jpg")
        ^~~~~~ ~~~~~~~~~~~~
        #imageLiteral resourceName

Handling the old syntax, and providing a FixIt for that, will be handled in a separate
commit.

Needs tests.  Will be provided in later commit once full parsing support is done.
... and provide fixits to new syntax.

Full tests to come in later commit.
@tkremenek
Copy link
Member Author

@swift-ci test

@tkremenek
Copy link
Member Author

@swift-ci test

@tkremenek
Copy link
Member Author

@swift-ci test

@tkremenek tkremenek merged commit b8bbed8 into swiftlang:master Apr 25, 2016
@tkremenek tkremenek changed the title [WIP] Implement SE-0039 (Modernizing Playground Literals) Implement SE-0039 (Modernizing Playground Literals) Apr 25, 2016
@tkremenek tkremenek deleted the master-PR-SE-0039 branch April 25, 2016 14:21
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.

2 participants