Skip to content

Commit 90a3003

Browse files
committed
wip: use custom module-return
1 parent 2f40fb4 commit 90a3003

1 file changed

Lines changed: 9 additions & 10 deletions

File tree

src/common/repl-runner.arr

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import require-util as RU
3131
import file("./visitors.arr") as V
3232
import file("./ast.arr") as CA
3333
include js-file("./runtime")
34+
import js-file("./interop/module-return") as MR
3435
include either
3536

3637
include js-file("../tools/debugging")
@@ -92,7 +93,7 @@ fun remove-checks(stx :: A.Program, check-name :: Option<String>) -> A.Program:
9293
stx.visit(V.make-check-filter(pred))
9394
end
9495

95-
#---------------------------run-with-alternate-impl---------------------------#
96+
#--------------------------[run-with-alternate-impl]--------------------------#
9697

9798
data RunAltImplErr:
9899
| ai-cannot-parse-student(err :: CA.ParsePathErr)
@@ -137,7 +138,7 @@ fun replace-fun(
137138
end
138139
end
139140

140-
#--------------------------run-with-alternate-checks--------------------------#
141+
#-------------------------[run-with-alternate-checks]-------------------------#
141142

142143
data RunAltChecksErr:
143144
| ac-cannot-parse-student(err :: CA.ParsePathErr)
@@ -184,7 +185,7 @@ fun add-to-program(stx :: A.Program, expr :: A.Expr):
184185
stx.visit(V.make-program-appender(expr))
185186
end
186187

187-
#----------------------------------run-checks----------------------------------#
188+
#---------------------------------[run-checks]---------------------------------#
188189

189190
data RunChecksErr:
190191
| compile-error(x :: Any, program :: A.Program) # TODO: whats in here?
@@ -218,13 +219,8 @@ fun run(program :: A.Program) -> Either<RunChecksErr, RunChecksResult> block:
218219
| right(val) =>
219220
if LL.is-success-result(val):
220221
val
221-
# ^ identity-print-raw
222-
^ lam(x) block:
223-
# print-module-result(x)
224-
x
225-
end
226-
^ LL.render-check-results(_)
227-
# ^ identity-spy
222+
^ MR.extract-check-results
223+
^ identity-spy
228224
^ _.message
229225
# ^ identity-print-json
230226
^ J.read-json
@@ -238,3 +234,6 @@ fun run(program :: A.Program) -> Either<RunChecksErr, RunChecksResult> block:
238234
end
239235
# ^ identity-spy
240236
end
237+
238+
239+
#----------------------------------run-checks----------------------------------#

0 commit comments

Comments
 (0)