escape all symbols and whitespace
This commit is contained in:
parent
29166900d2
commit
6d2d9bcb4a
@ -349,14 +349,11 @@ impl Value {
|
|||||||
TokenKind::Symbol(Symbol::BackSlash) => {
|
TokenKind::Symbol(Symbol::BackSlash) => {
|
||||||
if let Some(tok) = toks.next() {
|
if let Some(tok) = toks.next() {
|
||||||
match tok.kind {
|
match tok.kind {
|
||||||
TokenKind::Symbol(Symbol::Plus) => Ok(Value::Ident(
|
TokenKind::Symbol(s) => Ok(Value::Ident(
|
||||||
"\\+".to_string() + &flatten_ident(toks, scope, super_selector)?,
|
format!("\\{}{}", s, flatten_ident(toks, scope, super_selector)?),
|
||||||
QuoteKind::None,
|
|
||||||
)),
|
|
||||||
TokenKind::Symbol(Symbol::BackSlash) => Ok(Value::Ident(
|
|
||||||
"\\\\".to_string() + &flatten_ident(toks, scope, super_selector)?,
|
|
||||||
QuoteKind::None,
|
QuoteKind::None,
|
||||||
)),
|
)),
|
||||||
|
TokenKind::Whitespace(w) => Ok(Value::Ident(format!("\\{}", w), QuoteKind::None)),
|
||||||
TokenKind::Ident(s) => Ok(Value::Ident(s, QuoteKind::None)),
|
TokenKind::Ident(s) => Ok(Value::Ident(s, QuoteKind::None)),
|
||||||
_ => todo!("value after \\"),
|
_ => todo!("value after \\"),
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user