mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 13:59:08 +00:00
Parse deprecated interpolation syntax differently
This commit is contained in:
parent
7189104df8
commit
8ea38d3a04
9 changed files with 51 additions and 15 deletions
|
@ -612,9 +612,20 @@ fn format_str_segment(seg: &StrSegment, buf: &mut Buf, indent: u16) {
|
|||
buf.push('\\');
|
||||
buf.push(escaped.to_parsed_char());
|
||||
}
|
||||
Interpolated(loc_expr) => {
|
||||
DeprecatedInterpolated(loc_expr) => {
|
||||
buf.push_str("\\(");
|
||||
// e.g. (name) in "Hi, \(name)!"
|
||||
// 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) => {
|
||||
buf.push_str("$(");
|
||||
// e.g. (name) in "Hi, $(name)!"
|
||||
loc_expr.value.format_with_options(
|
||||
buf,
|
||||
Parens::NotNeeded, // We already printed parens!
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue