From 906a982aceef8ad9dfbd4f5011a161c85bbdb3c9 Mon Sep 17 00:00:00 2001 From: sogaiu <983021772@users.noreply.github.com> Date: Tue, 17 Sep 2024 20:04:16 +0900 Subject: [PATCH] Add some detail to signal docstring --- src/core/corelib.c | 10 +++++++++- src/core/util.c | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/core/corelib.c b/src/core/corelib.c index 7ac7f564..ee4723b6 100644 --- a/src/core/corelib.c +++ b/src/core/corelib.c @@ -700,7 +700,15 @@ JANET_CORE_FN(janet_core_is_lengthable, JANET_CORE_FN(janet_core_signal, "(signal what x)", - "Raise a signal with payload x. ") { + "Raise a signal with payload x. `what` can be an integer\n" + "from 0 through 7 indicating user(0-7), or one of:\n\n" + "* :ok\n" + "* :error\n" + "* :debug\n" + "* :yield\n" + "* :user(0-7)\n" + "* :interrupt\n" + "* :await") { janet_arity(argc, 1, 2); Janet payload = argc == 2 ? argv[1] : janet_wrap_nil(); if (janet_checkint(argv[0])) { diff --git a/src/core/util.c b/src/core/util.c index 6cb5676e..a95f43af 100644 --- a/src/core/util.c +++ b/src/core/util.c @@ -79,6 +79,7 @@ const char *const janet_type_names[16] = { "pointer" }; +/* Docstring for signal lists these */ const char *const janet_signal_names[14] = { "ok", "error", @@ -96,6 +97,7 @@ const char *const janet_signal_names[14] = { "await" }; +/* Docstring for fiber/status lists these */ const char *const janet_status_names[16] = { "dead", "error",