And the dependencies struct:
I have another version of the zon.parse file here that allows parsing the dependencies struct into a StringHashMapUnmanaged:
That avoids dealing with Zoir in the application code, but probably should be behind a parser option, like the enums as strings
I suspect that the code is still unsafe to branch quota.
The problem is calling std.zon.parse.fromZoirNodeAlloc that start the comptime machinery.
As an example I added additionally fields and got an error:
manlio@mini-linux ~/s/z/s/c/m/w/tools (main)> zig run example-zon-runtime-parser.zig
/home/manlio/.local/share/sdk/zig/master/lib/std/zon/parse.zig:833:29: error: evaluation exceeded 5250 backwards branches
inline 0...(field_infos.len - 1) => |name_index| {
~^~~~~~~~~~~~~~~~~~~~~~~~
/home/manlio/.local/share/sdk/zig/master/lib/std/zon/parse.zig:833:29: note: use @setEvalBranchQuota() to raise the branch limit from 5250
referenced by:
parseExprInner__anon_36681: /home/manlio/.local/share/sdk/zig/master/lib/std/zon/parse.zig:538:40
parseExpr__anon_36671: /home/manlio/.local/share/sdk/zig/master/lib/std/zon/parse.zig:493:35
8 reference(s) hidden; use '-freference-trace=10' to see all references
example-zon-runtime-parser.zig:36:58: error: no field named 'url' in struct 'example-zon-runtime-parser.BuildZigZon.Dependency'
std.debug.print("{?s}\n", .{dependency.value_ptr.url});
^~~
example-zon-runtime-parser.zig:48:24: note: struct declared here
const Dependency = struct {
^~~~~~