Move the wasm lib, and cleanup rust directory and all references (#5585)

* git mv src/wasm-lib rust

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* mv wasm-lib to workspace

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* mv kcl-lib

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* mv derive docs

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* resolve file paths

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* clippy

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* move more shit

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix more paths

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* make yarn build:wasm work

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix scripts

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fixups

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* better references

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix cargo ci

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix reference

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix more ci

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix tests

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* cargo sort

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix script

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fmt

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix a dep

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* sort

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* remove unused deps

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* Revert "remove unused deps"

This reverts commit fbabdb062e275fd5cbc1476f8480a1afee15d972.

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* deps;

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fixes

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
Jess Frazelle
2025-03-01 13:59:01 -08:00
committed by GitHub
parent 0a2bf4b55f
commit c3bdc6f106
1443 changed files with 509 additions and 4274 deletions

View File

@ -0,0 +1,285 @@
---
source: kcl/src/simulation_tests.rs
description: Artifact commands boolean_logical_and.kcl
snapshot_kind: text
---
[
{
"cmdId": "[uuid]",
"range": [
0,
0,
0
],
"command": {
"type": "make_plane",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"x_axis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"y_axis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"size": 100.0,
"clobber": false,
"hide": true
}
},
{
"cmdId": "[uuid]",
"range": [
0,
0,
0
],
"command": {
"type": "plane_set_color",
"plane_id": "[uuid]",
"color": {
"r": 0.7,
"g": 0.28,
"b": 0.28,
"a": 0.4
}
}
},
{
"cmdId": "[uuid]",
"range": [
0,
0,
0
],
"command": {
"type": "make_plane",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"x_axis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"y_axis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"size": 100.0,
"clobber": false,
"hide": true
}
},
{
"cmdId": "[uuid]",
"range": [
0,
0,
0
],
"command": {
"type": "plane_set_color",
"plane_id": "[uuid]",
"color": {
"r": 0.28,
"g": 0.7,
"b": 0.28,
"a": 0.4
}
}
},
{
"cmdId": "[uuid]",
"range": [
0,
0,
0
],
"command": {
"type": "make_plane",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"x_axis": {
"x": 1.0,
"y": 0.0,
"z": 0.0
},
"y_axis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"size": 100.0,
"clobber": false,
"hide": true
}
},
{
"cmdId": "[uuid]",
"range": [
0,
0,
0
],
"command": {
"type": "plane_set_color",
"plane_id": "[uuid]",
"color": {
"r": 0.28,
"g": 0.28,
"b": 0.7,
"a": 0.4
}
}
},
{
"cmdId": "[uuid]",
"range": [
0,
0,
0
],
"command": {
"type": "make_plane",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"x_axis": {
"x": -1.0,
"y": 0.0,
"z": 0.0
},
"y_axis": {
"x": 0.0,
"y": 1.0,
"z": 0.0
},
"size": 100.0,
"clobber": false,
"hide": true
}
},
{
"cmdId": "[uuid]",
"range": [
0,
0,
0
],
"command": {
"type": "make_plane",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"x_axis": {
"x": 0.0,
"y": -1.0,
"z": 0.0
},
"y_axis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"size": 100.0,
"clobber": false,
"hide": true
}
},
{
"cmdId": "[uuid]",
"range": [
0,
0,
0
],
"command": {
"type": "make_plane",
"origin": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"x_axis": {
"x": -1.0,
"y": 0.0,
"z": 0.0
},
"y_axis": {
"x": 0.0,
"y": 0.0,
"z": 1.0
},
"size": 100.0,
"clobber": false,
"hide": true
}
},
{
"cmdId": "[uuid]",
"range": [
0,
0,
0
],
"command": {
"type": "edge_lines_visible",
"hidden": false
}
},
{
"cmdId": "[uuid]",
"range": [
0,
0,
0
],
"command": {
"type": "set_scene_units",
"unit": "mm"
}
},
{
"cmdId": "[uuid]",
"range": [
0,
0,
0
],
"command": {
"type": "object_visible",
"object_id": "[uuid]",
"hidden": true
}
},
{
"cmdId": "[uuid]",
"range": [
0,
0,
0
],
"command": {
"type": "object_visible",
"object_id": "[uuid]",
"hidden": true
}
}
]

View File

@ -0,0 +1,6 @@
---
source: kcl/src/simulation_tests.rs
description: Artifact graph flowchart boolean_logical_and.kcl
extension: md
snapshot_kind: binary
---

View File

@ -0,0 +1,3 @@
```mermaid
flowchart LR
```

View File

@ -0,0 +1,739 @@
---
source: kcl/src/simulation_tests.rs
description: Result of parsing boolean_logical_and.kcl
---
{
"Ok": {
"body": [
{
"declaration": {
"end": 17,
"id": {
"end": 2,
"name": "aa",
"start": 0,
"type": "Identifier"
},
"init": {
"end": 17,
"left": {
"end": 9,
"raw": "true",
"start": 5,
"type": "Literal",
"type": "Literal",
"value": true
},
"operator": "&",
"right": {
"end": 17,
"raw": "false",
"start": 12,
"type": "Literal",
"type": "Literal",
"value": false
},
"start": 5,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"start": 0,
"type": "VariableDeclarator"
},
"end": 17,
"kind": "const",
"start": 0,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"declaration": {
"end": 48,
"id": {
"end": 19,
"name": "a",
"start": 18,
"type": "Identifier"
},
"init": {
"cond": {
"end": 27,
"name": "aa",
"start": 25,
"type": "Identifier",
"type": "Identifier"
},
"digest": null,
"else_ifs": [],
"end": 48,
"final_else": {
"body": [
{
"end": 46,
"expression": {
"end": 46,
"raw": "2",
"start": 45,
"type": "Literal",
"type": "Literal",
"value": {
"value": 2.0,
"suffix": "None"
}
},
"start": 45,
"type": "ExpressionStatement",
"type": "ExpressionStatement"
}
],
"end": 47,
"start": 45
},
"start": 22,
"then_val": {
"body": [
{
"end": 33,
"expression": {
"end": 33,
"raw": "1",
"start": 32,
"type": "Literal",
"type": "Literal",
"value": {
"value": 1.0,
"suffix": "None"
}
},
"start": 32,
"type": "ExpressionStatement",
"type": "ExpressionStatement"
}
],
"end": 34,
"start": 32
},
"type": "IfExpression",
"type": "IfExpression"
},
"start": 18,
"type": "VariableDeclarator"
},
"end": 48,
"kind": "const",
"start": 18,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"end": 128,
"expression": {
"arguments": [
{
"end": 62,
"left": {
"end": 57,
"name": "a",
"start": 56,
"type": "Identifier",
"type": "Identifier"
},
"operator": "==",
"right": {
"end": 62,
"raw": "2",
"start": 61,
"type": "Literal",
"type": "Literal",
"value": {
"value": 2.0,
"suffix": "None"
}
},
"start": 56,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
{
"end": 127,
"raw": "\"right branch of and is false makes the whole expression false\"",
"start": 64,
"type": "Literal",
"type": "Literal",
"value": "right branch of and is false makes the whole expression false"
}
],
"callee": {
"end": 55,
"name": "assert",
"start": 49,
"type": "Identifier"
},
"end": 128,
"start": 49,
"type": "CallExpression",
"type": "CallExpression"
},
"start": 49,
"type": "ExpressionStatement",
"type": "ExpressionStatement"
},
{
"declaration": {
"end": 147,
"id": {
"end": 132,
"name": "bb",
"start": 130,
"type": "Identifier"
},
"init": {
"end": 147,
"left": {
"end": 140,
"raw": "false",
"start": 135,
"type": "Literal",
"type": "Literal",
"value": false
},
"operator": "&",
"right": {
"end": 147,
"raw": "true",
"start": 143,
"type": "Literal",
"type": "Literal",
"value": true
},
"start": 135,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"start": 130,
"type": "VariableDeclarator"
},
"end": 147,
"kind": "const",
"start": 130,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"declaration": {
"end": 178,
"id": {
"end": 149,
"name": "b",
"start": 148,
"type": "Identifier"
},
"init": {
"cond": {
"end": 157,
"name": "bb",
"start": 155,
"type": "Identifier",
"type": "Identifier"
},
"digest": null,
"else_ifs": [],
"end": 178,
"final_else": {
"body": [
{
"end": 176,
"expression": {
"end": 176,
"raw": "2",
"start": 175,
"type": "Literal",
"type": "Literal",
"value": {
"value": 2.0,
"suffix": "None"
}
},
"start": 175,
"type": "ExpressionStatement",
"type": "ExpressionStatement"
}
],
"end": 177,
"start": 175
},
"start": 152,
"then_val": {
"body": [
{
"end": 163,
"expression": {
"end": 163,
"raw": "1",
"start": 162,
"type": "Literal",
"type": "Literal",
"value": {
"value": 1.0,
"suffix": "None"
}
},
"start": 162,
"type": "ExpressionStatement",
"type": "ExpressionStatement"
}
],
"end": 164,
"start": 162
},
"type": "IfExpression",
"type": "IfExpression"
},
"start": 148,
"type": "VariableDeclarator"
},
"end": 178,
"kind": "const",
"start": 148,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"end": 257,
"expression": {
"arguments": [
{
"end": 192,
"left": {
"end": 187,
"name": "b",
"start": 186,
"type": "Identifier",
"type": "Identifier"
},
"operator": "==",
"right": {
"end": 192,
"raw": "2",
"start": 191,
"type": "Literal",
"type": "Literal",
"value": {
"value": 2.0,
"suffix": "None"
}
},
"start": 186,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
{
"end": 256,
"raw": "\"left branch of and is false makes the whole expression false\"",
"start": 194,
"type": "Literal",
"type": "Literal",
"value": "left branch of and is false makes the whole expression false"
}
],
"callee": {
"end": 185,
"name": "assert",
"start": 179,
"type": "Identifier"
},
"end": 257,
"start": 179,
"type": "CallExpression",
"type": "CallExpression"
},
"start": 179,
"type": "ExpressionStatement",
"type": "ExpressionStatement"
},
{
"declaration": {
"end": 275,
"id": {
"end": 261,
"name": "cc",
"start": 259,
"type": "Identifier"
},
"init": {
"end": 275,
"left": {
"end": 268,
"raw": "true",
"start": 264,
"type": "Literal",
"type": "Literal",
"value": true
},
"operator": "&",
"right": {
"end": 275,
"raw": "true",
"start": 271,
"type": "Literal",
"type": "Literal",
"value": true
},
"start": 264,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"start": 259,
"type": "VariableDeclarator"
},
"end": 275,
"kind": "const",
"start": 259,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"declaration": {
"end": 306,
"id": {
"end": 277,
"name": "c",
"start": 276,
"type": "Identifier"
},
"init": {
"cond": {
"end": 285,
"name": "cc",
"start": 283,
"type": "Identifier",
"type": "Identifier"
},
"digest": null,
"else_ifs": [],
"end": 306,
"final_else": {
"body": [
{
"end": 304,
"expression": {
"end": 304,
"raw": "2",
"start": 303,
"type": "Literal",
"type": "Literal",
"value": {
"value": 2.0,
"suffix": "None"
}
},
"start": 303,
"type": "ExpressionStatement",
"type": "ExpressionStatement"
}
],
"end": 305,
"start": 303
},
"start": 280,
"then_val": {
"body": [
{
"end": 291,
"expression": {
"end": 291,
"raw": "1",
"start": 290,
"type": "Literal",
"type": "Literal",
"value": {
"value": 1.0,
"suffix": "None"
}
},
"start": 290,
"type": "ExpressionStatement",
"type": "ExpressionStatement"
}
],
"end": 292,
"start": 290
},
"type": "IfExpression",
"type": "IfExpression"
},
"start": 276,
"type": "VariableDeclarator"
},
"end": 306,
"kind": "const",
"start": 276,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"end": 386,
"expression": {
"arguments": [
{
"end": 320,
"left": {
"end": 315,
"name": "c",
"start": 314,
"type": "Identifier",
"type": "Identifier"
},
"operator": "==",
"right": {
"end": 320,
"raw": "1",
"start": 319,
"type": "Literal",
"type": "Literal",
"value": {
"value": 1.0,
"suffix": "None"
}
},
"start": 314,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
{
"end": 385,
"raw": "\"both branches of and are true makes the whole expression true\"",
"start": 322,
"type": "Literal",
"type": "Literal",
"value": "both branches of and are true makes the whole expression true"
}
],
"callee": {
"end": 313,
"name": "assert",
"start": 307,
"type": "Identifier"
},
"end": 386,
"start": 307,
"type": "CallExpression",
"type": "CallExpression"
},
"start": 307,
"type": "ExpressionStatement",
"type": "ExpressionStatement"
},
{
"declaration": {
"end": 406,
"id": {
"end": 390,
"name": "dd",
"start": 388,
"type": "Identifier"
},
"init": {
"end": 406,
"left": {
"end": 398,
"raw": "false",
"start": 393,
"type": "Literal",
"type": "Literal",
"value": false
},
"operator": "&",
"right": {
"end": 406,
"raw": "false",
"start": 401,
"type": "Literal",
"type": "Literal",
"value": false
},
"start": 393,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"start": 388,
"type": "VariableDeclarator"
},
"end": 406,
"kind": "const",
"start": 388,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"declaration": {
"end": 437,
"id": {
"end": 408,
"name": "d",
"start": 407,
"type": "Identifier"
},
"init": {
"cond": {
"end": 416,
"name": "dd",
"start": 414,
"type": "Identifier",
"type": "Identifier"
},
"digest": null,
"else_ifs": [],
"end": 437,
"final_else": {
"body": [
{
"end": 435,
"expression": {
"end": 435,
"raw": "2",
"start": 434,
"type": "Literal",
"type": "Literal",
"value": {
"value": 2.0,
"suffix": "None"
}
},
"start": 434,
"type": "ExpressionStatement",
"type": "ExpressionStatement"
}
],
"end": 436,
"start": 434
},
"start": 411,
"then_val": {
"body": [
{
"end": 422,
"expression": {
"end": 422,
"raw": "1",
"start": 421,
"type": "Literal",
"type": "Literal",
"value": {
"value": 1.0,
"suffix": "None"
}
},
"start": 421,
"type": "ExpressionStatement",
"type": "ExpressionStatement"
}
],
"end": 423,
"start": 421
},
"type": "IfExpression",
"type": "IfExpression"
},
"start": 407,
"type": "VariableDeclarator"
},
"end": 437,
"kind": "const",
"start": 407,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"end": 519,
"expression": {
"arguments": [
{
"end": 451,
"left": {
"end": 446,
"name": "d",
"start": 445,
"type": "Identifier",
"type": "Identifier"
},
"operator": "==",
"right": {
"end": 451,
"raw": "2",
"start": 450,
"type": "Literal",
"type": "Literal",
"value": {
"value": 2.0,
"suffix": "None"
}
},
"start": 445,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
{
"end": 518,
"raw": "\"both branches of and are false makes the whole expression false\"",
"start": 453,
"type": "Literal",
"type": "Literal",
"value": "both branches of and are false makes the whole expression false"
}
],
"callee": {
"end": 444,
"name": "assert",
"start": 438,
"type": "Identifier"
},
"end": 519,
"start": 438,
"type": "CallExpression",
"type": "CallExpression"
},
"start": 438,
"type": "ExpressionStatement",
"type": "ExpressionStatement"
}
],
"end": 520,
"nonCodeMeta": {
"nonCodeNodes": {
"2": [
{
"end": 130,
"start": 128,
"type": "NonCodeNode",
"value": {
"type": "newLine"
}
}
],
"5": [
{
"end": 259,
"start": 257,
"type": "NonCodeNode",
"value": {
"type": "newLine"
}
}
],
"8": [
{
"end": 388,
"start": 386,
"type": "NonCodeNode",
"value": {
"type": "newLine"
}
}
]
},
"startNodes": []
},
"start": 0
}
}

View File

@ -0,0 +1,31 @@
aa = true & false
a = if aa {
1
} else {
2
}
assert(a == 2, "right branch of and is false makes the whole expression false")
bb = false & true
b = if bb {
1
} else {
2
}
assert(b == 2, "left branch of and is false makes the whole expression false")
cc = true & true
c = if cc {
1
} else {
2
}
assert(c == 1, "both branches of and are true makes the whole expression true")
dd = false & false
d = if dd {
1
} else {
2
}
assert(d == 2, "both branches of and are false makes the whole expression false")

View File

@ -0,0 +1,5 @@
---
source: kcl/src/simulation_tests.rs
description: Operations executed boolean_logical_and.kcl
---
[]

View File

@ -0,0 +1,174 @@
---
source: kcl/src/simulation_tests.rs
description: Variables in memory after executing boolean_logical_and.kcl
---
{
"a": {
"type": "Number",
"value": 2.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
},
"__meta": [
{
"sourceRange": [
45,
46,
0
]
}
]
},
"aa": {
"type": "Bool",
"value": false,
"__meta": [
{
"sourceRange": [
5,
9,
0
]
},
{
"sourceRange": [
12,
17,
0
]
}
]
},
"b": {
"type": "Number",
"value": 2.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
},
"__meta": [
{
"sourceRange": [
175,
176,
0
]
}
]
},
"bb": {
"type": "Bool",
"value": false,
"__meta": [
{
"sourceRange": [
135,
140,
0
]
},
{
"sourceRange": [
143,
147,
0
]
}
]
},
"c": {
"type": "Number",
"value": 1.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
},
"__meta": [
{
"sourceRange": [
290,
291,
0
]
}
]
},
"cc": {
"type": "Bool",
"value": true,
"__meta": [
{
"sourceRange": [
264,
268,
0
]
},
{
"sourceRange": [
271,
275,
0
]
}
]
},
"d": {
"type": "Number",
"value": 2.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
},
"__meta": [
{
"sourceRange": [
434,
435,
0
]
}
]
},
"dd": {
"type": "Bool",
"value": false,
"__meta": [
{
"sourceRange": [
393,
398,
0
]
},
{
"sourceRange": [
401,
406,
0
]
}
]
}
}