diff options
| author | Anhgelus Morhtuuzh <william@herges.fr> | 2026-04-18 20:21:10 +0200 |
|---|---|---|
| committer | Anhgelus Morhtuuzh <william@herges.fr> | 2026-04-18 20:21:10 +0200 |
| commit | 8c5214df39ab82c3d42ccd492d8699f8a5aadb0a (patch) | |
| tree | 3ca338fffd31620470a898fd900c7a5f12188c5a /src/paragraph.zig | |
| parent | 9b47b7ee8b80bf427116b4d2cf42e6f3c9d8be62 (diff) | |
feat(ast): test errors
Diffstat (limited to 'src/paragraph.zig')
| -rw-r--r-- | src/paragraph.zig | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/paragraph.zig b/src/paragraph.zig index 86d074b..8cdaeb0 100644 --- a/src/paragraph.zig +++ b/src/paragraph.zig @@ -5,7 +5,7 @@ const Lexer = @import("lexer/Lexer.zig"); const Element = @import("dom/Element.zig"); const parser = @import("parser.zig"); -pub const Error = error{UnclosedModifier} || Lexer.Error; +pub const Error = error{ModifierNotClosed} || Lexer.Error; pub fn parse(alloc: Allocator, l: *Lexer) Error!Element { var el = try Element.init(alloc, .content, "p"); @@ -51,10 +51,10 @@ fn parseModifier(alloc: Allocator, l: *Lexer, knd: Lexed.Kind, tag: []const u8) // consuming the finisher var v = (try l.next(alloc)).?; v.deinit(); - break; + return el; } - if (it.isDelimiter()) return Error.UnclosedModifier; + if (it.isDelimiter()) return Error.ModifierNotClosed; try el.appendContent(try parseContent(alloc, l)); } - return el; + return Error.ModifierNotClosed; } |
