Odin rewrite #1

Manually merged
N0VA merged 7 commits from odin-rewrite into main 2026-07-13 15:03:05 +02:00
Showing only changes of commit 66145f516e - Show all commits
+27
View File
@@ -3,6 +3,33 @@ package main
import "core:fmt"
import "core:strings"
TokenType :: enum {
Text,
Italics,
Bold,
BreakLine,
Heading,
}
TokenMode :: enum {
Start,
End,
}
TokenValue :: union {
string,
int,
TokenMode,
}
Token :: struct {
type: TokenType,
value: TokenValue,
child: [dynamic]Token,
}
token_tree := [dynamic]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])