mirror of
https://github.com/ziglang/zig.git
synced 2024-11-15 16:45:27 +00:00
generated docs: add optional type support
This commit is contained in:
parent
fa47172841
commit
6082c14753
@ -537,7 +537,12 @@ pub const OpenError = error{
|
||||
SystemFdQuotaExceeded,
|
||||
NoDevice,
|
||||
FileNotFound,
|
||||
|
||||
/// Insufficient kernel memory was available, or
|
||||
/// the named file is a FIFO and per-user hard limit on
|
||||
/// memory allocation for pipes has been reached.
|
||||
SystemResources,
|
||||
|
||||
NoSpaceLeft,
|
||||
NotDir,
|
||||
PathAlreadyExists,
|
||||
|
@ -438,6 +438,8 @@
|
||||
name += "]";
|
||||
name += typeIndexName(typeObj.elem, wantHtml, wantSubLink, null);
|
||||
return name;
|
||||
case typeKinds.Optional:
|
||||
return "?" + typeIndexName(typeObj.child, wantHtml, wantSubLink, fnDecl, linkFnNameDecl);
|
||||
case typeKinds.Pointer:
|
||||
var name = "";
|
||||
switch (typeObj.len) {
|
||||
|
@ -991,6 +991,11 @@ static void anal_dump_type(AnalDumpCtx *ctx, ZigType *ty) {
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ZigTypeIdOptional: {
|
||||
jw_object_field(jw, "child");
|
||||
anal_dump_type_ref(ctx, ty->data.maybe.child_type);
|
||||
break;
|
||||
}
|
||||
case ZigTypeIdPointer: {
|
||||
switch (ty->data.pointer.ptr_len) {
|
||||
case PtrLenSingle:
|
||||
|
Loading…
Reference in New Issue
Block a user