Generated try_* proxy methods for synchronous messages with a single
output declared IPCErrorOr<T>, but returned the whole response object
instead of the output payload. That made helpers with named bool
responses unusable once callers started using the fallible path.
Share the same single-output accessor logic used by the infallible sync
helpers so fallible generated helpers return the declared payload type.
The idea is that scripts directly under Meta are meant to be run by
people. Scripts that are only imported or run by other scripts are
moved to a subdirectory.
This replaces the C++ IPC compiler and generator with a python3 port.
For validation, the parser is nearly a line-for-line port of the C++
parser. This patch includes lexer.py, which is a simple port of our
GenericLexer, as the mechanics actually felt pretty nice in python as
well.
The code generator does not include a port of our SourceGenerator, as
that felt less nice. Instead, we write directly to a TextIO instance.
The generated output is almost byte-for-byte identical with our C++
generator, with trivial whitespace differences:
* The C++ generator included extraneous newlines before and after all
switch statements, which is not kept here.
* The C++ generator did not include newlines between message handling
functions, which we now do.
* The C++ generator had some extraneous spaces at the end of some lines,
and incorrect tabbing (3 spaces) at the beginning of some lines.