| ... | @@ -338,9 +338,16 @@ fn renderExpression(r: *Render, node: Ast.Node.Index, space: Space) Error!void { | ... | @@ -338,9 +338,16 @@ fn renderExpression(r: *Render, node: Ast.Node.Index, space: Space) Error!void { |
| 338 | try ais.maybeInsertNewline(); | 338 | try ais.maybeInsertNewline(); |
| 339 | | 339 | |
| 340 | const first_tok, const last_tok = tree.nodeData(node).token_and_token; | 340 | const first_tok, const last_tok = tree.nodeData(node).token_and_token; |
| 341 | for (first_tok..last_tok + 1) |i| { | 341 | for (first_tok..last_tok) |i| { |
| 342 | try renderToken(r, @intCast(i), .newline); | 342 | try renderToken(r, @intCast(i), .newline); |
| 343 | } | 343 | } |
| | 344 | if (space != .skip) { |
| | 345 | try renderToken(r, last_tok, .newline); |
| | 346 | } else { |
| | 347 | try renderToken(r, last_tok, .skip); |
| | 348 | try ais.insertNewline(); // A newline is part of the token, so it still needs |
| | 349 | // rendered here. |
| | 350 | } |
| 344 | | 351 | |
| 345 | const next_token = last_tok + 1; | 352 | const next_token = last_tok + 1; |
| 346 | const next_token_tag = tree.tokenTag(next_token); | 353 | const next_token_tag = tree.tokenTag(next_token); |