| 1 | struct User { |
| 2 | name string // name |
| 3 | name2 []rune // name2 |
| 4 | very_long_field bool |
| 5 | age int // age |
| 6 | very_long_type_field1 very_looooog_type // long |
| 7 | very_long_type_field2 very_loooooooong_type // long |
| 8 | } |
| 9 | |
| 10 | struct FamousUser { |
| 11 | User |
| 12 | pub: |
| 13 | aka string |
| 14 | } |
| 15 | |
| 16 | struct Foo { |
| 17 | field1 int // f1 |
| 18 | field2 string // f2 |
| 19 | pub: |
| 20 | public_field1 int // f1 |
| 21 | public_field2 f64 // f2 |
| 22 | mut: |
| 23 | mut_field string |
| 24 | pub mut: |
| 25 | pub_mut_field string |
| 26 | } |
| 27 | |
| 28 | struct Bar { |
| 29 | Foo |
| 30 | } |
| 31 | |
| 32 | fn new_user() User { |
| 33 | return User{ |
| 34 | name: 'Serious Sam' |
| 35 | age: 19 |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | struct SomeStruct { |
| 40 | // 1 |
| 41 | mut: |
| 42 | // 2 |
| 43 | // 3 |
| 44 | somefield int /* |
| 45 | 9 |
| 46 | 10 |
| 47 | */ |
| 48 | somefield2 int // 12 |
| 49 | pub: |
| 50 | somefield3 int |
| 51 | |
| 52 | somefield4 int |
| 53 | /* |
| 54 | 13 |
| 55 | 14 |
| 56 | */ |
| 57 | } |
| 58 | |
| 59 | pub struct C.Foo {} |
| 60 |