parse interpolated strings

This commit is contained in:
Scott Richmond 2024-12-04 18:31:13 -05:00
parent 62671094a0
commit b6c4c6375b
2 changed files with 2 additions and 2 deletions

View File

@ -58,7 +58,7 @@ use crate::base::*;
pub fn main() { pub fn main() {
let src = " let src = "
\"{} {foobar}\" \"thing\"
"; ";
let (tokens, lex_errs) = lexer().parse(src).into_output_errors(); let (tokens, lex_errs) = lexer().parse(src).into_output_errors();
if !lex_errs.is_empty() { if !lex_errs.is_empty() {

View File

@ -397,7 +397,7 @@ fn parse_string(s: &str, span: SimpleSpan) -> Result<Vec<Spanned<StringPart>>, S
parts.push(( parts.push((
if is_word { if is_word {
StringPart::Word(current_part) StringPart::Word(current_part)
} else if current_part == s.to_string() { } else if current_part == s {
StringPart::Inline(current_part) StringPart::Inline(current_part)
} else { } else {
StringPart::Data(current_part) StringPart::Data(current_part)