-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
See explanation here: jashkenas#4306 (comment)
…om `master` as we can get away with
…formance improvements
…s.coffee; improve error message so that "own" is underlined
lydell
approved these changes
Nov 8, 2016
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.
Good job!
The ownTag
hack looks good to me.
This was referenced Nov 8, 2016
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 intoerror_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 withx
underlined. Since the error is about theown
, it seems to me that theown
is what should get emphasized. Getting the location data for theown
tag (token?) entailed some trickery, though, as that token was basically discarded by the parser. See the new code added togrammar.coffee
regardingownTag
—@lydell, is this kosher? Should I be calling thisownToken
or something else? Or is there a better way to get this location data intoFor
?The other changes since #4306 involve fixing style and minimizing the impact of this PR, removing unnecessary changes.