next
Function parameters
Parameters
- self:*@This()
Configuration for the runtime parser.
Types
- Options
- Configuration for the runtime parser.
- Diagnostics
- Information about the success or failure of a parse.
Parses the given slice as ZON.
Functions
- fromSlice
- Parses the given slice as ZON.
- fromZoir
- Like `fromSlice`, but operates on `Zoir` instead of ZON source.
- fromZoirNode
- Like `fromZoir`, but the parse starts on `node` instead of root.
- free
- Frees ZON values.
Source
Implementation
pub fn next(self: *@This()) ?Error {
if (self.index < self.diag.zoir.compile_errors.len) {
const result: Error = .{ .zoir = self.diag.zoir.compile_errors[self.index] };
self.index += 1;
return result;
}
if (self.diag.type_check) |err| {
if (self.index == self.diag.zoir.compile_errors.len) {
const result: Error = .{ .type_check = err };
self.index += 1;
return result;
}
}
return null;
}