-
Notifications
You must be signed in to change notification settings - Fork 172
Open
Labels
EnhancementNew feature requestNew feature request
Description
Because Sourceror is not part of js-slang, the pre-processing step which handles imports & exports does not work with Sourceror. This means that the WebAssembly variants of Source do not support multi-file programs currently. Instead, only the entrypoint file is passed to Sourceror currently:
frontend/src/commons/sagas/WorkspaceSaga.ts
Lines 1035 to 1060 in f2b05b2
const entrypointCode = files[entrypointFilePath]; | |
function call_variant(variant: Variant) { | |
if (variant === Variant.NON_DET) { | |
return entrypointCode.trim() === TRY_AGAIN | |
? call(resume, lastNonDetResult) | |
: call(runFilesInContext, files, entrypointFilePath, context, { | |
executionMethod: 'interpreter', | |
originalMaxExecTime: execTime, | |
stepLimit: stepLimit, | |
useSubst: substActiveAndCorrectChapter | |
}); | |
} else if (variant === Variant.LAZY) { | |
return call(runFilesInContext, files, entrypointFilePath, context, { | |
scheduler: 'preemptive', | |
originalMaxExecTime: execTime, | |
stepLimit: stepLimit, | |
useSubst: substActiveAndCorrectChapter | |
}); | |
} else if (variant === Variant.WASM) { | |
// Note: WASM does not support multiple file programs. | |
return call(wasm_compile_and_run, entrypointCode, context, actionType === EVAL_REPL); | |
} else { | |
throw new Error('Unknown variant: ' + variant); | |
} | |
} |
Metadata
Metadata
Assignees
Labels
EnhancementNew feature requestNew feature request