aboutsummaryrefslogtreecommitdiffstats
path: root/tests/variables.bad
diff options
context:
space:
mode:
Diffstat (limited to 'tests/variables.bad')
-rw-r--r--tests/variables.bad20
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
33struct entity { 33struct 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.
44let particle = entity : { 43let 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 : {} 54set 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]