Skip to content

Commit

Permalink
CSE Machine: Changes to step count (#1582)
Browse files Browse the repository at this point in the history
* context.runtime.envStepsTotal now updates while interpreter is running

* steps now refer to number of steps completed
  • Loading branch information
NhatMinh0208 authored Mar 17, 2024
1 parent 20b0810 commit 8b95d80
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/cse-machine/interpreter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,9 @@ export function* generateCSEMachineStateStream(
) {
context.runtime.break = false
context.runtime.nodes = []
let steps = 1

// steps: number of steps completed
let steps = 0

let command = control.peek()

Expand Down Expand Up @@ -357,11 +359,11 @@ export function* generateCSEMachineStateStream(
command = control.peek()

steps += 1
yield { stash, control, steps }
}
if (!isPrelude) {
context.runtime.envStepsTotal = steps
}

if (!isPrelude) {
context.runtime.envStepsTotal = steps
yield { stash, control, steps }
}
}

Expand Down

0 comments on commit 8b95d80

Please sign in to comment.