1
0
mirror of https://github.com/janet-lang/janet synced 2025-11-05 01:53:01 +00:00

Support adding arbitrary metadata to bindings

This commit is contained in:
Michael Camilleri
2021-03-24 09:38:12 +09:00
parent 37d6cb469b
commit ec2d7bf349
2 changed files with 15 additions and 0 deletions

View File

@@ -251,6 +251,9 @@ static JanetTable *handleattr(JanetCompiler *c, int32_t argn, const Janet *argv)
case JANET_STRING:
janet_table_put(tab, janet_ckeywordv("doc"), attr);
break;
case JANET_STRUCT:
janet_table_merge_struct(tab, janet_unwrap_struct(attr));
break;
}
}
return tab;