Skip to content

Commit

Permalink
feat: add namespace support to Writer
Browse files Browse the repository at this point in the history
Closes #40

In addition to the new namespace-aware functions, this commit brings several other enhancements:

- The element name has been removed as an argument of `elementEnd`. The writer now keeps track of the current open element automatically.
- Doctests have been added for all public writer functions.
- Doc comments have been added for all public writer functions.
  • Loading branch information
ianprime0509 committed Oct 31, 2024
1 parent 93c3444 commit 08ea460
Show file tree
Hide file tree
Showing 3 changed files with 671 additions and 95 deletions.
2 changes: 1 addition & 1 deletion src/Reader.zig
Original file line number Diff line number Diff line change
Expand Up @@ -2236,6 +2236,6 @@ fn addString(reader: *Reader, s: []const u8) !StringIndex {
return @enumFromInt(start);
}

fn string(reader: Reader, index: StringIndex) []const u8 {
fn string(reader: *const Reader, index: StringIndex) []const u8 {
return std.mem.sliceTo(reader.strings.items[@intFromEnum(index)..], 0);
}
Loading

0 comments on commit 08ea460

Please sign in to comment.