Commit graph

12 commits

Author SHA1 Message Date
Aliaksandr Kalenik
1201015ab8 Meta: Fix IPC generated try helper response unwrapping
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.
2026-05-24 03:35:07 +01:00
Shannon Booth
4a9deb3afa Meta: Combine Lexer's consume_specific_char and consume_specific_string
consume_specific_string() already handles 1-character strings correctly.
2026-04-29 12:24:00 +01:00
Timothy Flynn
ce7b69ff31 Meta: Move utility scripts to a subfolder
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.
2026-04-23 12:36:08 -04:00
Timothy Flynn
cfa24d3367 LibIPC: Return a StringView for IPC message names 2026-04-23 09:42:07 -04:00
Timothy Flynn
373db4e157 LibIPC: Inline some generated if statements / function calls 2026-04-23 09:42:07 -04:00
Timothy Flynn
90d53c0d12 LibIPC: Generate zero-argument IPC message handlers with less code 2026-04-23 09:42:07 -04:00
Timothy Flynn
e9515a3109 LibIPC: Use snake cased message names for IPC message handlers 2026-04-23 09:42:07 -04:00
Timothy Flynn
6567b71573 LibIPC: Format constructors to be more readable 2026-04-23 09:42:07 -04:00
Timothy Flynn
fff7598ea9 LibIPC: Remove needless virtual destructor overrides 2026-04-23 09:42:07 -04:00
Timothy Flynn
899de41e04 LibIPC: Remove some superfluous whitespace from generated IPC defintions 2026-04-23 09:42:07 -04:00
Timothy Flynn
464a3296b9 LibIPC: Bump opening braces for functions to a new line 2026-04-23 09:42:07 -04:00
Timothy Flynn
922b811279 Meta: Replace IPCCompiler with a python generator
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.
2026-04-23 07:31:19 -04:00