mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 13:59:08 +00:00
Remove deprecated string interpolation syntax
This commit is contained in:
parent
72011fba73
commit
cb98c45e88
15 changed files with 17 additions and 94 deletions
|
@ -281,11 +281,10 @@ pub struct WhenPattern<'a> {
|
|||
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
pub enum StrSegment<'a> {
|
||||
Plaintext(&'a str), // e.g. "foo"
|
||||
Unicode(Loc<&'a str>), // e.g. "00A0" in "\u(00A0)"
|
||||
EscapedChar(EscapedChar), // e.g. '\n' in "Hello!\n"
|
||||
Interpolated(Loc<&'a Expr<'a>>),
|
||||
DeprecatedInterpolated(Loc<&'a Expr<'a>>), // The old "$(...)" syntax - will be removed someday
|
||||
Plaintext(&'a str), // e.g. "foo"
|
||||
Unicode(Loc<&'a str>), // e.g. "00A0" in "\u(00A0)"
|
||||
EscapedChar(EscapedChar), // e.g. '\n' in "Hello!\n"
|
||||
Interpolated(Loc<&'a Expr<'a>>), // e.g. "$(expr)"
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||
|
@ -379,7 +378,6 @@ impl<'a> TryFrom<StrSegment<'a>> for SingleQuoteSegment<'a> {
|
|||
StrSegment::Unicode(s) => Ok(SingleQuoteSegment::Unicode(s)),
|
||||
StrSegment::EscapedChar(s) => Ok(SingleQuoteSegment::EscapedChar(s)),
|
||||
StrSegment::Interpolated(_) => Err(ESingleQuote::InterpolationNotAllowed),
|
||||
StrSegment::DeprecatedInterpolated(_) => Err(ESingleQuote::InterpolationNotAllowed),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2516,9 +2514,7 @@ impl<'a> Malformed for StrSegment<'a> {
|
|||
fn is_malformed(&self) -> bool {
|
||||
match self {
|
||||
StrSegment::Plaintext(_) | StrSegment::Unicode(_) | StrSegment::EscapedChar(_) => false,
|
||||
StrSegment::Interpolated(expr) | StrSegment::DeprecatedInterpolated(expr) => {
|
||||
expr.is_malformed()
|
||||
}
|
||||
StrSegment::Interpolated(expr) => expr.is_malformed(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue