mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 14:23:09 +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,
|
SystemFdQuotaExceeded,
|
||||||
NoDevice,
|
NoDevice,
|
||||||
FileNotFound,
|
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,
|
SystemResources,
|
||||||
|
|
||||||
NoSpaceLeft,
|
NoSpaceLeft,
|
||||||
NotDir,
|
NotDir,
|
||||||
PathAlreadyExists,
|
PathAlreadyExists,
|
||||||
|
|||||||
@ -438,6 +438,8 @@
|
|||||||
name += "]";
|
name += "]";
|
||||||
name += typeIndexName(typeObj.elem, wantHtml, wantSubLink, null);
|
name += typeIndexName(typeObj.elem, wantHtml, wantSubLink, null);
|
||||||
return name;
|
return name;
|
||||||
|
case typeKinds.Optional:
|
||||||
|
return "?" + typeIndexName(typeObj.child, wantHtml, wantSubLink, fnDecl, linkFnNameDecl);
|
||||||
case typeKinds.Pointer:
|
case typeKinds.Pointer:
|
||||||
var name = "";
|
var name = "";
|
||||||
switch (typeObj.len) {
|
switch (typeObj.len) {
|
||||||
|
|||||||
@ -991,6 +991,11 @@ static void anal_dump_type(AnalDumpCtx *ctx, ZigType *ty) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case ZigTypeIdOptional: {
|
||||||
|
jw_object_field(jw, "child");
|
||||||
|
anal_dump_type_ref(ctx, ty->data.maybe.child_type);
|
||||||
|
break;
|
||||||
|
}
|
||||||
case ZigTypeIdPointer: {
|
case ZigTypeIdPointer: {
|
||||||
switch (ty->data.pointer.ptr_len) {
|
switch (ty->data.pointer.ptr_len) {
|
||||||
case PtrLenSingle:
|
case PtrLenSingle:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user