aboutsummaryrefslogtreecommitdiff
path: root/src/parser.zig
diff options
context:
space:
mode:
authorAnhgelus Morhtuuzh <william@herges.fr>2026-04-26 23:10:17 +0200
committerAnhgelus Morhtuuzh <william@herges.fr>2026-04-26 23:17:26 +0200
commitde948492e8b38a79d5db9c506c1b7b82e86c6b12 (patch)
tree122e4c004d37193c64d6b8b89d9a252f7e237cfa /src/parser.zig
parentae6ee68d6f4ef79fef609b4d09b543fc06326e95 (diff)
feat(): support code block
Diffstat (limited to 'src/parser.zig')
-rw-r--r--src/parser.zig14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/parser.zig b/src/parser.zig
index a5a49cd..c35d47f 100644
--- a/src/parser.zig
+++ b/src/parser.zig
@@ -7,10 +7,17 @@ const paragraph = @import("paragraph.zig");
const title = @import("title.zig");
const link = @import("link.zig");
const list = @import("list.zig");
+const code = @import("code.zig");
-pub const Error = error{
- FeatureNotSupported,
-} || Lexer.Error || paragraph.Error || title.Error || link.Error || list.Error || link.ImageError || Allocator.Error;
+pub const Error = error{FeatureNotSupported} ||
+ Lexer.Error ||
+ paragraph.Error ||
+ title.Error ||
+ link.Error ||
+ list.Error ||
+ link.ImageError ||
+ code.Error ||
+ Allocator.Error;
pub const Document = struct {
arena: std.heap.ArenaAllocator,
@@ -56,6 +63,7 @@ fn gen(parent: Allocator, l: *Lexer) Error!Document {
.list_ordored => try list.parseOrdored(alloc, l),
.list_unordored => try list.parseUnordored(alloc, l),
.image => try link.parseImage(alloc, l),
+ .code_block => try code.parse(alloc, l),
.weak_delimiter, .strong_delimiter => {
l.consume();
continue :base;