mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-13 06:41:26 -07:00
Basic when statement - Compile time if statement
This is similar to an #if in C but handled during the semantic checking stage.
This commit is contained in:
+1
-1
@@ -160,7 +160,7 @@ Context :: struct #ordered {
|
||||
#thread_local __context: Context
|
||||
|
||||
|
||||
DEFAULT_ALIGNMENT :: align_of({4}f32)
|
||||
DEFAULT_ALIGNMENT :: align_of([vector 4]f32)
|
||||
|
||||
|
||||
__check_context :: proc() {
|
||||
|
||||
+3
-3
@@ -244,9 +244,9 @@ print_type_to_buffer :: proc(buf: ^[]byte, ti: ^Type_Info) {
|
||||
print_string_to_buffer(buf, "]")
|
||||
print_type_to_buffer(buf, info.elem)
|
||||
case Vector:
|
||||
print_string_to_buffer(buf, "{")
|
||||
print_string_to_buffer(buf, "[vector ")
|
||||
print_i64_to_buffer(buf, info.count as i64)
|
||||
print_string_to_buffer(buf, "}")
|
||||
print_string_to_buffer(buf, "]")
|
||||
print_type_to_buffer(buf, info.elem)
|
||||
|
||||
case Struct:
|
||||
@@ -442,7 +442,7 @@ print_any_to_buffer :: proc(buf: ^[]byte, arg: any) {
|
||||
return false
|
||||
}
|
||||
|
||||
bprintf(buf, "{%}%{", info.count, info.elem)
|
||||
bprintf(buf, "[vector %]%{", info.count, info.elem)
|
||||
defer print_string_to_buffer(buf, "}")
|
||||
|
||||
if is_bool(info.elem) {
|
||||
|
||||
Reference in New Issue
Block a user