| 1 | fn concatenation_of_strings() { |
| 2 | _ := 'Simple' + 'Concat' |
| 3 | _ := 'Hello' |
| 4 | + ' ' + |
| 5 | 'World' + '!' |
| 6 | _ := 'There' + ' ' + 'so' + ' ' + 'many' + ' ' + 'words' + ' ' + 'they' + ' ' + "don't" + ' ' + 'fit' + ' ' + 'in' + ' ' + 'one' + ' ' + 'line' |
| 7 | } |
| 8 | |
| 9 | fn concat_inside_ternary() { |
| 10 | { // This block is needed to force line wrapping |
| 11 | cline := if iline == pos.line_nr { |
| 12 | sline[..start_column] + color(kind, sline[start_column..end_column]) + sline[end_column..] |
| 13 | } else { |
| 14 | sline |
| 15 | } |
| 16 | } |
| 17 | } |
| 18 | |
| 19 | fn concat_two_or_more_ternaries() { |
| 20 | x := if some_condition { 'very long string part' } else { 'def' } + if y == 'asd' { 'qwe' } else {'something else'} |
| 21 | var := if other_condition { 'concat three long ternary ifs' } else { 'def' } + if true {'shorter'} else {'quite short'} + if true { 'small' } else {'tiny'} |
| 22 | } |
| 23 | |