Skip to content

Commit ee90f9d

Browse files
authored
Merge pull request #1506 from sogaiu/tweak-signal-doc
Add some detail to signal docstring
2 parents 88e60c3 + 906a982 commit ee90f9d

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/core/corelib.c

+9-1
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,15 @@ JANET_CORE_FN(janet_core_is_lengthable,
700700

701701
JANET_CORE_FN(janet_core_signal,
702702
"(signal what x)",
703-
"Raise a signal with payload x. ") {
703+
"Raise a signal with payload x. `what` can be an integer\n"
704+
"from 0 through 7 indicating user(0-7), or one of:\n\n"
705+
"* :ok\n"
706+
"* :error\n"
707+
"* :debug\n"
708+
"* :yield\n"
709+
"* :user(0-7)\n"
710+
"* :interrupt\n"
711+
"* :await") {
704712
janet_arity(argc, 1, 2);
705713
Janet payload = argc == 2 ? argv[1] : janet_wrap_nil();
706714
if (janet_checkint(argv[0])) {

src/core/util.c

+2
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ const char *const janet_type_names[16] = {
7979
"pointer"
8080
};
8181

82+
/* Docstring for signal lists these */
8283
const char *const janet_signal_names[14] = {
8384
"ok",
8485
"error",
@@ -96,6 +97,7 @@ const char *const janet_signal_names[14] = {
9697
"await"
9798
};
9899

100+
/* Docstring for fiber/status lists these */
99101
const char *const janet_status_names[16] = {
100102
"dead",
101103
"error",

0 commit comments

Comments
 (0)