Skip to content

Commit

Permalink
tl: only do string substitutions if they have backslashes
Browse files Browse the repository at this point in the history
Co-authored-by: Hisham Muhammad <[email protected]>
  • Loading branch information
euclidianAce and hishamhm committed Jul 22, 2024
1 parent ac7b4bb commit 3b96892
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4305,7 +4305,7 @@ function tl.pretty_print_ast(ast, gen_target, mode)



if node.tk:sub(1, 1) == "[" or gen_target ~= "5.1" then
if node.tk:sub(1, 1) == "[" or gen_target ~= "5.1" or not node.tk:find("\\", 1, true) then
return emit_exactly(node, children)
end

Expand Down
2 changes: 1 addition & 1 deletion tl.tl
Original file line number Diff line number Diff line change
Expand Up @@ -4305,7 +4305,7 @@ function tl.pretty_print_ast(ast: Node, gen_target: TargetMode, mode: boolean |
-- - \xXX : hex byte
-- - \u{} : unicode

if node.tk:sub(1, 1) == "[" or gen_target ~= "5.1" then
if node.tk:sub(1, 1) == "[" or gen_target ~= "5.1" or not node.tk:find("\\", 1, true) then
return emit_exactly(node, children)
end

Expand Down

0 comments on commit 3b96892

Please sign in to comment.