Commit 6082c14753

Andrew Kelley <andrew@ziglang.org>
2019-10-11 02:32:17
generated docs: add optional type support
1 parent fa47172
Changed files (3)
lib
std
special
docs
src
lib/std/special/docs/main.js
@@ -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) {
lib/std/os.zig
@@ -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,
src/dump_analysis.cpp
@@ -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: