Skip to content

Improve comments in non-det interpreter #47

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 2 commits into from
May 1, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/interpreter/interpreter-non-det.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ function* evaluateBlockSatement(context: Context, node: es.BlockStatement) {

function* evaluateSequence(context: Context, sequence: es.Statement[]): IterableIterator<Value> {
if (sequence.length === 0) {
return yield undefined // repl does not work unless we handle this case --> Why?
return yield undefined
}
const firstStatement = sequence[0]
const sequenceValGenerator = evaluate(firstStatement, context)
Expand All @@ -288,7 +288,7 @@ function* evaluateSequence(context: Context, sequence: es.Statement[]): Iterable

const res = yield* evaluateSequence(context, sequence)
if (res === CUT) {
// prevent unshifting of statenents before cut
// prevent unshifting of statements before cut
shouldUnshift = false
break
}
Expand Down