Skip to content

Commit 0e6a92f

Browse files
committed
Add span to empty delimiter stack lex error
1 parent 7cb6cef commit 0e6a92f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/parse.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,11 @@ pub(crate) fn token_stream(mut input: Cursor) -> Result<TokenStream, LexError> {
189189
b'}' => Some(Delimiter::Brace),
190190
_ => None,
191191
} {
192+
let frame = match stack.pop() {
193+
Some(frame) => frame,
194+
None => return Err(lex_error(input)),
195+
};
192196
input = input.advance(1);
193-
let frame = stack.pop().ok_or_else(LexError::todo)?;
194197
#[cfg(span_locations)]
195198
let (lo, frame) = frame;
196199
let (open_delimiter, outer) = frame;

0 commit comments

Comments
 (0)