Skip to content

Commit 16c7ee0

Browse files
committed
fix library class parsing bug
Previously, the library classes would be injected but the evaluator would not run the program to completion as it was limited by the input target step.
1 parent 2631fd6 commit 16c7ee0

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/ec-evaluator/index.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,18 @@ export const runECEvaluator = (
2525
if (typeCheckResult.hasTypeErrors) {
2626
const typeErrMsg = typeCheckResult.errorMsgs.join('\n')
2727
context.interfaces.stderr('TypeCheck', typeErrMsg)
28-
return Promise.resolve({ status: 'error' } as Error)
28+
console.error(typeErrMsg)
29+
return Promise.resolve({ status: 'error', context } as Error)
2930
}
3031

3132
// load library
3233
const libraryCompilationUnit = parse(libraryClasses)
3334
context.control.push(
3435
...handleSequence(libraryCompilationUnit.topLevelClassOrInterfaceDeclarations)
3536
)
36-
evaluate(context, targetStep)
37+
38+
// step size limit is irrelevant here, just makes injected library classes run to completion
39+
evaluate(context, 100000)
3740

3841
try {
3942
// parse() may throw SyntaxError.

0 commit comments

Comments
 (0)