v2 / vlib / v / fmt / tests / comments_array_keep.vv
58 lines · 55 sloc · 576 bytes · 18e60e77de77785c773cb8908cd99a9514cb9bb8
Raw
1fn main() {
2 _ := [
3 // pre comment
4 6,
5 // and after
6 ]
7 _ := [
8 7,
9 // below expr
10 ]
11 _ := [
12 8, // I don't know why this still is a block comment
13 9,
14 ]
15 arr := [
16 // test 0
17 1,
18 // test 1
19 2,
20 // test 2
21 3, // 3
22 4, // 4-1
23 ]
24}
25
26fn only_comments_array() {
27 _ := []
28 _ := [
29 // 1,
30 // 2,
31 // 3,
32 ]
33 _ := [
34 // whatever */ /* this is */ // 3,
35 // 4,
36 ]
37}
38
39fn mixed_comments() {
40 _ := [
41 3, // iembed
42 // keep line comment here
43 // and here
44 5,
45 ]
46}
47
48fn keep_real_block_comment() {
49 _ := [
50 'foo',
51 /*
52 'bar',
53 'baz',
54 'spam',
55 */
56 'eggs',
57 ]
58}
59