something in std/os/windows/kernel32.zig hits an unreachable in
renderExpression. will figure it out later. for now, prefer logging an
error and continue program execution.
the assumption is top level doc comments are of litte to no interest
if an exact/sub query is specified.
a side effect of this change is, if -s option is specified but no
identifier arg is provided, zdoc outputs only top level doc comments.
for example,
zdoc -s std.log
this was a big omission from when adapting the original
std/zig/render.zig: renderDocComments was a the very top which i
completely forgot about.
with it, double newlines are gone now, too.
unfortunately, this spits out double newlines between top level
declarations and sometimes in between fields. this is because the
original rendering logic designed to handle a complete source file,
whereas we're printing only public members.
but this makes reading the output of container fields easier.
will take care of double newlines later.
all rendering functions output using Ais (AutoIndentingStream) which
writes to an std.fs.File.Writer but some commented out functions
like renderArrayInit need to use Ais to temporary output a partial
expression into an std.ArrayList(u8) buffer, making a new type of Ais
which renderExpression func cannot accept.
the new TypeErasedWriter abstracts the underlying writer away and so Ais
now always outputs to the same TypeErasedWriter.Writer type. in other
words, a single type of Ais should now satisfy all render functions.
arena allocator would take care of it upon program exit but deinit'ing earlier
may make a mem footprint difference when searching an arbitrary large
number of files.