@@ -27,6 +27,7 @@ pub enum ParsingError {
2727 Unrecognized ( usize ) , // improve this
2828 Expected ( usize , & ' static str ) ,
2929 ExpectedMatchingChar ( usize , & ' static str , char , char ) ,
30+ UnclosedInterpolation ( usize ) ,
3031 InvalidHeader ( usize ) ,
3132 InvalidCharacter ( usize , char ) ,
3233 UnexpectedEndOfInput ( usize ) ,
@@ -60,6 +61,7 @@ impl ParsingError {
6061 ParsingError :: Unrecognized ( offset) => * offset,
6162 ParsingError :: Expected ( offset, _) => * offset,
6263 ParsingError :: ExpectedMatchingChar ( offset, _, _, _) => * offset,
64+ ParsingError :: UnclosedInterpolation ( offset) => * offset,
6365 ParsingError :: InvalidHeader ( offset) => * offset,
6466 ParsingError :: InvalidCharacter ( offset, _) => * offset,
6567 ParsingError :: UnexpectedEndOfInput ( offset) => * offset,
@@ -1479,12 +1481,9 @@ impl<'i> Parser<'i> {
14791481 current_pos = end_pos + 1 ;
14801482 }
14811483 None => {
1482- // Unmatched brace - point to end of string content (at closing quote)
1483- return Err ( ParsingError :: ExpectedMatchingChar (
1484- self . offset + raw. len ( ) ,
1485- "an interpolation" ,
1486- '{' ,
1487- '}' ,
1484+ // Unmatched brace - point to the opening brace position
1485+ return Err ( ParsingError :: UnclosedInterpolation (
1486+ self . offset + absolute_brace_start,
14881487 ) ) ;
14891488 }
14901489 }
0 commit comments