From fa800a7be598bbffc22024c80e9206dc139a81a4 Mon Sep 17 00:00:00 2001 From: Baitinq Date: Sun, 11 May 2025 15:56:53 +0200 Subject: Bootstrap: cleanup --- src/bootstrap/main.src | 44 ++------------------------------------------ 1 file changed, 2 insertions(+), 42 deletions(-) (limited to 'src/bootstrap/main.src') diff --git a/src/bootstrap/main.src b/src/bootstrap/main.src index 508002d..7ff2643 100644 --- a/src/bootstrap/main.src +++ b/src/bootstrap/main.src @@ -12,53 +12,13 @@ import "!stdlib.src"; import "tokenizer.src"; -let file_size = 0; -let file = 0; -let buf = 0; - -let read_file = (filename: *i8) => *i8 { - file = fopen(filename, "r"); - - fseek(file, 0, 2); - file_size = ftell(file); - fseek(file, 0, 0); - - buf = malloc(file_size + 1); - - let bytes_read = fread(buf, 1, file_size, file); - (*(buf + bytes_read)) = '\0'; - - return buf; -}; - let main = (argc: i64, argv: **i8) => i64 { let filename = *(argv + 1); println("%s", filename); - let buf = read_file(filename); - - println("File size: %d", file_size); - - println("%s", buf); - - let i = 0; - while i < file_size { - let c = (*(buf + i)); - - if c == '}' { - println("BRACE!"); - }; - - println("C: %c", c); - - i = i + 1; - }; - - free(buf); - fclose(file); - - println("TEST: %d", test()); + tokenizer_init(filename); + tokenizer_deinit(); return 0; }; -- cgit 1.4.1