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

for loop etc. #108

Merged
merged 3 commits into from May 10, 2013
Merged

for loop etc. #108

merged 3 commits into from May 10, 2013

Conversation

prakashk
Copy link
Member

  • Remove the need for semicolons on assignment statements and other places
  • for(each) loop (still to do: bind topic variable to each list element when executing the body)
  • C-style for loop

stevan pushed a commit that referenced this pull request May 10, 2013
@stevan stevan merged commit da70954 into master May 10, 2013
@stevan
Copy link
Member

stevan commented May 10, 2013

@prakashk, have I told you lately how awesome you are?

@prakashk
Copy link
Member Author

:)

Most of the work implementing for/foreach was already there. All I did was add the productions for each of them. BTW, there are a couple of XXX comments in ForeachNode code. I didn't try to understand the issues mentioned and am not sure if they are still applicable. Please review and remove them if no longer needed.

On the other hand, I had to spend considerable amount of time fixing the statement terminator issue. I am still not sure if it is 100% there.

@jasonmay
Copy link
Member

@prakashk,

First of all, thanks for all your hard work.

Some of those XXX notes are mine. I think the second one (about having issues wrapping the object in an AST) was when I introduced the applyScopeInjection. What I wanted to try to do was massage the AST a bit and then evaluate the whole loop as a series of statements. But you have to evaluate the list first, making it impossible to do so.

I think the way this is done is good for now. I admit my applyScopeInjection isn't super graceful, but I think its use in ForeachNode is fine for now and we can cross that bridge when the interpreter starts getting cleaned up.

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.

None yet

3 participants