remove unwrap when nothing after /
This commit is contained in:
parent
1382ea32ca
commit
c42fdc5ee7
@ -21,8 +21,8 @@ pub(crate) fn read_until_open_curly_brace<I: Iterator<Item = Token>>(
|
||||
'}' => n -= 1,
|
||||
'/' => {
|
||||
let next = toks.next().unwrap();
|
||||
match toks.peek().unwrap().kind {
|
||||
'/' => read_until_newline(toks),
|
||||
match toks.peek() {
|
||||
Some(Token { kind: '/', .. }) => read_until_newline(toks),
|
||||
_ => t.push(next),
|
||||
};
|
||||
continue;
|
||||
|
@ -129,3 +129,4 @@ error!(
|
||||
error!(unclosed_dbl_quote, "@if true \" {}", "Error: Expected \".");
|
||||
error!(unclosed_sgl_quote, "@if true ' {}", "Error: Expected '.");
|
||||
error!(unclosed_call_args, "@if a({}", "Error: expected \")\".");
|
||||
error!(nothing_after_div, "@if a/", "Error: Expected expression.");
|
||||
|
Loading…
x
Reference in New Issue
Block a user