@@ -2,7 +2,7 @@ import { compileAndRun as compileAndRunCCode } from '@sourceacademy/c-slang/ctow
22import { tokenizer } from 'acorn' ;
33import { IConduit } from 'conductor/dist/conduit' ;
44import { Context , interrupt , Result , resume , runFilesInContext } from 'js-slang' ;
5- import { ACORN_PARSE_OPTIONS , TRY_AGAIN } from 'js-slang/dist/constants' ;
5+ import { ACORN_PARSE_OPTIONS } from 'js-slang/dist/constants' ;
66import { InterruptedError } from 'js-slang/dist/errors/errors' ;
77import { manualToggleDebugger } from 'js-slang/dist/stdlib/inspector' ;
88import { Chapter , ErrorSeverity , ErrorType , SourceError , Variant } from 'js-slang/dist/types' ;
@@ -128,22 +128,9 @@ export function* evalCodeSaga(
128128 ) ;
129129
130130 const entrypointCode = files [ entrypointFilePath ] ;
131- const lastNonDetResult = yield select (
132- ( state : OverallState ) => state . workspaces [ workspaceLocation ] . lastNonDetResult
133- ) ;
134131
135132 function call_variant ( variant : Variant ) {
136- if ( variant === Variant . NON_DET ) {
137- return entrypointCode . trim ( ) === TRY_AGAIN
138- ? call ( resume , lastNonDetResult )
139- : call ( runFilesInContext , files , entrypointFilePath , context , {
140- executionMethod : 'interpreter' ,
141- originalMaxExecTime : execTime ,
142- stepLimit : stepLimit ,
143- useSubst : substActiveAndCorrectChapter ,
144- envSteps : currentStep
145- } ) ;
146- } else if ( variant === Variant . LAZY ) {
133+ if ( variant === Variant . LAZY ) {
147134 return call ( runFilesInContext , files , entrypointFilePath , context , {
148135 scheduler : 'preemptive' ,
149136 originalMaxExecTime : execTime ,
@@ -269,7 +256,6 @@ export function* evalCodeSaga(
269256 } ) ;
270257 }
271258
272- const isNonDet : boolean = context . variant === Variant . NON_DET ;
273259 const isLazy : boolean = context . variant === Variant . LAZY ;
274260 const isWasm : boolean = context . variant === Variant . WASM ;
275261 const isC : boolean = context . chapter === Chapter . FULL_C ;
@@ -286,11 +272,19 @@ export function* evalCodeSaga(
286272 ? DisplayBufferService . attachConsole ( workspaceLocation )
287273 : ( ) => { } ;
288274
289- const { result, interrupted, paused } = yield race ( {
275+ const {
276+ result,
277+ interrupted,
278+ paused
279+ } : {
280+ result : Result ;
281+ interrupted : any ;
282+ paused : any ;
283+ } = yield race ( {
290284 result :
291285 actionType === InterpreterActions . debuggerResume . type
292286 ? call ( resume , lastDebuggerResult )
293- : isNonDet || isLazy || isWasm
287+ : isLazy || isWasm
294288 ? call_variant ( context . variant )
295289 : isC
296290 ? call ( cCompileAndRun , entrypointCode , context )
@@ -357,7 +351,6 @@ export function* evalCodeSaga(
357351 if (
358352 result . status !== 'suspended' &&
359353 result . status !== 'finished' &&
360- result . status !== 'suspended-non-det' &&
361354 result . status !== 'suspended-cse-eval'
362355 ) {
363356 yield * dumpDisplayBuffer ( workspaceLocation , isStoriesBlock , storyEnv ) ;
@@ -401,11 +394,6 @@ export function* evalCodeSaga(
401394 yield put ( actions . endDebuggerPause ( workspaceLocation ) ) ;
402395 yield put ( actions . evalInterpreterSuccess ( 'Breakpoint hit!' , workspaceLocation ) ) ;
403396 return ;
404- } else if ( isNonDet ) {
405- if ( result . value === 'cut' ) {
406- result . value = undefined ;
407- }
408- yield put ( actions . updateLastNonDetResult ( result , workspaceLocation ) ) ;
409397 }
410398
411399 yield * dumpDisplayBuffer ( workspaceLocation , isStoriesBlock , storyEnv ) ;
0 commit comments