blob: 859908fecc6393a2a08e52ba366a5251e6c169c9 (
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
|
import time // foo
/*
block
comment
*/
fn fun() int {
// comment zero
return 0 // another comment
}
fn mr_fun() (int, int) {
// one comment
// another comment
return 1, 2
}
fn single_line_blocks() {
// 1
println('')
// 2
println('')
// 3
// 4
println('')
// 5
// 6
}
fn main() {
/*
block1
*/
/*
block2
*/
/*
block3
*/
// this is a comment
a := 1
// and another comment
// just to make it worse
b, c := a, 2
d := c // and an extra one
e := c
// more comments = more good
arr := [
// block foo bar
// inline foo bar
0,
]
// before arg comment
// after arg comment
println('this is a test')
// before if expr
// after if expr
if true {
println('if')
}
// before else if
// between else if
else if false {
println('else if')
}
// before else
// after else
else {
println('else')
}
// empty return
return
}
fn insert_space() {
// abc
}
fn linebreaks_in_block_comments() {
/*
foo
comment goes here!
bar
*/
/*
spam
spaces make no difference there
eggs
*/
}
fn between_if_branches() {
if spam {
}
// remove the empty line above
else if eggs {
}
if spam2 {
}
// remove the empty line below
else {
}
}
|