diff options
| author | Anhgelus Morhtuuzh <william@herges.fr> | 2026-04-19 21:30:32 +0200 |
|---|---|---|
| committer | Anhgelus Morhtuuzh <william@herges.fr> | 2026-04-19 21:30:32 +0200 |
| commit | ec6f949c48323a0bea244b723af547f60e0db33f (patch) | |
| tree | f20497988d2e2c675153c60892cfe8e5715b7fb3 /src/link.zig | |
| parent | fe3e8fe67b7f655699be321796af70d4bdff230f (diff) | |
style(ast): split paragraph and content
Diffstat (limited to 'src/link.zig')
| -rw-r--r-- | src/link.zig | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/link.zig b/src/link.zig index c9fc93a..fd29cb5 100644 --- a/src/link.zig +++ b/src/link.zig @@ -4,12 +4,12 @@ const eql = std.mem.eql; const Lexed = @import("lexer/Lexed.zig"); const Lexer = @import("lexer/Lexer.zig"); const Element = @import("dom/Element.zig"); -const paragraph = @import("paragraph.zig"); +const content = @import("content.zig"); const testing = @import("testing.zig"); const doTest = testing.do; const doTestError = testing.doError; -pub const Error = error{InvalidLink} || Lexer.Error || paragraph.Error; +pub const Error = error{InvalidLink} || Lexer.Error || content.Error; pub fn parse(alloc: Allocator, l: *Lexer) Error!Element { var el = try Element.init(alloc, .content, "a"); @@ -20,9 +20,9 @@ pub fn parse(alloc: Allocator, l: *Lexer) Error!Element { return data.first.?; }; defer alloc.free(second); - var content = if (data.first) |first| first else try Element.initLitEscaped(alloc, second); - errdefer content.deinit(); - try el.appendContent(content); + var in = if (data.first) |first| first else try Element.initLitEscaped(alloc, second); + errdefer in.deinit(); + try el.appendContent(in); try el.setAttribute("href", second); return el; } @@ -53,8 +53,8 @@ pub fn parseData(alloc: Allocator, l: *Lexer) Error!Data { break; }, else => { - const content = try paragraph.parseContent(alloc, l); - try el.appendContent(content); + const in = try content.parse(alloc, l); + try el.appendContent(in); }, } } |
