switch, try, if, while or a loop into the block that follows, which changed it again on every format.Semantic Diff
1 commit, rendered from its record.
| Range | Commits | Changelog | Areas | JS output changes | Formats | Failed checks |
|---|---|---|---|---|---|---|
5c58e38f86e478f3c0aba128dfcd25250cd91558..pr-8906 | 1 | ๐ Bug fix | printertests | 0 | none | 0 |
switch, try, if, while or a loop into the block that follows, which changed it again on every format.5c58e38f86e478f3c0aba128dfcd25250cd91558..pr-8906A line comment inside the operand of switch, try, if, while or a loop was printed as a line suffix in a flat group, so it moved behind the opening brace, and the next format attached it to the block. The operand now breaks the groups around such a comment, and a comment trailing the whole operand goes into parentheses with it, as if conditions already did.
let x = switch [a, b] { // c| _ => 1}
let x = switch [ a, // c b,] {| _ => 1}
switch, try, if, while or a loop into the block that follows, which changed it again on every format.tests/syntax_tests/data/+ printer/comments/operandBeforeBlock.res| A | changes/operand-line-comments.fix.md | +1 | โ0 |
| M | compiler/syntax/src/res_doc.ml | +29 | โ0 |
| M | compiler/syntax/src/res_doc.mli | +11 | โ0 |
| M | compiler/syntax/src/res_printer.ml | +50 | โ27 |
| A | tests/syntax_tests/data/printer/comments/expected/operandBeforeBlock.res.txt | +92 | โ0 |
| A | tests/syntax_tests/data/printer/comments/operandBeforeBlock.res | +52 | โ0 |