diff --git a/src/parser.odin b/src/parser.odin index 94301a3..8c4327a 100644 --- a/src/parser.odin +++ b/src/parser.odin @@ -1,6 +1,5 @@ package main -import "core:fmt" import "core:strings" TokenType :: enum { @@ -26,8 +25,6 @@ Token :: struct { parent: ^Token, } -current_token: ^Token - replace_text :: proc(text: string, start: int, len_: int, repl: string) -> string { builder := strings.builder_make(context.temp_allocator) strings.write_string(&builder, text[:start]) @@ -60,9 +57,7 @@ parse :: proc(lines: []string, allocator := context.allocator) -> Token { if len(line) == 0 { if line_index != len(lines) - 1 { - for current_token.parent != nil { - current_token = current_token.parent - } + current_token = &root append( ¤t_token.children,