Skip to content

Commit

Permalink
Add some detail to signal docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
sogaiu committed Sep 17, 2024
1 parent 88e60c3 commit 906a982
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/core/corelib.c
Original file line number Diff line number Diff line change
Expand Up @@ -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])) {
Expand Down
2 changes: 2 additions & 0 deletions src/core/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down

0 comments on commit 906a982

Please sign in to comment.