Skip to content

Add while loops #39

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 17 commits into from
Apr 30, 2020
Merged

Add while loops #39

merged 17 commits into from
Apr 30, 2020

Conversation

arsalan0c
Copy link
Owner

@arsalan0c arsalan0c commented Apr 16, 2020

This PR adds support for while loops, including break, continue and return statements in the loop body

@arsalan0c arsalan0c force-pushed the non-det-reach-goals branch from 4735640 to 13a7fbf Compare April 20, 2020 14:26
@arsalan0c arsalan0c requested a review from anubh-v April 23, 2020 09:37
@arsalan0c arsalan0c marked this pull request as ready for review April 23, 2020 11:05
@arsalan0c arsalan0c self-assigned this Apr 23, 2020
@arsalan0c arsalan0c added the enhancement New feature or request label Apr 23, 2020
@arsalan0c arsalan0c changed the base branch from non-det-reach-goals to master April 28, 2020 05:18
@anubh-v
Copy link
Collaborator

anubh-v commented Apr 30, 2020

Looks good, but a minor issue: the error message for infinite loops could be improved
(i.e. we could try to detect the stack overflow)
(our evaluation of while loops results in stackoverflow, due to the support for amb within loops)

image

@anubh-v anubh-v merged commit b9f8a78 into master Apr 30, 2020
arsalan0c added a commit that referenced this pull request May 2, 2020
…ixes) (source-academy#594)

* Fix bug: yield new array (#40)

* fix bug: yield new array for array expression

* Add user friendly REPL message (#43)

* add user friendly REPL message

* Add randomized amb operator (#15)

Adds the ambR operator which functions similarly to amb
but makes choices randomly instead of sequentially.

Also adds landing page and library documentation for
the operator, and adds this operator into the specs.

* Add while loops (#39)

This PR adds support for while loops, including break,
continue and return statements in the loop body.

It also tweaks the scheduler so that stackoverflow errors
are captured and displayed to the user.

Co-authored-by: anubh-v <[email protected]>

* Clear the stack trace of any error created in REPL (#46)

* Add for loops (#41)

This PR adds support for for loops, including break,
continue and return statements in the loop body.
Co-authored-by: Anubhav <[email protected]>

* Add documentation for loops (#44)



Co-authored-by: anubh-v <[email protected]>

* Improve comments in non-det interpreter (#47)

* Remove unhelpful comment

* Fix spelling in comment

Co-authored-by: Arsalan Cheema <[email protected]>
Co-authored-by: martin-henz <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants