remove !optional hack

This commit is contained in:
Connor Skees 2020-07-04 18:32:13 -04:00
parent 641ff007fb
commit 3cde25959b

View File

@ -596,15 +596,11 @@ impl<'a> Parser<'a> {
Err(e) => return Some(Err(e)), Err(e) => return Some(Err(e)),
}; };
span = span.merge(v.span); span = span.merge(v.span);
// TODO: we return `None` when encountering `optional` here as a hack for
// supporting `!optional` in `@extend`. In the future, we should have a better
// check for `!optional` as this technically allows `!optional` everywhere
match v.node.to_ascii_lowercase().as_str() { match v.node.to_ascii_lowercase().as_str() {
"important" => { "important" => {
IntermediateValue::Value(HigherIntermediateValue::Literal(Value::Important)) IntermediateValue::Value(HigherIntermediateValue::Literal(Value::Important))
.span(span) .span(span)
} }
"optional" => return None,
_ => return Some(Err(("Expected \"important\".", span).into())), _ => return Some(Err(("Expected \"important\".", span).into())),
} }
} }