Skip to content
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 a for .. from .. loop for generators, see #4306, #3832 #4355

Merged
merged 20 commits into from
Nov 8, 2016

Conversation

GeoffreyBooth
Copy link
Collaborator

Trying to get #4306 over the finish line. There’s one significant change between that PR and this one: I moved the "own is not supported in for-from loops" test into error_messages.coffee, and improved the error message generated for that error.

Previously, code like x for own x from [1, 2, 3] would throw the above error but with x underlined. Since the error is about the own, it seems to me that the own is what should get emphasized. Getting the location data for the own tag (token?) entailed some trickery, though, as that token was basically discarded by the parser. See the new code added to grammar.coffee regarding ownTag@lydell, is this kosher? Should I be calling this ownToken or something else? Or is there a better way to get this location data into For?

The other changes since #4306 involve fixing style and minimizing the impact of this PR, removing unnecessary changes.

@GeoffreyBooth GeoffreyBooth added this to the 2.0.0 milestone Nov 8, 2016
@GeoffreyBooth GeoffreyBooth removed this from the 2.0.0 milestone Nov 8, 2016
Copy link
Collaborator

@lydell lydell left a comment

Choose a reason for hiding this comment

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

Good job!

The ownTag hack looks good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants