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