Skip to content

Commit

Permalink
fix output of repl
Browse files Browse the repository at this point in the history
  • Loading branch information
s-kybound committed Apr 15, 2024
1 parent 82776e4 commit 106831f
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/repl/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,14 @@ export function validChapterVariant(language: Language) {

export function handleResult(result: Result, context: Context, verboseErrors: boolean) {
if (result.status === 'finished' || result.status === 'suspended-non-det') {
if (
result instanceof Closure ||
typeof result === 'function' ||
result.representation !== undefined
) {
return result.toString()
if (result.representation !== undefined) {
return result.representation
}

if (result.value instanceof Closure || typeof result.value === 'function') {
return result.value.toString()
}

return stringify(result.value)
}

Expand Down

0 comments on commit 106831f

Please sign in to comment.