Got whitespace parser working + widget generation for basic case!

This commit is contained in:
2024-03-10 10:31:21 -04:00
parent 197dd82e78
commit c80254adbc
19 changed files with 443 additions and 279 deletions

View File

@ -68,18 +68,18 @@ array_init_reserve :: proc
return
}
array_append :: proc( using self : ^Array( $ Type), value : Type ) -> AllocatorError
array_append :: proc( self : ^Array( $ Type), value : Type ) -> AllocatorError
{
if num == capacity
if self.header.num == self.header.capacity
{
grow_result := array_grow( self, capacity )
grow_result := array_grow( self, self.header.capacity )
if grow_result != AllocatorError.None {
return grow_result
}
}
data[ num ] = value
num += 1
self.header.data[ self.header.num ] = value
self.header.num += 1
return AllocatorError.None
}
@ -177,10 +177,6 @@ array_push_back :: proc( using self : Array( $ Type)) -> b32 {
return true
}
array_back :: proc( using self : Array( $ Type ) ) -> ( ^Type) {
return & data[ num - 1 ]
}
array_clear :: proc( using self : Array( $ Type ), zero_data : b32 ) {
if zero_data {
mem.set( raw_data( data ), 0, num )