Misc tidying up around KclValue, etc. (#5653)

* Make some things a little less public

Signed-off-by: Nick Cameron <nrc@ncameron.org>

* Rename KclValue::Array to MixedArray

Signed-off-by: Nick Cameron <nrc@ncameron.org>

* Add settings to KclValue::Function

Signed-off-by: Nick Cameron <nrc@ncameron.org>

* Remove a bunch of dead code, simplifying mock exec and meaning KclValue no longer needs to deserialize

Signed-off-by: Nick Cameron <nrc@ncameron.org>

---------

Signed-off-by: Nick Cameron <nrc@ncameron.org>
This commit is contained in:
Nick Cameron
2025-03-08 04:04:57 +13:00
committed by GitHub
parent 5d25f4a0e5
commit 6cce3cda36
39 changed files with 163 additions and 470 deletions

View File

@ -1,10 +1,10 @@
---
source: kcl/src/simulation_tests.rs
source: kcl-lib/src/simulation_tests.rs
description: Variables in memory after executing array_elem_pop.kcl
---
{
"arr": {
"type": "Array",
"type": "MixedArray",
"value": [
{
"type": "Number",
@ -84,7 +84,7 @@ description: Variables in memory after executing array_elem_pop.kcl
]
},
"new_arr1": {
"type": "Array",
"type": "MixedArray",
"value": [
{
"type": "Number",
@ -142,7 +142,7 @@ description: Variables in memory after executing array_elem_pop.kcl
]
},
"new_arr2": {
"type": "Array",
"type": "MixedArray",
"value": [
{
"type": "Number",
@ -178,7 +178,7 @@ description: Variables in memory after executing array_elem_pop.kcl
]
},
"new_arr3": {
"type": "Array",
"type": "MixedArray",
"value": [],
"__meta": [
{

View File

@ -1,10 +1,10 @@
---
source: kcl/src/simulation_tests.rs
source: kcl-lib/src/simulation_tests.rs
description: Variables in memory after executing array_elem_push.kcl
---
{
"arr": {
"type": "Array",
"type": "MixedArray",
"value": [
{
"type": "Number",
@ -84,7 +84,7 @@ description: Variables in memory after executing array_elem_push.kcl
]
},
"new_arr1": {
"type": "Array",
"type": "MixedArray",
"value": [
{
"type": "Number",
@ -186,7 +186,7 @@ description: Variables in memory after executing array_elem_push.kcl
]
},
"new_arr2": {
"type": "Array",
"type": "MixedArray",
"value": [
{
"type": "Number",

View File

@ -1,5 +1,5 @@
---
source: kcl/src/simulation_tests.rs
source: kcl-lib/src/simulation_tests.rs
description: Variables in memory after executing array_range_expr.kcl
---
{
@ -48,7 +48,7 @@ description: Variables in memory after executing array_range_expr.kcl
]
},
"r1": {
"type": "Array",
"type": "MixedArray",
"value": [
{
"type": "Number",
@ -147,7 +147,7 @@ description: Variables in memory after executing array_range_expr.kcl
]
},
"r2": {
"type": "Array",
"type": "MixedArray",
"value": [
{
"type": "Number",
@ -246,7 +246,7 @@ description: Variables in memory after executing array_range_expr.kcl
]
},
"r3": {
"type": "Array",
"type": "MixedArray",
"value": [
{
"type": "Number",
@ -362,7 +362,7 @@ description: Variables in memory after executing array_range_expr.kcl
]
},
"r4": {
"type": "Array",
"type": "MixedArray",
"value": [
{
"type": "Number",

View File

@ -1,10 +1,10 @@
---
source: kcl/src/simulation_tests.rs
source: kcl-lib/src/simulation_tests.rs
description: Variables in memory after executing array_range_negative_expr.kcl
---
{
"xs": {
"type": "Array",
"type": "MixedArray",
"value": [
{
"type": "Number",

View File

@ -1,10 +1,10 @@
---
source: kcl/src/simulation_tests.rs
source: kcl-lib/src/simulation_tests.rs
description: Variables in memory after executing computed_var.kcl
---
{
"arr": {
"type": "Array",
"type": "MixedArray",
"value": [
{
"type": "Number",

View File

@ -1,5 +1,5 @@
---
source: kcl/src/simulation_tests.rs
source: kcl-lib/src/simulation_tests.rs
description: Variables in memory after executing double_map_fn.kcl
---
{
@ -16,7 +16,7 @@ description: Variables in memory after executing double_map_fn.kcl
]
},
"xs": {
"type": "Array",
"type": "MixedArray",
"value": [
{
"type": "Number",
@ -81,7 +81,7 @@ description: Variables in memory after executing double_map_fn.kcl
]
},
"ys": {
"type": "Array",
"type": "MixedArray",
"value": [
{
"type": "Number",

View File

@ -736,7 +736,7 @@ description: Variables in memory after executing i_shape.kcl
]
},
"d_wrist_circumference": {
"type": "Array",
"type": "MixedArray",
"value": [
{
"type": "Number",

View File

@ -1,10 +1,10 @@
---
source: kcl/src/simulation_tests.rs
source: kcl-lib/src/simulation_tests.rs
description: Variables in memory after executing index_of_array.kcl
---
{
"arr": {
"type": "Array",
"type": "MixedArray",
"value": [
{
"type": "Number",

View File

@ -1,5 +1,5 @@
---
source: kcl/src/simulation_tests.rs
source: kcl-lib/src/simulation_tests.rs
description: Variables in memory after executing dodecahedron.kcl
---
{
@ -2419,7 +2419,7 @@ description: Variables in memory after executing dodecahedron.kcl
"type": "Object",
"value": {
"origin": {
"type": "Array",
"type": "MixedArray",
"value": [
{
"type": "Number",
@ -2536,7 +2536,7 @@ description: Variables in memory after executing dodecahedron.kcl
]
},
"xAxis": {
"type": "Array",
"type": "MixedArray",
"value": [
{
"type": "Number",
@ -2606,7 +2606,7 @@ description: Variables in memory after executing dodecahedron.kcl
]
},
"yAxis": {
"type": "Array",
"type": "MixedArray",
"value": [
{
"type": "Number",
@ -2686,7 +2686,7 @@ description: Variables in memory after executing dodecahedron.kcl
]
},
"zAxis": {
"type": "Array",
"type": "MixedArray",
"value": [
{
"type": "Number",

View File

@ -1,5 +1,5 @@
---
source: kcl/src/simulation_tests.rs
source: kcl-lib/src/simulation_tests.rs
description: Variables in memory after executing food-service-spatula.kcl
---
{
@ -3461,7 +3461,7 @@ description: Variables in memory after executing food-service-spatula.kcl
"type": "Object",
"value": {
"origin": {
"type": "Array",
"type": "MixedArray",
"value": [
{
"type": "Number",
@ -3541,7 +3541,7 @@ description: Variables in memory after executing food-service-spatula.kcl
]
},
"xAxis": {
"type": "Array",
"type": "MixedArray",
"value": [
{
"type": "Number",
@ -3621,7 +3621,7 @@ description: Variables in memory after executing food-service-spatula.kcl
]
},
"yAxis": {
"type": "Array",
"type": "MixedArray",
"value": [
{
"type": "Number",
@ -3701,7 +3701,7 @@ description: Variables in memory after executing food-service-spatula.kcl
]
},
"zAxis": {
"type": "Array",
"type": "MixedArray",
"value": [
{
"type": "Number",

View File

@ -1,5 +1,5 @@
---
source: kcl/src/simulation_tests.rs
source: kcl-lib/src/simulation_tests.rs
description: Variables in memory after executing french-press.kcl
---
{
@ -5839,7 +5839,7 @@ description: Variables in memory after executing french-press.kcl
"type": "Object",
"value": {
"origin": {
"type": "Array",
"type": "MixedArray",
"value": [
{
"type": "Number",
@ -5919,7 +5919,7 @@ description: Variables in memory after executing french-press.kcl
]
},
"xAxis": {
"type": "Array",
"type": "MixedArray",
"value": [
{
"type": "Number",
@ -5999,7 +5999,7 @@ description: Variables in memory after executing french-press.kcl
]
},
"yAxis": {
"type": "Array",
"type": "MixedArray",
"value": [
{
"type": "Number",
@ -6079,7 +6079,7 @@ description: Variables in memory after executing french-press.kcl
]
},
"zAxis": {
"type": "Array",
"type": "MixedArray",
"value": [
{
"type": "Number",

View File

@ -1,5 +1,5 @@
---
source: kcl/src/simulation_tests.rs
source: kcl-lib/src/simulation_tests.rs
description: Variables in memory after executing gear.kcl
---
{
@ -26,7 +26,7 @@ description: Variables in memory after executing gear.kcl
]
},
"angles": {
"type": "Array",
"type": "MixedArray",
"value": [
{
"type": "Number",
@ -1950,7 +1950,7 @@ description: Variables in memory after executing gear.kcl
]
},
"invas": {
"type": "Array",
"type": "MixedArray",
"value": [
{
"type": "Number",
@ -4896,7 +4896,7 @@ description: Variables in memory after executing gear.kcl
]
},
"rs": {
"type": "Array",
"type": "MixedArray",
"value": [
{
"type": "Number",
@ -116597,7 +116597,7 @@ description: Variables in memory after executing gear.kcl
]
},
"xs": {
"type": "Array",
"type": "MixedArray",
"value": [
{
"type": "Number",
@ -128239,7 +128239,7 @@ description: Variables in memory after executing gear.kcl
]
},
"ys": {
"type": "Array",
"type": "MixedArray",
"value": [
{
"type": "Number",

View File

@ -1,5 +1,5 @@
---
source: kcl/src/simulation_tests.rs
source: kcl-lib/src/simulation_tests.rs
description: Variables in memory after executing gridfinity-baseplate-magnets.kcl
---
{
@ -10,7 +10,7 @@ description: Variables in memory after executing gridfinity-baseplate-magnets.kc
"type": "Object",
"value": {
"axis": {
"type": "Array",
"type": "MixedArray",
"value": [
{
"type": "Number",
@ -68,7 +68,7 @@ description: Variables in memory after executing gridfinity-baseplate-magnets.kc
]
},
"origin": {
"type": "Array",
"type": "MixedArray",
"value": [
{
"type": "Number",

View File

@ -1,5 +1,5 @@
---
source: kcl/src/simulation_tests.rs
source: kcl-lib/src/simulation_tests.rs
description: Variables in memory after executing gridfinity-baseplate.kcl
---
{
@ -10,7 +10,7 @@ description: Variables in memory after executing gridfinity-baseplate.kcl
"type": "Object",
"value": {
"axis": {
"type": "Array",
"type": "MixedArray",
"value": [
{
"type": "Number",
@ -68,7 +68,7 @@ description: Variables in memory after executing gridfinity-baseplate.kcl
]
},
"origin": {
"type": "Array",
"type": "MixedArray",
"value": [
{
"type": "Number",

View File

@ -1,5 +1,5 @@
---
source: kcl/src/simulation_tests.rs
source: kcl-lib/src/simulation_tests.rs
description: Variables in memory after executing gridfinity-bins-stacking-lip.kcl
---
{
@ -79,7 +79,7 @@ description: Variables in memory after executing gridfinity-bins-stacking-lip.kc
"type": "Object",
"value": {
"axis": {
"type": "Array",
"type": "MixedArray",
"value": [
{
"type": "Number",
@ -137,7 +137,7 @@ description: Variables in memory after executing gridfinity-bins-stacking-lip.kc
]
},
"origin": {
"type": "Array",
"type": "MixedArray",
"value": [
{
"type": "Number",
@ -237,7 +237,7 @@ description: Variables in memory after executing gridfinity-bins-stacking-lip.kc
"type": "Object",
"value": {
"axis": {
"type": "Array",
"type": "MixedArray",
"value": [
{
"type": "Number",
@ -295,7 +295,7 @@ description: Variables in memory after executing gridfinity-bins-stacking-lip.kc
]
},
"origin": {
"type": "Array",
"type": "MixedArray",
"value": [
{
"type": "Number",
@ -30147,7 +30147,7 @@ description: Variables in memory after executing gridfinity-bins-stacking-lip.kc
"type": "Object",
"value": {
"origin": {
"type": "Array",
"type": "MixedArray",
"value": [
{
"type": "Number",
@ -30249,7 +30249,7 @@ description: Variables in memory after executing gridfinity-bins-stacking-lip.kc
]
},
"xAxis": {
"type": "Array",
"type": "MixedArray",
"value": [
{
"type": "Number",
@ -30329,7 +30329,7 @@ description: Variables in memory after executing gridfinity-bins-stacking-lip.kc
]
},
"yAxis": {
"type": "Array",
"type": "MixedArray",
"value": [
{
"type": "Number",
@ -30409,7 +30409,7 @@ description: Variables in memory after executing gridfinity-bins-stacking-lip.kc
]
},
"zAxis": {
"type": "Array",
"type": "MixedArray",
"value": [
{
"type": "Number",
@ -30517,7 +30517,7 @@ description: Variables in memory after executing gridfinity-bins-stacking-lip.kc
"type": "Object",
"value": {
"origin": {
"type": "Array",
"type": "MixedArray",
"value": [
{
"type": "Number",
@ -30619,7 +30619,7 @@ description: Variables in memory after executing gridfinity-bins-stacking-lip.kc
]
},
"xAxis": {
"type": "Array",
"type": "MixedArray",
"value": [
{
"type": "Number",
@ -30699,7 +30699,7 @@ description: Variables in memory after executing gridfinity-bins-stacking-lip.kc
]
},
"yAxis": {
"type": "Array",
"type": "MixedArray",
"value": [
{
"type": "Number",
@ -30779,7 +30779,7 @@ description: Variables in memory after executing gridfinity-bins-stacking-lip.kc
]
},
"zAxis": {
"type": "Array",
"type": "MixedArray",
"value": [
{
"type": "Number",
@ -30887,7 +30887,7 @@ description: Variables in memory after executing gridfinity-bins-stacking-lip.kc
"type": "Object",
"value": {
"origin": {
"type": "Array",
"type": "MixedArray",
"value": [
{
"type": "Number",
@ -31011,7 +31011,7 @@ description: Variables in memory after executing gridfinity-bins-stacking-lip.kc
]
},
"xAxis": {
"type": "Array",
"type": "MixedArray",
"value": [
{
"type": "Number",
@ -31091,7 +31091,7 @@ description: Variables in memory after executing gridfinity-bins-stacking-lip.kc
]
},
"yAxis": {
"type": "Array",
"type": "MixedArray",
"value": [
{
"type": "Number",
@ -31171,7 +31171,7 @@ description: Variables in memory after executing gridfinity-bins-stacking-lip.kc
]
},
"zAxis": {
"type": "Array",
"type": "MixedArray",
"value": [
{
"type": "Number",

View File

@ -1,5 +1,5 @@
---
source: kcl/src/simulation_tests.rs
source: kcl-lib/src/simulation_tests.rs
description: Variables in memory after executing gridfinity-bins.kcl
---
{
@ -10,7 +10,7 @@ description: Variables in memory after executing gridfinity-bins.kcl
"type": "Object",
"value": {
"axis": {
"type": "Array",
"type": "MixedArray",
"value": [
{
"type": "Number",
@ -68,7 +68,7 @@ description: Variables in memory after executing gridfinity-bins.kcl
]
},
"origin": {
"type": "Array",
"type": "MixedArray",
"value": [
{
"type": "Number",

View File

@ -1,5 +1,5 @@
---
source: kcl/src/simulation_tests.rs
source: kcl-lib/src/simulation_tests.rs
description: Variables in memory after executing pipe-flange-assembly.kcl
---
{
@ -3475,7 +3475,7 @@ description: Variables in memory after executing pipe-flange-assembly.kcl
]
},
"screwStart": {
"type": "Array",
"type": "MixedArray",
"value": [
{
"type": "Number",