init
Function parameters
Parameters
Type definitions in this namespace
Types
- ErrorMessageList
- There will be a MessageIndex for each len at start.
- SourceLocation
- Trailing:
- ErrorMessage
- Trailing:
Functions in this namespace
Functions
- nullTerminatedString
- Given an index into `string_bytes` returns the null-terminated string found there.
Special encoding when there are no errors.
Values
- empty
- Special encoding when there are no errors.
Source
Implementation
pub fn init(wip: *Wip, gpa: Allocator) !void {
wip.* = .{
.gpa = gpa,
.string_bytes = .{},
.extra = .{},
.root_list = .{},
};
// So that 0 can be used to indicate a null string.
try wip.string_bytes.append(gpa, 0);
assert(0 == try addExtra(wip, ErrorMessageList{
.len = 0,
.start = 0,
.compile_log_text = 0,
}));
}