Zig Version
0.17.0-dev.607+456b2ec07
Steps to Reproduce, Observed Behavior, and Expected Behavior
The zon parser can't handle large ints.
This code doesn't compile.
pubfnmain(init:std.process.Init)!void{constsource="340282366920938463463374607431768211455";_=trystd.zon.parse.fromSliceAlloc(u128,init.arena.allocator(),source,null,.{});}with error /usr/lib/zig/std/zon/parse.zig:1177:32: error: type 'f128' cannot represent integer value '340282366920938463463374607431768211455'
This is probably the exact same issue that plagued the json parser: https://github.com/ziglang/zig/issues/24728.
The JSON issue was fixed, so the following compiles
pubfnmain(init:std.process.Init)!void{constsource="340282366920938463463374607431768211455";_=trystd.json.parseFromSlice(u128,init.arena.allocator(),source,.{});}Current workaround in my code: accept a string instead of u128 and parse manually.
### Zig Version
0.17.0-dev.607+456b2ec07
### Steps to Reproduce, Observed Behavior, and Expected Behavior
The zon parser can't handle large ints.
This code doesn't compile.
```zig
pub fn main(init: std.process.Init) !void {
const source = "340282366920938463463374607431768211455";
_ = try std.zon.parse.fromSliceAlloc(u128, init.arena.allocator(), source, null, .{});
}
```
with error `/usr/lib/zig/std/zon/parse.zig:1177:32: error: type 'f128' cannot represent integer value '340282366920938463463374607431768211455'`
This is probably the exact same issue that plagued the json parser: https://github.com/ziglang/zig/issues/24728.
The JSON issue was fixed, so the following compiles
```zig
pub fn main(init: std.process.Init) !void {
const source = "340282366920938463463374607431768211455";
_ = try std.json.parseFromSlice(u128, init.arena.allocator(), source, .{});
}
```
Current workaround in my code: accept a string instead of u128 and parse manually.