Skip to content

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
Collaborator

erikd commented May 2, 2019

Very nice! Thanks!

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

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
Collaborator

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