v2 / vlib / v / fmt / tests / struct_keep.vv
53 lines · 42 sloc · 629 bytes · c51d30bf5309653c6b573ec815268e69a78ea8cc
Raw
1import os
2
3struct KeepAnyLanguagePrefixVariation {
4 x C.bar
5 y &C.bar
6 z []C.bar
7 z2 []&C.bar
8}
9
10fn foo(a []os.File) {
11}
12
13struct User {
14 age int
15 name string
16}
17
18fn handle_users(users []User) {
19 println(users.len)
20}
21
22fn (u &User) foo(u2 &User) {
23}
24
25type Expr = IfExpr | IntegerLiteral
26
27fn exprs(e []Expr) {
28 println(e.len)
29}
30
31struct KeepStructEmbed {
32 User
33pub:
34 a int
35 b int
36}
37
38struct KeepMultiLineDefaultExprsIndent {
39 buttons []PeriodButton = [PeriodButton{
40 period: pr.Period.m1
41 text: 'M1'
42 }, PeriodButton{
43 period: pr.Period.m5
44 text: 'M5'
45 }]
46}
47
48@[typedef]
49pub struct C.some_t {
50 @type int
51 data struct {}
52
53}
54