mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 11:52:19 +00:00
roc format now auto-upgrades string interpolation
This commit is contained in:
parent
6f84e24fa5
commit
6978ca7bf3
1 changed files with 1 additions and 12 deletions
|
@ -612,18 +612,7 @@ fn format_str_segment(seg: &StrSegment, buf: &mut Buf, indent: u16) {
|
|||
buf.push('\\');
|
||||
buf.push(escaped.to_parsed_char());
|
||||
}
|
||||
DeprecatedInterpolated(loc_expr) => {
|
||||
buf.push_str("\\(");
|
||||
// e.g. (name) in "Hi, $(name)!"
|
||||
loc_expr.value.format_with_options(
|
||||
buf,
|
||||
Parens::NotNeeded, // We already printed parens!
|
||||
Newlines::No, // Interpolations can never have newlines
|
||||
indent,
|
||||
);
|
||||
buf.push(')');
|
||||
}
|
||||
Interpolated(loc_expr) => {
|
||||
DeprecatedInterpolated(loc_expr) | Interpolated(loc_expr) => {
|
||||
buf.push_str("$(");
|
||||
// e.g. (name) in "Hi, $(name)!"
|
||||
loc_expr.value.format_with_options(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue