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:
		
							
								
								
									
										477
									
								
								rust/kcl-lib/tests/function_sketch/ast.snap
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										477
									
								
								rust/kcl-lib/tests/function_sketch/ast.snap
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,477 @@
 | 
			
		||||
---
 | 
			
		||||
source: kcl/src/simulation_tests.rs
 | 
			
		||||
description: Result of parsing function_sketch.kcl
 | 
			
		||||
---
 | 
			
		||||
{
 | 
			
		||||
  "Ok": {
 | 
			
		||||
    "body": [
 | 
			
		||||
      {
 | 
			
		||||
        "declaration": {
 | 
			
		||||
          "end": 220,
 | 
			
		||||
          "id": {
 | 
			
		||||
            "end": 6,
 | 
			
		||||
            "name": "box",
 | 
			
		||||
            "start": 3,
 | 
			
		||||
            "type": "Identifier"
 | 
			
		||||
          },
 | 
			
		||||
          "init": {
 | 
			
		||||
            "body": {
 | 
			
		||||
              "body": [
 | 
			
		||||
                {
 | 
			
		||||
                  "declaration": {
 | 
			
		||||
                    "end": 202,
 | 
			
		||||
                    "id": {
 | 
			
		||||
                      "end": 25,
 | 
			
		||||
                      "name": "myBox",
 | 
			
		||||
                      "start": 20,
 | 
			
		||||
                      "type": "Identifier"
 | 
			
		||||
                    },
 | 
			
		||||
                    "init": {
 | 
			
		||||
                      "body": [
 | 
			
		||||
                        {
 | 
			
		||||
                          "arguments": [
 | 
			
		||||
                            {
 | 
			
		||||
                              "end": 46,
 | 
			
		||||
                              "raw": "'XY'",
 | 
			
		||||
                              "start": 42,
 | 
			
		||||
                              "type": "Literal",
 | 
			
		||||
                              "type": "Literal",
 | 
			
		||||
                              "value": "XY"
 | 
			
		||||
                            }
 | 
			
		||||
                          ],
 | 
			
		||||
                          "callee": {
 | 
			
		||||
                            "end": 41,
 | 
			
		||||
                            "name": "startSketchOn",
 | 
			
		||||
                            "start": 28,
 | 
			
		||||
                            "type": "Identifier"
 | 
			
		||||
                          },
 | 
			
		||||
                          "end": 47,
 | 
			
		||||
                          "start": 28,
 | 
			
		||||
                          "type": "CallExpression",
 | 
			
		||||
                          "type": "CallExpression"
 | 
			
		||||
                        },
 | 
			
		||||
                        {
 | 
			
		||||
                          "arguments": [
 | 
			
		||||
                            {
 | 
			
		||||
                              "elements": [
 | 
			
		||||
                                {
 | 
			
		||||
                                  "end": 72,
 | 
			
		||||
                                  "raw": "0",
 | 
			
		||||
                                  "start": 71,
 | 
			
		||||
                                  "type": "Literal",
 | 
			
		||||
                                  "type": "Literal",
 | 
			
		||||
                                  "value": {
 | 
			
		||||
                                    "value": 0.0,
 | 
			
		||||
                                    "suffix": "None"
 | 
			
		||||
                                  }
 | 
			
		||||
                                },
 | 
			
		||||
                                {
 | 
			
		||||
                                  "end": 75,
 | 
			
		||||
                                  "raw": "0",
 | 
			
		||||
                                  "start": 74,
 | 
			
		||||
                                  "type": "Literal",
 | 
			
		||||
                                  "type": "Literal",
 | 
			
		||||
                                  "value": {
 | 
			
		||||
                                    "value": 0.0,
 | 
			
		||||
                                    "suffix": "None"
 | 
			
		||||
                                  }
 | 
			
		||||
                                }
 | 
			
		||||
                              ],
 | 
			
		||||
                              "end": 76,
 | 
			
		||||
                              "start": 70,
 | 
			
		||||
                              "type": "ArrayExpression",
 | 
			
		||||
                              "type": "ArrayExpression"
 | 
			
		||||
                            },
 | 
			
		||||
                            {
 | 
			
		||||
                              "end": 79,
 | 
			
		||||
                              "start": 78,
 | 
			
		||||
                              "type": "PipeSubstitution",
 | 
			
		||||
                              "type": "PipeSubstitution"
 | 
			
		||||
                            }
 | 
			
		||||
                          ],
 | 
			
		||||
                          "callee": {
 | 
			
		||||
                            "end": 69,
 | 
			
		||||
                            "name": "startProfileAt",
 | 
			
		||||
                            "start": 55,
 | 
			
		||||
                            "type": "Identifier"
 | 
			
		||||
                          },
 | 
			
		||||
                          "end": 80,
 | 
			
		||||
                          "start": 55,
 | 
			
		||||
                          "type": "CallExpression",
 | 
			
		||||
                          "type": "CallExpression"
 | 
			
		||||
                        },
 | 
			
		||||
                        {
 | 
			
		||||
                          "arguments": [
 | 
			
		||||
                            {
 | 
			
		||||
                              "type": "LabeledArg",
 | 
			
		||||
                              "label": {
 | 
			
		||||
                                "type": "Identifier",
 | 
			
		||||
                                "name": "end"
 | 
			
		||||
                              },
 | 
			
		||||
                              "arg": {
 | 
			
		||||
                                "elements": [
 | 
			
		||||
                                  {
 | 
			
		||||
                                    "end": 101,
 | 
			
		||||
                                    "raw": "0",
 | 
			
		||||
                                    "start": 100,
 | 
			
		||||
                                    "type": "Literal",
 | 
			
		||||
                                    "type": "Literal",
 | 
			
		||||
                                    "value": {
 | 
			
		||||
                                      "value": 0.0,
 | 
			
		||||
                                      "suffix": "None"
 | 
			
		||||
                                    }
 | 
			
		||||
                                  },
 | 
			
		||||
                                  {
 | 
			
		||||
                                    "end": 104,
 | 
			
		||||
                                    "name": "l",
 | 
			
		||||
                                    "start": 103,
 | 
			
		||||
                                    "type": "Identifier",
 | 
			
		||||
                                    "type": "Identifier"
 | 
			
		||||
                                  }
 | 
			
		||||
                                ],
 | 
			
		||||
                                "end": 105,
 | 
			
		||||
                                "start": 99,
 | 
			
		||||
                                "type": "ArrayExpression",
 | 
			
		||||
                                "type": "ArrayExpression"
 | 
			
		||||
                              }
 | 
			
		||||
                            }
 | 
			
		||||
                          ],
 | 
			
		||||
                          "callee": {
 | 
			
		||||
                            "end": 92,
 | 
			
		||||
                            "name": "line",
 | 
			
		||||
                            "start": 88,
 | 
			
		||||
                            "type": "Identifier"
 | 
			
		||||
                          },
 | 
			
		||||
                          "end": 106,
 | 
			
		||||
                          "start": 88,
 | 
			
		||||
                          "type": "CallExpressionKw",
 | 
			
		||||
                          "type": "CallExpressionKw",
 | 
			
		||||
                          "unlabeled": null
 | 
			
		||||
                        },
 | 
			
		||||
                        {
 | 
			
		||||
                          "arguments": [
 | 
			
		||||
                            {
 | 
			
		||||
                              "type": "LabeledArg",
 | 
			
		||||
                              "label": {
 | 
			
		||||
                                "type": "Identifier",
 | 
			
		||||
                                "name": "end"
 | 
			
		||||
                              },
 | 
			
		||||
                              "arg": {
 | 
			
		||||
                                "elements": [
 | 
			
		||||
                                  {
 | 
			
		||||
                                    "end": 127,
 | 
			
		||||
                                    "name": "w",
 | 
			
		||||
                                    "start": 126,
 | 
			
		||||
                                    "type": "Identifier",
 | 
			
		||||
                                    "type": "Identifier"
 | 
			
		||||
                                  },
 | 
			
		||||
                                  {
 | 
			
		||||
                                    "end": 130,
 | 
			
		||||
                                    "raw": "0",
 | 
			
		||||
                                    "start": 129,
 | 
			
		||||
                                    "type": "Literal",
 | 
			
		||||
                                    "type": "Literal",
 | 
			
		||||
                                    "value": {
 | 
			
		||||
                                      "value": 0.0,
 | 
			
		||||
                                      "suffix": "None"
 | 
			
		||||
                                    }
 | 
			
		||||
                                  }
 | 
			
		||||
                                ],
 | 
			
		||||
                                "end": 131,
 | 
			
		||||
                                "start": 125,
 | 
			
		||||
                                "type": "ArrayExpression",
 | 
			
		||||
                                "type": "ArrayExpression"
 | 
			
		||||
                              }
 | 
			
		||||
                            }
 | 
			
		||||
                          ],
 | 
			
		||||
                          "callee": {
 | 
			
		||||
                            "end": 118,
 | 
			
		||||
                            "name": "line",
 | 
			
		||||
                            "start": 114,
 | 
			
		||||
                            "type": "Identifier"
 | 
			
		||||
                          },
 | 
			
		||||
                          "end": 132,
 | 
			
		||||
                          "start": 114,
 | 
			
		||||
                          "type": "CallExpressionKw",
 | 
			
		||||
                          "type": "CallExpressionKw",
 | 
			
		||||
                          "unlabeled": null
 | 
			
		||||
                        },
 | 
			
		||||
                        {
 | 
			
		||||
                          "arguments": [
 | 
			
		||||
                            {
 | 
			
		||||
                              "type": "LabeledArg",
 | 
			
		||||
                              "label": {
 | 
			
		||||
                                "type": "Identifier",
 | 
			
		||||
                                "name": "end"
 | 
			
		||||
                              },
 | 
			
		||||
                              "arg": {
 | 
			
		||||
                                "elements": [
 | 
			
		||||
                                  {
 | 
			
		||||
                                    "end": 153,
 | 
			
		||||
                                    "raw": "0",
 | 
			
		||||
                                    "start": 152,
 | 
			
		||||
                                    "type": "Literal",
 | 
			
		||||
                                    "type": "Literal",
 | 
			
		||||
                                    "value": {
 | 
			
		||||
                                      "value": 0.0,
 | 
			
		||||
                                      "suffix": "None"
 | 
			
		||||
                                    }
 | 
			
		||||
                                  },
 | 
			
		||||
                                  {
 | 
			
		||||
                                    "argument": {
 | 
			
		||||
                                      "end": 157,
 | 
			
		||||
                                      "name": "l",
 | 
			
		||||
                                      "start": 156,
 | 
			
		||||
                                      "type": "Identifier",
 | 
			
		||||
                                      "type": "Identifier"
 | 
			
		||||
                                    },
 | 
			
		||||
                                    "end": 157,
 | 
			
		||||
                                    "operator": "-",
 | 
			
		||||
                                    "start": 155,
 | 
			
		||||
                                    "type": "UnaryExpression",
 | 
			
		||||
                                    "type": "UnaryExpression"
 | 
			
		||||
                                  }
 | 
			
		||||
                                ],
 | 
			
		||||
                                "end": 158,
 | 
			
		||||
                                "start": 151,
 | 
			
		||||
                                "type": "ArrayExpression",
 | 
			
		||||
                                "type": "ArrayExpression"
 | 
			
		||||
                              }
 | 
			
		||||
                            }
 | 
			
		||||
                          ],
 | 
			
		||||
                          "callee": {
 | 
			
		||||
                            "end": 144,
 | 
			
		||||
                            "name": "line",
 | 
			
		||||
                            "start": 140,
 | 
			
		||||
                            "type": "Identifier"
 | 
			
		||||
                          },
 | 
			
		||||
                          "end": 159,
 | 
			
		||||
                          "start": 140,
 | 
			
		||||
                          "type": "CallExpressionKw",
 | 
			
		||||
                          "type": "CallExpressionKw",
 | 
			
		||||
                          "unlabeled": null
 | 
			
		||||
                        },
 | 
			
		||||
                        {
 | 
			
		||||
                          "arguments": [
 | 
			
		||||
                            {
 | 
			
		||||
                              "end": 174,
 | 
			
		||||
                              "start": 173,
 | 
			
		||||
                              "type": "PipeSubstitution",
 | 
			
		||||
                              "type": "PipeSubstitution"
 | 
			
		||||
                            }
 | 
			
		||||
                          ],
 | 
			
		||||
                          "callee": {
 | 
			
		||||
                            "end": 172,
 | 
			
		||||
                            "name": "close",
 | 
			
		||||
                            "start": 167,
 | 
			
		||||
                            "type": "Identifier"
 | 
			
		||||
                          },
 | 
			
		||||
                          "end": 175,
 | 
			
		||||
                          "start": 167,
 | 
			
		||||
                          "type": "CallExpression",
 | 
			
		||||
                          "type": "CallExpression"
 | 
			
		||||
                        },
 | 
			
		||||
                        {
 | 
			
		||||
                          "arguments": [
 | 
			
		||||
                            {
 | 
			
		||||
                              "type": "LabeledArg",
 | 
			
		||||
                              "label": {
 | 
			
		||||
                                "type": "Identifier",
 | 
			
		||||
                                "name": "length"
 | 
			
		||||
                              },
 | 
			
		||||
                              "arg": {
 | 
			
		||||
                                "end": 201,
 | 
			
		||||
                                "name": "h",
 | 
			
		||||
                                "start": 200,
 | 
			
		||||
                                "type": "Identifier",
 | 
			
		||||
                                "type": "Identifier"
 | 
			
		||||
                              }
 | 
			
		||||
                            }
 | 
			
		||||
                          ],
 | 
			
		||||
                          "callee": {
 | 
			
		||||
                            "end": 190,
 | 
			
		||||
                            "name": "extrude",
 | 
			
		||||
                            "start": 183,
 | 
			
		||||
                            "type": "Identifier"
 | 
			
		||||
                          },
 | 
			
		||||
                          "end": 202,
 | 
			
		||||
                          "start": 183,
 | 
			
		||||
                          "type": "CallExpressionKw",
 | 
			
		||||
                          "type": "CallExpressionKw",
 | 
			
		||||
                          "unlabeled": null
 | 
			
		||||
                        }
 | 
			
		||||
                      ],
 | 
			
		||||
                      "end": 202,
 | 
			
		||||
                      "start": 28,
 | 
			
		||||
                      "type": "PipeExpression",
 | 
			
		||||
                      "type": "PipeExpression"
 | 
			
		||||
                    },
 | 
			
		||||
                    "start": 20,
 | 
			
		||||
                    "type": "VariableDeclarator"
 | 
			
		||||
                  },
 | 
			
		||||
                  "end": 202,
 | 
			
		||||
                  "kind": "const",
 | 
			
		||||
                  "start": 20,
 | 
			
		||||
                  "type": "VariableDeclaration",
 | 
			
		||||
                  "type": "VariableDeclaration"
 | 
			
		||||
                },
 | 
			
		||||
                {
 | 
			
		||||
                  "argument": {
 | 
			
		||||
                    "end": 218,
 | 
			
		||||
                    "name": "myBox",
 | 
			
		||||
                    "start": 213,
 | 
			
		||||
                    "type": "Identifier",
 | 
			
		||||
                    "type": "Identifier"
 | 
			
		||||
                  },
 | 
			
		||||
                  "end": 218,
 | 
			
		||||
                  "start": 206,
 | 
			
		||||
                  "type": "ReturnStatement",
 | 
			
		||||
                  "type": "ReturnStatement"
 | 
			
		||||
                }
 | 
			
		||||
              ],
 | 
			
		||||
              "end": 220,
 | 
			
		||||
              "nonCodeMeta": {
 | 
			
		||||
                "nonCodeNodes": {
 | 
			
		||||
                  "0": [
 | 
			
		||||
                    {
 | 
			
		||||
                      "end": 206,
 | 
			
		||||
                      "start": 202,
 | 
			
		||||
                      "type": "NonCodeNode",
 | 
			
		||||
                      "value": {
 | 
			
		||||
                        "type": "newLine"
 | 
			
		||||
                      }
 | 
			
		||||
                    }
 | 
			
		||||
                  ]
 | 
			
		||||
                },
 | 
			
		||||
                "startNodes": []
 | 
			
		||||
              },
 | 
			
		||||
              "start": 16
 | 
			
		||||
            },
 | 
			
		||||
            "end": 220,
 | 
			
		||||
            "params": [
 | 
			
		||||
              {
 | 
			
		||||
                "type": "Parameter",
 | 
			
		||||
                "identifier": {
 | 
			
		||||
                  "end": 8,
 | 
			
		||||
                  "name": "h",
 | 
			
		||||
                  "start": 7,
 | 
			
		||||
                  "type": "Identifier"
 | 
			
		||||
                }
 | 
			
		||||
              },
 | 
			
		||||
              {
 | 
			
		||||
                "type": "Parameter",
 | 
			
		||||
                "identifier": {
 | 
			
		||||
                  "end": 11,
 | 
			
		||||
                  "name": "l",
 | 
			
		||||
                  "start": 10,
 | 
			
		||||
                  "type": "Identifier"
 | 
			
		||||
                }
 | 
			
		||||
              },
 | 
			
		||||
              {
 | 
			
		||||
                "type": "Parameter",
 | 
			
		||||
                "identifier": {
 | 
			
		||||
                  "end": 14,
 | 
			
		||||
                  "name": "w",
 | 
			
		||||
                  "start": 13,
 | 
			
		||||
                  "type": "Identifier"
 | 
			
		||||
                }
 | 
			
		||||
              }
 | 
			
		||||
            ],
 | 
			
		||||
            "start": 6,
 | 
			
		||||
            "type": "FunctionExpression",
 | 
			
		||||
            "type": "FunctionExpression"
 | 
			
		||||
          },
 | 
			
		||||
          "start": 3,
 | 
			
		||||
          "type": "VariableDeclarator"
 | 
			
		||||
        },
 | 
			
		||||
        "end": 220,
 | 
			
		||||
        "kind": "fn",
 | 
			
		||||
        "start": 0,
 | 
			
		||||
        "type": "VariableDeclaration",
 | 
			
		||||
        "type": "VariableDeclaration"
 | 
			
		||||
      },
 | 
			
		||||
      {
 | 
			
		||||
        "declaration": {
 | 
			
		||||
          "end": 243,
 | 
			
		||||
          "id": {
 | 
			
		||||
            "end": 227,
 | 
			
		||||
            "name": "fnBox",
 | 
			
		||||
            "start": 222,
 | 
			
		||||
            "type": "Identifier"
 | 
			
		||||
          },
 | 
			
		||||
          "init": {
 | 
			
		||||
            "arguments": [
 | 
			
		||||
              {
 | 
			
		||||
                "end": 235,
 | 
			
		||||
                "raw": "3",
 | 
			
		||||
                "start": 234,
 | 
			
		||||
                "type": "Literal",
 | 
			
		||||
                "type": "Literal",
 | 
			
		||||
                "value": {
 | 
			
		||||
                  "value": 3.0,
 | 
			
		||||
                  "suffix": "None"
 | 
			
		||||
                }
 | 
			
		||||
              },
 | 
			
		||||
              {
 | 
			
		||||
                "end": 238,
 | 
			
		||||
                "raw": "6",
 | 
			
		||||
                "start": 237,
 | 
			
		||||
                "type": "Literal",
 | 
			
		||||
                "type": "Literal",
 | 
			
		||||
                "value": {
 | 
			
		||||
                  "value": 6.0,
 | 
			
		||||
                  "suffix": "None"
 | 
			
		||||
                }
 | 
			
		||||
              },
 | 
			
		||||
              {
 | 
			
		||||
                "end": 242,
 | 
			
		||||
                "raw": "10",
 | 
			
		||||
                "start": 240,
 | 
			
		||||
                "type": "Literal",
 | 
			
		||||
                "type": "Literal",
 | 
			
		||||
                "value": {
 | 
			
		||||
                  "value": 10.0,
 | 
			
		||||
                  "suffix": "None"
 | 
			
		||||
                }
 | 
			
		||||
              }
 | 
			
		||||
            ],
 | 
			
		||||
            "callee": {
 | 
			
		||||
              "end": 233,
 | 
			
		||||
              "name": "box",
 | 
			
		||||
              "start": 230,
 | 
			
		||||
              "type": "Identifier"
 | 
			
		||||
            },
 | 
			
		||||
            "end": 243,
 | 
			
		||||
            "start": 230,
 | 
			
		||||
            "type": "CallExpression",
 | 
			
		||||
            "type": "CallExpression"
 | 
			
		||||
          },
 | 
			
		||||
          "start": 222,
 | 
			
		||||
          "type": "VariableDeclarator"
 | 
			
		||||
        },
 | 
			
		||||
        "end": 243,
 | 
			
		||||
        "kind": "const",
 | 
			
		||||
        "start": 222,
 | 
			
		||||
        "type": "VariableDeclaration",
 | 
			
		||||
        "type": "VariableDeclaration"
 | 
			
		||||
      }
 | 
			
		||||
    ],
 | 
			
		||||
    "end": 244,
 | 
			
		||||
    "nonCodeMeta": {
 | 
			
		||||
      "nonCodeNodes": {
 | 
			
		||||
        "0": [
 | 
			
		||||
          {
 | 
			
		||||
            "end": 222,
 | 
			
		||||
            "start": 220,
 | 
			
		||||
            "type": "NonCodeNode",
 | 
			
		||||
            "value": {
 | 
			
		||||
              "type": "newLine"
 | 
			
		||||
            }
 | 
			
		||||
          }
 | 
			
		||||
        ]
 | 
			
		||||
      },
 | 
			
		||||
      "startNodes": []
 | 
			
		||||
    },
 | 
			
		||||
    "start": 0
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user