export things that be exported

This commit is contained in:
Judah Caruso 2025-05-20 21:09:36 -06:00
parent e6b0fb7cdf
commit 1904b58458
2 changed files with 22 additions and 19 deletions

1
TODO Normal file
View file

@ -0,0 +1 @@
- Add easing module

View file

@ -124,10 +124,7 @@ c_call :: (call: Code, ctx: #Context) #expand {
push_context ctx { #insert,scope(call) call; } push_context ctx { #insert,scope(call) call; }
} }
#scope_file; // @note(judah): for_expansions have to be exported
Default_Name :: "block";
Named_Block :: struct(NAME: string) {}
for_expansion :: (v: *Named_Block, code: Code, _: For_Flags) #expand { for_expansion :: (v: *Named_Block, code: Code, _: For_Flags) #expand {
#insert #run basic.tprint(#string END #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); 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 { 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 & .REVERSE == 0 "reverse iteration not supported with loop unrolling (for now)";
#assert flags & .POINTER == 0 "pointer 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"; pp :: #import "Program_Print";
compiler :: #import "Compiler"; compiler :: #import "Compiler";