63 lines
779 B
V
63 lines
779 B
V
struct User {
|
|
name string // name
|
|
name2 ustring // name2
|
|
very_long_field bool
|
|
age int // age
|
|
very_long_type_field1 very_looooog_type // long
|
|
very_long_type_field2 very_loooooooong_type // long
|
|
}
|
|
|
|
struct FamousUser {
|
|
User
|
|
pub:
|
|
aka string
|
|
}
|
|
|
|
struct Foo {
|
|
field1 int // f1
|
|
field2 string // f2
|
|
pub:
|
|
public_field1 int // f1
|
|
public_field2 f64 // f2
|
|
mut:
|
|
mut_field string
|
|
pub mut:
|
|
pub_mut_field string
|
|
}
|
|
|
|
struct Bar {
|
|
Foo
|
|
}
|
|
|
|
fn new_user() User {
|
|
return User{
|
|
name: 'Serious Sam'
|
|
age: 19
|
|
}
|
|
}
|
|
|
|
struct SomeStruct {
|
|
mut:
|
|
// 1
|
|
// 2
|
|
// 3
|
|
somefield /* 4 */ /* 5 */ int // 6
|
|
// 7
|
|
// 8
|
|
/*
|
|
9
|
|
10
|
|
*/
|
|
somefield2 /* 11 */ int // 12
|
|
pub:
|
|
somefield3 int
|
|
|
|
somefield4 int
|
|
/*
|
|
13
|
|
14
|
|
*/
|
|
}
|
|
|
|
struct C.Foo {}
|