aboutsummaryrefslogtreecommitdiff
path: root/v_windows/v/old/vlib/v/fmt/tests/structs_expected.vv
blob: ca3fb0cab92725e3c753fdf14f4e3fd876a6ac6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
struct User {
	name                  string // name
	name2                 []rune // 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 {}