| ... | ... | @@ -3448,22 +3448,6 @@ fn tokenSliceForRender(tree: Ast, token_index: Ast.TokenIndex) []const u8 { |
| 3448 | 3448 | return ret; |
| 3449 | 3449 | } |
| 3450 | 3450 | |
| 3451 | | fn writeStringLiteralAsIdentifier(r: *Render, token_index: Ast.TokenIndex) !usize { |
| 3452 | | const tree = r.tree; |
| 3453 | | const ais = r.ais; |
| 3454 | | assert(tree.tokenTag(token_index) == .string_literal); |
| 3455 | | const lexeme = tokenSliceForRender(tree, token_index); |
| 3456 | | const unquoted = lexeme[1..][0 .. lexeme.len - 2]; |
| 3457 | | if (std.zig.isValidId(unquoted)) { |
| 3458 | | try ais.writeAll(unquoted); |
| 3459 | | return unquoted.len; |
| 3460 | | } else { |
| 3461 | | try ais.writeByte('@'); |
| 3462 | | try ais.writeAll(lexeme); |
| 3463 | | return lexeme.len + 1; |
| 3464 | | } |
| 3465 | | } |
| 3466 | | |
| 3467 | 3451 | fn hasTrailingComment(tree: Ast, t: Ast.TokenIndex) bool { |
| 3468 | 3452 | const start = tree.tokenStart(t) + tree.tokenSlice(t).len; |
| 3469 | 3453 | const between = tree.source[start..tree.tokenStart(t + 1)]; |