From b6c4c6375be20930c53bd77110690335fab9d03e Mon Sep 17 00:00:00 2001 From: Scott Richmond Date: Wed, 4 Dec 2024 18:31:13 -0500 Subject: [PATCH] parse interpolated strings --- src/main.rs | 2 +- src/parser.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index e4170fa..ed9c9da 100644 --- a/src/main.rs +++ b/src/main.rs @@ -58,7 +58,7 @@ use crate::base::*; pub fn main() { let src = " -\"{} {foobar}\" +\"thing\" "; let (tokens, lex_errs) = lexer().parse(src).into_output_errors(); if !lex_errs.is_empty() { diff --git a/src/parser.rs b/src/parser.rs index c009eb2..5c9a2da 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -397,7 +397,7 @@ fn parse_string(s: &str, span: SimpleSpan) -> Result>, S parts.push(( if is_word { StringPart::Word(current_part) - } else if current_part == s.to_string() { + } else if current_part == s { StringPart::Inline(current_part) } else { StringPart::Data(current_part)