| 40 columns | |
| >>> Fix whitespace. |
| " ${ interp+olate } and ${fn ( 1 ) } end"; |
| <<< |
| " ${interp + olate} and ${fn(1)} end"; |
| >>> Don't split in interpolation, even if the result doesn't fit. |
| "some text that is long ${interpolate + a + thing} more"; |
| <<< |
| "some text that is long ${interpolate + a + thing} more"; |
| >>> Split elsewhere when possible since interpolation doesn't split. |
| "first string ${has + interpolation}" + "another ${inter + polated}"; |
| <<< |
| "first string ${has + interpolation}" + |
| "another ${inter + polated}"; |
| >>> Don't split interpolation in multi-line string. |
| """ |
| some text that is pretty long |
| some more text that is pretty long ${ interpolate + a + thing } more text |
| """; |
| <<< |
| """ |
| some text that is pretty long |
| some more text that is pretty long ${interpolate + a + thing} more text |
| """; |
| >>> Don't split in nested interpolation. |
| "some text that is ${pretty + 'long ${ interpolate + |
| a + thing } more'} text"; |
| <<< |
| "some text that is ${pretty + 'long ${interpolate + a + thing} more'} text"; |
| >>> Allow mandatory newlines in interpolation. |
| "before ${(){statement();statement();statement();}} after"; |
| <<< |
| "before ${() { |
| statement(); |
| statement(); |
| statement(); |
| }} after"; |
| >>> Deeply nested interpolation. |
| '''a |
| ${b + |
| """c |
| ${d |
| + '''e |
| f''' |
| + |
| g} |
| h""" |
| + i} |
| j ${k |
| + |
| l}'''; |
| <<< |
| '''a |
| ${b + """c |
| ${d + '''e |
| f''' + g} |
| h""" + i} |
| j ${k + l}'''; |
| >>> Line comment at beginning of interpolation. |
| "before ${// comment |
| a + b} after"; |
| <<< |
| "before ${ // comment |
| a + b} after"; |
| >>> Line comment inside interpolation. |
| "before ${ |
| a + // comment |
| b} after"; |
| <<< |
| "before ${a + // comment |
| b} after"; |