brain
brain copied to clipboard
Tuples and Tuple Structs
Extension of #39 with support for arbitrary tuples.
Tuples can have heterogeneous types.
Tuples:
let foo: (u8, u16, u32) = (1, 10000, 1000000);
Tuple struct:
struct Foo(u8);
struct Foo(u8, u16);
Accessing tuple fields will use special number syntax like Rust.
// get
foo.0;
// set
foo.0 = 2;
- [ ] Add numeric field access to grammar