Need help understanding zon parsing

New to zig here. I am trying to understand zon file structure. Taking this as an example: https://raw.githubusercontent.com/allyourcodebase/wayland/refs/heads/master/build.zig.zon

What kind of struct or data type does the “dependencies” field resolve to? To my uneducated eye it looks like a struct with fields named “wayland” and so on. But clearly the field names are not hardcoded into a struct. So is it something like a hashmap?

I tried searching beforehand but could not find much information about the zon syntax. Thank you.

Not sure if anything related to this has changed lately, but here you go: https://github.com/ziglang/zig/issues/22775

that is correct, the compiler generates the type from the zon at compile time. Ofc that only works if you get it at compile time.

To get that behaviour at runtime you need to semi manually parse the zon, thankfully std does most of the work for that.

They probably did this to make it more intuitive, but thats only the case if you dont try to map it perfectly to zig. But it is reasonable to try to do that with something called zig object notation.

Do you mean by using std.zig.Zoir?

yes, you would have to use Zoir