Remove unneeded semicolons from demo

This commit is contained in:
gingerBill
2021-08-31 22:45:26 +01:00
parent cd09068e33
commit 72a741554c
+6 -6
View File
@@ -1364,7 +1364,7 @@ bit_set_type :: proc() {
} }
{ {
x: bit_set['A'..='Z'] x: bit_set['A'..='Z']
#assert(size_of(x) == size_of(u32)); #assert(size_of(x) == size_of(u32))
y: bit_set[0..=8; u16] y: bit_set[0..=8; u16]
fmt.println(typeid_of(type_of(x))) // bit_set[A..=Z] fmt.println(typeid_of(type_of(x))) // bit_set[A..=Z]
fmt.println(typeid_of(type_of(y))) // bit_set[0..=8; u16] fmt.println(typeid_of(type_of(y))) // bit_set[0..=8; u16]
@@ -1601,7 +1601,7 @@ where_clauses :: proc() {
T :: i32 T :: i32
N :: 5 N :: 5
f: Foo(T, N) f: Foo(T, N)
#assert(size_of(f) == (N+N-2)*size_of(T)); #assert(size_of(f) == (N+N-2)*size_of(T))
} }
} }
@@ -1671,7 +1671,7 @@ ranged_fields_for_array_compound_literals :: proc() {
5..=9 = 54, 5..=9 = 54,
10..<16 = i*3 + (i-1)*2, 10..<16 = i*3 + (i-1)*2,
} }
#assert(len(foo) == 16); #assert(len(foo) == 16)
fmt.println(foo) // [123, 0, 0, 0, 0, 54, 54, 54, 54, 54, 8, 8, 8, 8, 8] fmt.println(foo) // [123, 0, 0, 0, 0, 54, 54, 54, 54, 54, 8, 8, 8, 8, 8]
} }
{ // Slice and Dynamic Array support { // Slice and Dynamic Array support
@@ -1922,7 +1922,7 @@ constant_literal_expressions :: proc() {
fmt.println("-------") fmt.println("-------")
Partial_Baz :: enum{A=5, B, C, D=16} Partial_Baz :: enum{A=5, B, C, D=16}
#assert(len(Partial_Baz) < len(#partial [Partial_Baz]int)); #assert(len(Partial_Baz) < len(#partial [Partial_Baz]int))
PARTIAL_ENUM_ARRAY_CONST :: #partial [Partial_Baz]int{.A ..= .C = 1, .D = 16} PARTIAL_ENUM_ARRAY_CONST :: #partial [Partial_Baz]int{.A ..= .C = 1, .D = 16}
fmt.println(PARTIAL_ENUM_ARRAY_CONST[.A]) fmt.println(PARTIAL_ENUM_ARRAY_CONST[.A])
@@ -1952,8 +1952,8 @@ union_maybe :: proc() {
i: Maybe(u8) i: Maybe(u8)
p: Maybe(^u8) // No tag is stored for pointers, nil is the sentinel value p: Maybe(^u8) // No tag is stored for pointers, nil is the sentinel value
#assert(size_of(i) == size_of(u8) + size_of(u8)); #assert(size_of(i) == size_of(u8) + size_of(u8))
#assert(size_of(p) == size_of(^u8)); #assert(size_of(p) == size_of(^u8))
i = 123 i = 123
x := i.? x := i.?