diff options
author | Bad Diode <bd@badd10de.dev> | 2024-06-26 17:45:55 +0200 |
---|---|---|
committer | Bad Diode <bd@badd10de.dev> | 2024-06-26 17:45:55 +0200 |
commit | de360fb4023c4a18961817bcdb248e0720de7ec7 (patch) | |
tree | e77c02a57dcccd2ece2ed17ff13f89763ef1bc17 /tests/variables.bad | |
parent | 3b9cfd8b515d5b2969e242ea730792ae26f5fbfe (diff) | |
download | bdl-de360fb4023c4a18961817bcdb248e0720de7ec7.tar.gz bdl-de360fb4023c4a18961817bcdb248e0720de7ec7.zip |
Fix a segfault
Diffstat (limited to 'tests/variables.bad')
-rw-r--r-- | tests/variables.bad | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/tests/variables.bad b/tests/variables.bad index 34293dc..ce765bc 100644 --- a/tests/variables.bad +++ b/tests/variables.bad | |||
@@ -33,27 +33,25 @@ let player_b = player_a | |||
33 | struct entity { | 33 | struct entity { |
34 | pos: vec | 34 | pos: vec |
35 | vel: vec | 35 | vel: vec |
36 | ; TODO: ... | 36 | attr: { |
37 | ; attr: { | 37 | id: int |
38 | ; id: u64 | 38 | name: str |
39 | ; name: str | 39 | } |
40 | ; } | ||
41 | } | 40 | } |
42 | 41 | ||
43 | ; Symbols followed by curly braces output struct literals. | 42 | ; Symbols followed by curly braces output struct literals. |
44 | let particle = entity : { | 43 | let particle = entity : { |
45 | ; Two ways of initializing inner fields. | 44 | ; Two ways of initializing inner fields. |
46 | pos = vec : { x = 1.0 y = 2.0 } | 45 | pos = vec : { x = 1.0 y = 2.0 } |
47 | ; TODO: Get rid of this, unnecessary complexity on the implementation, let's | 46 | attr = { |
48 | ; just do the top option. | 47 | id = 1 |
49 | ; attr.id = 1 | 48 | name = "particle" |
50 | ; attr.name = "particle" | 49 | } |
51 | 50 | ||
52 | ; Missing initialization fields default to zero. | 51 | ; Missing initialization fields default to zero. |
53 | vel = vec : { y = -3.0 } | 52 | vel = vec : { y = -3.0 } |
54 | } | 53 | } |
55 | ; let particle = entity : {} | 54 | set particle = entity : {} |
56 | ; TODO: Now we can get rid of parenthesis on if/while statements | ||
57 | 55 | ||
58 | ; ; We can have static arrays and have indexed access. | 56 | ; ; We can have static arrays and have indexed access. |
59 | ; let numbers: u32[0xff] | 57 | ; let numbers: u32[0xff] |