Initial implementation of Div for Value::Dimension
This commit is contained in:
parent
496c0740f2
commit
f8a09bec6e
@ -190,6 +190,17 @@ impl Div for Value {
|
|||||||
todo!("unit conversions")
|
todo!("unit conversions")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Self::Ident(s, q) => {
|
||||||
|
let quotes = match q {
|
||||||
|
QuoteKind::Double | QuoteKind::Single => QuoteKind::Double,
|
||||||
|
QuoteKind::None => QuoteKind::None,
|
||||||
|
};
|
||||||
|
Value::Ident(
|
||||||
|
format!("{}{}/{}{}{}", num, unit, quotes, s, quotes),
|
||||||
|
QuoteKind::None,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
Self::BinaryOp(..) | Self::Paren(..) => Self::Dimension(num, unit) / other.eval(),
|
||||||
_ => todo!(),
|
_ => todo!(),
|
||||||
},
|
},
|
||||||
// Self::List(..) => todo!(),
|
// Self::List(..) => todo!(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user