Refactor: simplify bad code
This commit is contained in:
@ -427,8 +427,7 @@ impl Planner {
|
|||||||
KclValueGroup::Single(init_value) => {
|
KclValueGroup::Single(init_value) => {
|
||||||
// Simple! Just evaluate it, note where the final value will be stored in KCEP memory,
|
// Simple! Just evaluate it, note where the final value will be stored in KCEP memory,
|
||||||
// and bind it to the KCL identifier.
|
// and bind it to the KCL identifier.
|
||||||
let EvalPlan { instructions, binding } = self.plan_to_compute_single(ctx, init_value)?;
|
self.plan_to_compute_single(ctx, init_value)
|
||||||
Ok(EvalPlan { instructions, binding })
|
|
||||||
}
|
}
|
||||||
KclValueGroup::ArrayExpression(expr) => {
|
KclValueGroup::ArrayExpression(expr) => {
|
||||||
let length_at = self.next_addr.offset_by(1);
|
let length_at = self.next_addr.offset_by(1);
|
||||||
|
|||||||
@ -707,14 +707,11 @@ fn store_object() {
|
|||||||
assert_eq!(
|
assert_eq!(
|
||||||
bindings.get("x0").unwrap(),
|
bindings.get("x0").unwrap(),
|
||||||
&EpBinding::Map(HashMap::from([
|
&EpBinding::Map(HashMap::from([
|
||||||
("a".to_owned(), EpBinding::Single(Address::ZERO),),
|
("a".to_owned(), EpBinding::Single(Address::ZERO)),
|
||||||
("b".to_owned(), EpBinding::Single(Address::ZERO.offset(1))),
|
("b".to_owned(), EpBinding::Single(Address::ZERO + 1)),
|
||||||
(
|
(
|
||||||
"c".to_owned(),
|
"c".to_owned(),
|
||||||
EpBinding::Map(HashMap::from([(
|
EpBinding::Map(HashMap::from([("d".to_owned(), EpBinding::Single(Address::ZERO + 2))]))
|
||||||
"d".to_owned(),
|
|
||||||
EpBinding::Single(Address::ZERO.offset(2))
|
|
||||||
)]))
|
|
||||||
),
|
),
|
||||||
]))
|
]))
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user