From 4cba3dfd4e4b4de855c2952034ed3057b1275a97 Mon Sep 17 00:00:00 2001 From: ConnorSkees <39542938+ConnorSkees@users.noreply.github.com> Date: Thu, 21 May 2020 13:36:55 -0400 Subject: [PATCH] handle ~ in values --- src/value/parse.rs | 2 +- tests/error.rs | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/value/parse.rs b/src/value/parse.rs index 7345a0a..04c6520 100644 --- a/src/value/parse.rs +++ b/src/value/parse.rs @@ -897,7 +897,7 @@ impl Value { ':' | '?' | ')' | '@' | '^' | ']' | '|' => { return Some(Err(("expected \";\".", span).into())) } - v if v as u32 >= 0x80 || v.is_control() || v == '`' => { + v if v as u32 >= 0x80 || v.is_control() || v == '`' || v == '~' => { return Some(Err(("Expected expression.", span).into())) } v => todo!("unexpected token in value parsing: {:?}", v), diff --git a/tests/error.rs b/tests/error.rs index 66cde91..cbc53c5 100644 --- a/tests/error.rs +++ b/tests/error.rs @@ -125,3 +125,7 @@ error!( error!(toplevel_hash, "#", "Error: expected \"{\"."); error!(toplevel_var_no_colon, "$r", "Error: expected \":\"."); error!(bar_in_value, "a {color: a|b;}", "Error: expected \";\"."); +error!( + tilde_in_value, + "a {color: ~a;}", "Error: Expected expression." +);