From e61011ca5f91e0aae730adac5e30ffe5e3332321 Mon Sep 17 00:00:00 2001 From: "N0\\A" Date: Tue, 14 Jul 2026 15:04:39 +0200 Subject: [PATCH] Pass through children --- src/parser.odin | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/parser.odin b/src/parser.odin index a422e45..207f864 100644 --- a/src/parser.odin +++ b/src/parser.odin @@ -51,10 +51,24 @@ parse_header :: proc(line: string) -> (int, string) { return lvl, line[lvl + 1:] } +pass_through_children :: proc(token: ^Token) { + if token.children != nil { + for child in token.children { + pass_through_children(child) + } + } + + if token.type == TokenType.Text { + + } +} + parse :: proc(lines: []string, allocator := context.allocator) -> Token { root := Token{TokenType.Root, nil, nil, nil} current_token := &root + // FIRST PASS + for untrimmed_line, line_index in lines { line := strings.trim_space(untrimmed_line) @@ -126,5 +140,11 @@ parse :: proc(lines: []string, allocator := context.allocator) -> Token { } } + // SECOND PASS + + for token in root.children { + pass_through_children(token) + } + return root }