fix InterpolatedPattern compilation
This commit is contained in:
parent
f8adaa7971
commit
77faf67191
|
@ -434,6 +434,7 @@ fn is_word_char(c: char) -> bool {
|
|||
}
|
||||
|
||||
fn parse_string(s: &'static str, span: SimpleSpan) -> Result<Vec<Spanned<StringPart>>, String> {
|
||||
println!("parsing string pattern: {s}");
|
||||
let mut parts = vec![];
|
||||
let mut current_part = String::new();
|
||||
let mut start = span.start;
|
||||
|
@ -502,6 +503,12 @@ fn parse_string(s: &'static str, span: SimpleSpan) -> Result<Vec<Spanned<StringP
|
|||
StringPart::Inline(current_part),
|
||||
SimpleSpan::new(start, span.end),
|
||||
))
|
||||
} else if !current_part.is_empty() {
|
||||
let part_len = current_part.len();
|
||||
parts.push((
|
||||
StringPart::Data(current_part),
|
||||
SimpleSpan::new(start, part_len),
|
||||
))
|
||||
}
|
||||
|
||||
Ok(parts)
|
||||
|
|
Loading…
Reference in New Issue
Block a user