diff options
| author | Anhgelus Morhtuuzh <william@herges.fr> | 2026-04-25 19:37:35 +0200 |
|---|---|---|
| committer | Anhgelus Morhtuuzh <william@herges.fr> | 2026-04-25 19:37:35 +0200 |
| commit | 0a0d579f34e12639c89d890d25be038c5ae81e00 (patch) | |
| tree | f96df251a917c8f2c79a1b950b715d924a3f0b9b | |
| parent | 7ca5ad5927386703219072723eb41c511e1c5359 (diff) | |
feat(): supports list ordored
| -rw-r--r-- | src/eval/Element.zig | 10 | ||||
| -rw-r--r-- | src/lexer/Token.zig | 9 | ||||
| -rw-r--r-- | src/link.zig | 2 | ||||
| -rw-r--r-- | src/paragraph.zig | 2 | ||||
| -rw-r--r-- | src/parser.zig | 2 |
5 files changed, 6 insertions, 19 deletions
diff --git a/src/eval/Element.zig b/src/eval/Element.zig index e017bc5..5d6fce5 100644 --- a/src/eval/Element.zig +++ b/src/eval/Element.zig @@ -1,15 +1,9 @@ const std = @import("std"); const Allocator = std.mem.Allocator; pub const HTML = @import("html/Element.zig"); -pub const Paragraph = struct { - const paragraph = @import("paragraph.zig"); - pub const Block = paragraph.Block; - pub const Bold = paragraph.Bold; - pub const Code = paragraph.Code; - pub const Italic = paragraph.Italic; - pub const Link = paragraph.Link; -}; +pub const paragraph = @import("paragraph.zig"); pub const Title = @import("Title.zig"); +pub const list = @import("list.zig"); const Element = @This(); diff --git a/src/lexer/Token.zig b/src/lexer/Token.zig index cfe78f3..18b2d10 100644 --- a/src/lexer/Token.zig +++ b/src/lexer/Token.zig @@ -29,15 +29,6 @@ pub const Kind = enum { } }; -pub const Loc = struct { - begin: usize, - end: usize, - - pub fn get(self: @This(), content: []const u8) []const u8 { - return content[self.begin..self.end]; - } -}; - kind: Kind, content: []const u8, diff --git a/src/link.zig b/src/link.zig index e214b4b..8eb5778 100644 --- a/src/link.zig +++ b/src/link.zig @@ -4,7 +4,7 @@ const eql = std.mem.eql; const Token = @import("lexer/Token.zig"); const Lexer = @import("lexer/Lexer.zig"); const Element = @import("eval/Element.zig"); -const Link = Element.Paragraph.Link; +const Link = Element.paragraph.Link; const content = @import("content.zig"); const testing = @import("testing.zig"); const doTest = testing.do; diff --git a/src/paragraph.zig b/src/paragraph.zig index a76b98c..f03bc8f 100644 --- a/src/paragraph.zig +++ b/src/paragraph.zig @@ -3,7 +3,7 @@ const Allocator = std.mem.Allocator; const Token = @import("lexer/Token.zig"); const Lexer = @import("lexer/Lexer.zig"); const Element = @import("eval/Element.zig"); -const Paragraph = Element.Paragraph; +const Paragraph = Element.paragraph; const parser = @import("parser.zig"); const link = @import("link.zig"); const content = @import("content.zig"); diff --git a/src/parser.zig b/src/parser.zig index cac395e..752267e 100644 --- a/src/parser.zig +++ b/src/parser.zig @@ -6,6 +6,7 @@ const Element = @import("eval/Element.zig"); const paragraph = @import("paragraph.zig"); const title = @import("title.zig"); const link = @import("link.zig"); +const list = @import("list.zig"); pub const Error = error{ FeatureNotSupported, @@ -54,6 +55,7 @@ fn gen(parent: Allocator, l: *Lexer) Error!Document { .literal, .bold, .italic, .code, .link => try paragraph.parse(alloc, l), // other blocks .title => try title.parse(alloc, l), + .list_ordored => try list.parseOrdored(alloc, l), .weak_delimiter, .strong_delimiter => { l.consume(); continue :base; |
