diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-10-10 13:36:37 -0400 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-10-10 13:36:37 -0400 |
| commit | 78d06ec4af5e51b2c5fafe4d2556bcc1037f2446 (patch) | |
| tree | dfcab9e1d4f28a8737d8cc3a647281a9ebff8764 /lib/std | |
| parent | 6330dfbea6d5434dc694aebd0203ea13e2511a0e (diff) | |
| parent | 2b55484f3f6cf336f54efb9ded25663fe0e1374a (diff) | |
| download | zig-78d06ec4af5e51b2c5fafe4d2556bcc1037f2446.tar.gz zig-78d06ec4af5e51b2c5fafe4d2556bcc1037f2446.zip | |
Merge branch 'docs-union-enum' of https://github.com/Vexu/zig into Vexu-docs-union-enum
Diffstat (limited to 'lib/std')
| -rw-r--r-- | lib/std/io.zig | 6 | ||||
| -rw-r--r-- | lib/std/special/docs/main.js | 13 |
2 files changed, 16 insertions, 3 deletions
diff --git a/lib/std/io.zig b/lib/std/io.zig index 25106e24be..09844bf055 100644 --- a/lib/std/io.zig +++ b/lib/std/io.zig @@ -17,9 +17,15 @@ const File = std.fs.File; const testing = std.testing; pub const Mode = enum { + /// I/O operates normally, waiting for the operating system syscalls to complete. blocking, + + /// I/O functions are generated async and rely on a global event loop. Event-based I/O. evented, }; + +/// The application's chosen I/O mode. This defaults to `Mode.blocking` but can be overridden +/// by `root.event_loop`. pub const mode: Mode = if (@hasDecl(root, "io_mode")) root.io_mode else if (@hasDecl(root, "event_loop")) diff --git a/lib/std/special/docs/main.js b/lib/std/special/docs/main.js index 5ecc2c0545..4c8fd389f7 100644 --- a/lib/std/special/docs/main.js +++ b/lib/std/special/docs/main.js @@ -790,12 +790,19 @@ var containerNode = zigAnalysis.astNodes[container.src]; for (var i = 0; i < container.fields.length; i += 1) { - var fieldTypeIndex = container.fields[i]; + var field = container.fields[i]; var fieldNode = zigAnalysis.astNodes[containerNode.fields[i]]; var divDom = domListFields.children[i]; - var html = '<pre>' + escapeHtml(fieldNode.name) + ": " + - typeIndexName(fieldTypeIndex, true, true) + ',</pre>'; + var html = '<pre>' + escapeHtml(fieldNode.name); + + if (container.kind === typeKinds.Enum) { + html += ' = <span class="tok-number">' + field + '</span>'; + } else { + html += ": " + typeIndexName(field, true, true); + } + + html += ',</pre>'; var docs = fieldNode.docs; if (docs != null) { |
