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:
Ginger Bill
2016-11-29 22:08:48 +00:00
parent 348bcc3f9a
commit b232b9d5ea
12 changed files with 584 additions and 328 deletions
+1 -1
View File
@@ -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
View File
@@ -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) {