diff --git a/src/value/parse.rs b/src/value/parse.rs index 4b28fc2..ff86667 100644 --- a/src/value/parse.rs +++ b/src/value/parse.rs @@ -839,7 +839,7 @@ impl Value { } q @ '>' | q @ '<' => { let mut span = toks.next().unwrap().pos(); - IntermediateValue::Op(if toks.peek().unwrap().kind == '=' { + IntermediateValue::Op(if let Some(Token { kind: '=', ..}) = toks.peek() { span = span.merge(toks.next().unwrap().pos()); match q { '>' => Op::GreaterThanEqual, diff --git a/tests/error.rs b/tests/error.rs index 3e2fe0e..e184276 100644 --- a/tests/error.rs +++ b/tests/error.rs @@ -172,3 +172,7 @@ error!( ends_with_single_eq, "a {color: 1 =", "Error: expected \"=\"." ); +error!( + nothing_after_gt, + "a {color: 1 >", "Error: Expected expression." +);