From 1904b58458123ae073093a254f46e58a3dae3544 Mon Sep 17 00:00:00 2001 From: Judah Caruso Date: Tue, 20 May 2025 21:09:36 -0600 Subject: [PATCH] export things that be exported --- TODO | 1 + macros.jai | 40 +++++++++++++++++++++------------------- 2 files changed, 22 insertions(+), 19 deletions(-) create mode 100644 TODO diff --git a/TODO b/TODO new file mode 100644 index 0000000..5caeb71 --- /dev/null +++ b/TODO @@ -0,0 +1 @@ +- Add easing module diff --git a/macros.jai b/macros.jai index 0003d26..0ce8d23 100644 --- a/macros.jai +++ b/macros.jai @@ -124,10 +124,7 @@ c_call :: (call: Code, ctx: #Context) #expand { push_context ctx { #insert,scope(call) call; } } -#scope_file; - -Default_Name :: "block"; -Named_Block :: struct(NAME: string) {} +// @note(judah): for_expansions have to be exported for_expansion :: (v: *Named_Block, code: Code, _: For_Flags) #expand { #insert #run basic.tprint(#string END @@ -142,21 +139,6 @@ for_expansion :: (v: *Named_Block, code: Code, _: For_Flags) #expand { ifx v.NAME.count != 0 v.NAME else Default_Name); } -Unrolled_Loop :: struct(N: int, T: Type = void) { - // Only store arrays when we absolutely have to. - #if T != void { - // @todo(judah): because this will only be created via 'unroll', - // should these be pointers to the underlying arrays so we don't - // pay for a copy? - #if N == -1 { - array: []T = ---; - } - else { - array: [N]T = ---; - } - } -} - for_expansion :: (loop: *Unrolled_Loop, body: Code, flags: For_Flags, loc := #caller_location) #expand { #assert flags & .REVERSE == 0 "reverse iteration not supported with loop unrolling (for now)"; #assert flags & .POINTER == 0 "pointer iteration not supported with loop unrolling (for now)"; @@ -240,6 +222,26 @@ for_expansion :: (loop: *Unrolled_Loop, body: Code, flags: For_Flags, loc := #ca } +#scope_file; + +Default_Name :: "block"; +Named_Block :: struct(NAME: string) {} + +Unrolled_Loop :: struct(N: int, T: Type = void) { + // Only store arrays when we absolutely have to. + #if T != void { + // @todo(judah): because this will only be created via 'unroll', + // should these be pointers to the underlying arrays so we don't + // pay for a copy? + #if N == -1 { + array: []T = ---; + } + else { + array: [N]T = ---; + } + } +} + pp :: #import "Program_Print"; compiler :: #import "Compiler";