Skip to content

Adding support for for..of and friends #84

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
May 2, 2019
Merged

Adding support for for..of and friends #84

merged 1 commit into from
May 2, 2019

Conversation

flbulgarelli
Copy link
Contributor

Hi!

This PR adds support for the following ES6 constructs:

  • for (let x; ...;...)
  • for (let x in ...)
  • for (let x of ...)
  • for (var x of ...)
  • for (x of ...)

Although these constructs are not listed in #71, I think this is part of the issue. I have added the three types of tests that are suggested there.

  • I have modeled the of token in a similar fashion to in. However, only in is a true binary-operator, but I think there will be no issues with that 🤷‍♂️
  • I have modeled the for...of control structure in a similar fashion to the current for-loops, but perhaps the AST may require a refactor in the future to avoid the cross product of all the var/let/in/of features 🤔

I hope everything is fine 🙏

Thanks! 😄

@erikd
Copy link
Owner

erikd commented May 2, 2019

Very nice! Thanks!

@erikd erikd merged commit e2337f4 into erikd:new-ast May 2, 2019
@erikd
Copy link
Owner

erikd commented May 2, 2019

Do you need this released to Hackage?

@flbulgarelli
Copy link
Contributor Author

Do you need this released to Hackage?

There is no hurry but that would be nice!

Than you for the fast response.

@erikd
Copy link
Owner

erikd commented May 2, 2019

New version published!

@flbulgarelli flbulgarelli deleted the feature-for-of-support branch April 15, 2020 13: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.

2 participants