aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorsogaiu <983021772@users.noreply.github.com>2024-09-17 20:04:16 +0900
committersogaiu <983021772@users.noreply.github.com>2024-09-17 20:04:16 +0900
commit906a982aceef8ad9dfbd4f5011a161c85bbdb3c9 (patch)
tree71b93e5bdf99b3b1510eef021d9289026106fd65
parentAdd overflow check. (diff)
Add some detail to signal docstring
-rw-r--r--src/core/corelib.c10
-rw-r--r--src/core/util.c2
2 files changed, 11 insertions, 1 deletions
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",