Get tests passing again by returning keyword rather than nil from chunks

This commit is contained in:
LouisJackman 2020-05-21 18:37:15 +01:00
parent f0572c4d5f
commit 3c8930b72b
No known key found for this signature in database
GPG Key ID: C83A456999EEBC34
2 changed files with 4 additions and 2 deletions

View File

@ -2017,7 +2017,8 @@
(while going
(if (env :exit) (break))
(buffer/clear buf)
(if (nil? (chunks buf p))
(if (= (chunks buf p)
:cancel)
(do
# Nil chunks represents a cancelled form in the REPL, so reset.
(parser/flush p)

View File

@ -63,7 +63,8 @@ Janet janet_line_getter(int32_t argc, Janet *argv) {
gbl_cancel_current_repl_form = false;
// Signal that the user bailed out of the current form
result = janet_wrap_nil();
const static char *const msg = "cancel";
result = janet_ckeywordv(msg);
} else {
result = janet_wrap_buffer(buf);
}