Add binary literals (#4680)

This commit is contained in:
JT
2022-02-28 18:31:53 -05:00
committed by GitHub
parent e3100e6afd
commit a6a96b29cb
15 changed files with 199 additions and 10 deletions

View File

@ -227,6 +227,10 @@ pub fn eval_expression(
val: *f,
span: expr.span,
}),
Expr::Binary(b) => Ok(Value::Binary {
val: b.clone(),
span: expr.span,
}),
Expr::ValueWithUnit(e, unit) => match eval_expression(engine_state, stack, e)? {
Value::Int { val, .. } => Ok(compute(val, unit.item, unit.span)),
x => Err(ShellError::CantConvert(