| 1 | import time // foo |
| 2 | |
| 3 | /* |
| 4 | block |
| 5 | comment |
| 6 | */ |
| 7 | |
| 8 | fn fun() int { |
| 9 | return 0 // another comment |
| 10 | } |
| 11 | |
| 12 | fn mr_fun() (int, int) { |
| 13 | return 1, 2 // another comment |
| 14 | } |
| 15 | |
| 16 | fn single_line_blocks() { |
| 17 | // 1 |
| 18 | println('') |
| 19 | // 2 |
| 20 | println('') |
| 21 | // 3 |
| 22 | // 4 |
| 23 | println('') |
| 24 | // 5 |
| 25 | // 6 |
| 26 | } |
| 27 | |
| 28 | fn main() { |
| 29 | /* block1 |
| 30 | */ |
| 31 | /* |
| 32 | block2 */ |
| 33 | /* |
| 34 | |
| 35 | block3 |
| 36 | |
| 37 | */ |
| 38 | a := 1 // this is a comment |
| 39 | d := c // and an extra one |
| 40 | e := c |
| 41 | // more comments = more good |
| 42 | arr := [ |
| 43 | // block foo bar |
| 44 | // inline foo bar |
| 45 | 0, |
| 46 | ] |
| 47 | return |
| 48 | } |
| 49 | |
| 50 | fn insert_space() { |
| 51 | // abc |
| 52 | } |
| 53 | |
| 54 | fn linebreaks_in_block_comments() { |
| 55 | /*foo |
| 56 | comment goes here! |
| 57 | bar*/ |
| 58 | /* spam |
| 59 | spaces make no difference there |
| 60 | eggs */ |
| 61 | } |
| 62 | |
| 63 | fn between_if_branches() { |
| 64 | if spam { |
| 65 | } |
| 66 | // remove the empty line above |
| 67 | else if eggs { |
| 68 | } |
| 69 | |
| 70 | if spam2 { |
| 71 | } |
| 72 | // remove the empty line below |
| 73 | else { |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | for // comments |
| 78 | { |
| 79 | break |
| 80 | } |
| 81 | |
| 82 | for i := 0; i < 1; i++ // comments |
| 83 | { |
| 84 | break |
| 85 | } |
| 86 | |
| 87 | for _ in [1, 2] // comments |
| 88 | { |
| 89 | break |
| 90 | } |
| 91 | |