diff options
| author | Anhgelus Morhtuuzh <william@herges.fr> | 2026-04-26 23:10:17 +0200 |
|---|---|---|
| committer | Anhgelus Morhtuuzh <william@herges.fr> | 2026-04-26 23:17:26 +0200 |
| commit | de948492e8b38a79d5db9c506c1b7b82e86c6b12 (patch) | |
| tree | 122e4c004d37193c64d6b8b89d9a252f7e237cfa /src/lexer/Lexer.zig | |
| parent | ae6ee68d6f4ef79fef609b4d09b543fc06326e95 (diff) | |
feat(): support code block
Diffstat (limited to 'src/lexer/Lexer.zig')
| -rw-r--r-- | src/lexer/Lexer.zig | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/src/lexer/Lexer.zig b/src/lexer/Lexer.zig index 983aa23..4137b40 100644 --- a/src/lexer/Lexer.zig +++ b/src/lexer/Lexer.zig @@ -54,7 +54,7 @@ pub fn next(self: *Self) ?Token { // conds here to avoid creating complex condition in while const next_rune = self.iter.peek(1); const next_kind = self.getCurrentKind(current_kind, next_rune, self.content[beg..end]).kind; - if (requiresSpace(current_kind.?) and next_kind != current_kind.?) { + if (current_kind.?.requiresSpace() and next_kind != current_kind.?) { if (eql(u8, next_rune, " ")) { // consume next space _ = self.iter.nextCodepoint(); @@ -166,13 +166,6 @@ fn isOneOrThree(op: []const u8, rune: []const u8, p: []const u8, one: Token.Kind }; } -fn requiresSpace(k: Token.Kind) bool { - return switch (k) { - .title, .list_ordored, .list_unordored => true, - else => false, - }; -} - fn doTest(l: *Self, k: Token.Kind, v: []const u8) !void { var first = l.next().?; std.testing.expect(first.equals(k, v)) catch |err| { |
