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,284 @@
---
source: kcl/src/simulation_tests.rs
description: Artifact commands boolean_logical_multiple.kcl
---
[
{
"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_multiple.kcl
extension: md
snapshot_kind: binary
---

View File

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

View File

@ -0,0 +1,440 @@
---
source: kcl/src/simulation_tests.rs
description: Result of parsing boolean_logical_multiple.kcl
---
{
"Ok": {
"body": [
{
"declaration": {
"end": 25,
"id": {
"end": 2,
"name": "ii",
"start": 0,
"type": "Identifier"
},
"init": {
"end": 25,
"left": {
"end": 9,
"raw": "true",
"start": 5,
"type": "Literal",
"type": "Literal",
"value": true
},
"operator": "|",
"right": {
"end": 25,
"left": {
"end": 17,
"raw": "false",
"start": 12,
"type": "Literal",
"type": "Literal",
"value": false
},
"operator": "&",
"right": {
"end": 25,
"raw": "false",
"start": 20,
"type": "Literal",
"type": "Literal",
"value": false
},
"start": 12,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"start": 5,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"start": 0,
"type": "VariableDeclarator"
},
"end": 25,
"kind": "const",
"start": 0,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"declaration": {
"end": 56,
"id": {
"end": 27,
"name": "i",
"start": 26,
"type": "Identifier"
},
"init": {
"cond": {
"end": 35,
"name": "ii",
"start": 33,
"type": "Identifier",
"type": "Identifier"
},
"digest": null,
"else_ifs": [],
"end": 56,
"final_else": {
"body": [
{
"end": 54,
"expression": {
"end": 54,
"raw": "2",
"start": 53,
"type": "Literal",
"type": "Literal",
"value": {
"value": 2.0,
"suffix": "None"
}
},
"start": 53,
"type": "ExpressionStatement",
"type": "ExpressionStatement"
}
],
"end": 55,
"start": 53
},
"start": 30,
"then_val": {
"body": [
{
"end": 41,
"expression": {
"end": 41,
"raw": "1",
"start": 40,
"type": "Literal",
"type": "Literal",
"value": {
"value": 1.0,
"suffix": "None"
}
},
"start": 40,
"type": "ExpressionStatement",
"type": "ExpressionStatement"
}
],
"end": 42,
"start": 40
},
"type": "IfExpression",
"type": "IfExpression"
},
"start": 26,
"type": "VariableDeclarator"
},
"end": 56,
"kind": "const",
"start": 26,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"end": 108,
"expression": {
"arguments": [
{
"end": 70,
"left": {
"end": 65,
"name": "i",
"start": 64,
"type": "Identifier",
"type": "Identifier"
},
"operator": "==",
"right": {
"end": 70,
"raw": "1",
"start": 69,
"type": "Literal",
"type": "Literal",
"value": {
"value": 1.0,
"suffix": "None"
}
},
"start": 64,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
{
"end": 107,
"raw": "\"and has higher precedence than or\"",
"start": 72,
"type": "Literal",
"type": "Literal",
"value": "and has higher precedence than or"
}
],
"callee": {
"end": 63,
"name": "assert",
"start": 57,
"type": "Identifier"
},
"end": 108,
"start": 57,
"type": "CallExpression",
"type": "CallExpression"
},
"start": 57,
"type": "ExpressionStatement",
"type": "ExpressionStatement"
},
{
"declaration": {
"end": 151,
"id": {
"end": 112,
"name": "jj",
"start": 110,
"type": "Identifier"
},
"init": {
"end": 151,
"left": {
"end": 136,
"left": {
"end": 120,
"raw": "false",
"start": 115,
"type": "Literal",
"type": "Literal",
"value": false
},
"operator": "|",
"right": {
"end": 136,
"left": {
"end": 127,
"raw": "true",
"start": 123,
"type": "Literal",
"type": "Literal",
"value": true
},
"operator": "&",
"right": {
"argument": {
"end": 136,
"raw": "false",
"start": 131,
"type": "Literal",
"type": "Literal",
"value": false
},
"end": 136,
"operator": "!",
"start": 130,
"type": "UnaryExpression",
"type": "UnaryExpression"
},
"start": 123,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"start": 115,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"operator": "|",
"right": {
"end": 151,
"left": {
"end": 144,
"raw": "false",
"start": 139,
"type": "Literal",
"type": "Literal",
"value": false
},
"operator": "&",
"right": {
"end": 151,
"raw": "true",
"start": 147,
"type": "Literal",
"type": "Literal",
"value": true
},
"start": 139,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"start": 115,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"start": 110,
"type": "VariableDeclarator"
},
"end": 151,
"kind": "const",
"start": 110,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"declaration": {
"end": 182,
"id": {
"end": 153,
"name": "j",
"start": 152,
"type": "Identifier"
},
"init": {
"cond": {
"end": 161,
"name": "jj",
"start": 159,
"type": "Identifier",
"type": "Identifier"
},
"digest": null,
"else_ifs": [],
"end": 182,
"final_else": {
"body": [
{
"end": 180,
"expression": {
"end": 180,
"raw": "2",
"start": 179,
"type": "Literal",
"type": "Literal",
"value": {
"value": 2.0,
"suffix": "None"
}
},
"start": 179,
"type": "ExpressionStatement",
"type": "ExpressionStatement"
}
],
"end": 181,
"start": 179
},
"start": 156,
"then_val": {
"body": [
{
"end": 167,
"expression": {
"end": 167,
"raw": "1",
"start": 166,
"type": "Literal",
"type": "Literal",
"value": {
"value": 1.0,
"suffix": "None"
}
},
"start": 166,
"type": "ExpressionStatement",
"type": "ExpressionStatement"
}
],
"end": 168,
"start": 166
},
"type": "IfExpression",
"type": "IfExpression"
},
"start": 152,
"type": "VariableDeclarator"
},
"end": 182,
"kind": "const",
"start": 152,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"end": 227,
"expression": {
"arguments": [
{
"end": 196,
"left": {
"end": 191,
"name": "j",
"start": 190,
"type": "Identifier",
"type": "Identifier"
},
"operator": "==",
"right": {
"end": 196,
"raw": "1",
"start": 195,
"type": "Literal",
"type": "Literal",
"value": {
"value": 1.0,
"suffix": "None"
}
},
"start": 190,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
{
"end": 226,
"raw": "\"multiple logical operators\"",
"start": 198,
"type": "Literal",
"type": "Literal",
"value": "multiple logical operators"
}
],
"callee": {
"end": 189,
"name": "assert",
"start": 183,
"type": "Identifier"
},
"end": 227,
"start": 183,
"type": "CallExpression",
"type": "CallExpression"
},
"start": 183,
"type": "ExpressionStatement",
"type": "ExpressionStatement"
}
],
"end": 228,
"nonCodeMeta": {
"nonCodeNodes": {
"2": [
{
"end": 110,
"start": 108,
"type": "NonCodeNode",
"value": {
"type": "newLine"
}
}
]
},
"startNodes": []
},
"start": 0
}
}

View File

@ -0,0 +1,15 @@
ii = true | false & false
i = if ii {
1
} else {
2
}
assert(i == 1, "and has higher precedence than or")
jj = false | true & !false | false & true
j = if jj {
1
} else {
2
}
assert(j == 1, "multiple logical operators")

View File

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

View File

@ -0,0 +1,118 @@
---
source: kcl/src/simulation_tests.rs
description: Variables in memory after executing boolean_logical_multiple.kcl
---
{
"i": {
"type": "Number",
"value": 1.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
},
"__meta": [
{
"sourceRange": [
40,
41,
0
]
}
]
},
"ii": {
"type": "Bool",
"value": true,
"__meta": [
{
"sourceRange": [
5,
9,
0
]
},
{
"sourceRange": [
12,
17,
0
]
},
{
"sourceRange": [
20,
25,
0
]
}
]
},
"j": {
"type": "Number",
"value": 1.0,
"ty": {
"type": "Default",
"len": {
"type": "Mm"
},
"angle": {
"type": "Degrees"
}
},
"__meta": [
{
"sourceRange": [
166,
167,
0
]
}
]
},
"jj": {
"type": "Bool",
"value": true,
"__meta": [
{
"sourceRange": [
115,
120,
0
]
},
{
"sourceRange": [
123,
127,
0
]
},
{
"sourceRange": [
130,
136,
0
]
},
{
"sourceRange": [
139,
144,
0
]
},
{
"sourceRange": [
147,
151,
0
]
}
]
}
}