425 lines
		
	
	
		
			12 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			425 lines
		
	
	
		
			12 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
---
 | 
						|
source: kcl-lib/src/simulation_tests.rs
 | 
						|
description: Result of parsing helix_simple.kcl
 | 
						|
---
 | 
						|
{
 | 
						|
  "Ok": {
 | 
						|
    "body": [
 | 
						|
      {
 | 
						|
        "commentStart": 0,
 | 
						|
        "declaration": {
 | 
						|
          "commentStart": 0,
 | 
						|
          "end": 0,
 | 
						|
          "id": {
 | 
						|
            "commentStart": 0,
 | 
						|
            "end": 0,
 | 
						|
            "name": "helper001",
 | 
						|
            "start": 0,
 | 
						|
            "type": "Identifier"
 | 
						|
          },
 | 
						|
          "init": {
 | 
						|
            "body": [
 | 
						|
              {
 | 
						|
                "arguments": [
 | 
						|
                  {
 | 
						|
                    "commentStart": 0,
 | 
						|
                    "end": 0,
 | 
						|
                    "raw": "'XZ'",
 | 
						|
                    "start": 0,
 | 
						|
                    "type": "Literal",
 | 
						|
                    "type": "Literal",
 | 
						|
                    "value": "XZ"
 | 
						|
                  }
 | 
						|
                ],
 | 
						|
                "callee": {
 | 
						|
                  "abs_path": false,
 | 
						|
                  "commentStart": 0,
 | 
						|
                  "end": 0,
 | 
						|
                  "name": {
 | 
						|
                    "commentStart": 0,
 | 
						|
                    "end": 0,
 | 
						|
                    "name": "startSketchOn",
 | 
						|
                    "start": 0,
 | 
						|
                    "type": "Identifier"
 | 
						|
                  },
 | 
						|
                  "path": [],
 | 
						|
                  "start": 0,
 | 
						|
                  "type": "Name"
 | 
						|
                },
 | 
						|
                "commentStart": 0,
 | 
						|
                "end": 0,
 | 
						|
                "start": 0,
 | 
						|
                "type": "CallExpression",
 | 
						|
                "type": "CallExpression"
 | 
						|
              },
 | 
						|
              {
 | 
						|
                "arguments": [
 | 
						|
                  {
 | 
						|
                    "commentStart": 0,
 | 
						|
                    "elements": [
 | 
						|
                      {
 | 
						|
                        "commentStart": 0,
 | 
						|
                        "end": 0,
 | 
						|
                        "raw": "0",
 | 
						|
                        "start": 0,
 | 
						|
                        "type": "Literal",
 | 
						|
                        "type": "Literal",
 | 
						|
                        "value": {
 | 
						|
                          "value": 0.0,
 | 
						|
                          "suffix": "None"
 | 
						|
                        }
 | 
						|
                      },
 | 
						|
                      {
 | 
						|
                        "commentStart": 0,
 | 
						|
                        "end": 0,
 | 
						|
                        "raw": "0",
 | 
						|
                        "start": 0,
 | 
						|
                        "type": "Literal",
 | 
						|
                        "type": "Literal",
 | 
						|
                        "value": {
 | 
						|
                          "value": 0.0,
 | 
						|
                          "suffix": "None"
 | 
						|
                        }
 | 
						|
                      }
 | 
						|
                    ],
 | 
						|
                    "end": 0,
 | 
						|
                    "start": 0,
 | 
						|
                    "type": "ArrayExpression",
 | 
						|
                    "type": "ArrayExpression"
 | 
						|
                  },
 | 
						|
                  {
 | 
						|
                    "commentStart": 0,
 | 
						|
                    "end": 0,
 | 
						|
                    "start": 0,
 | 
						|
                    "type": "PipeSubstitution",
 | 
						|
                    "type": "PipeSubstitution"
 | 
						|
                  }
 | 
						|
                ],
 | 
						|
                "callee": {
 | 
						|
                  "abs_path": false,
 | 
						|
                  "commentStart": 0,
 | 
						|
                  "end": 0,
 | 
						|
                  "name": {
 | 
						|
                    "commentStart": 0,
 | 
						|
                    "end": 0,
 | 
						|
                    "name": "startProfileAt",
 | 
						|
                    "start": 0,
 | 
						|
                    "type": "Identifier"
 | 
						|
                  },
 | 
						|
                  "path": [],
 | 
						|
                  "start": 0,
 | 
						|
                  "type": "Name"
 | 
						|
                },
 | 
						|
                "commentStart": 0,
 | 
						|
                "end": 0,
 | 
						|
                "start": 0,
 | 
						|
                "type": "CallExpression",
 | 
						|
                "type": "CallExpression"
 | 
						|
              },
 | 
						|
              {
 | 
						|
                "arguments": [
 | 
						|
                  {
 | 
						|
                    "type": "LabeledArg",
 | 
						|
                    "label": {
 | 
						|
                      "commentStart": 0,
 | 
						|
                      "end": 0,
 | 
						|
                      "name": "end",
 | 
						|
                      "start": 0,
 | 
						|
                      "type": "Identifier"
 | 
						|
                    },
 | 
						|
                    "arg": {
 | 
						|
                      "commentStart": 0,
 | 
						|
                      "elements": [
 | 
						|
                        {
 | 
						|
                          "commentStart": 0,
 | 
						|
                          "end": 0,
 | 
						|
                          "raw": "0",
 | 
						|
                          "start": 0,
 | 
						|
                          "type": "Literal",
 | 
						|
                          "type": "Literal",
 | 
						|
                          "value": {
 | 
						|
                            "value": 0.0,
 | 
						|
                            "suffix": "None"
 | 
						|
                          }
 | 
						|
                        },
 | 
						|
                        {
 | 
						|
                          "commentStart": 0,
 | 
						|
                          "end": 0,
 | 
						|
                          "raw": "10",
 | 
						|
                          "start": 0,
 | 
						|
                          "type": "Literal",
 | 
						|
                          "type": "Literal",
 | 
						|
                          "value": {
 | 
						|
                            "value": 10.0,
 | 
						|
                            "suffix": "None"
 | 
						|
                          }
 | 
						|
                        }
 | 
						|
                      ],
 | 
						|
                      "end": 0,
 | 
						|
                      "start": 0,
 | 
						|
                      "type": "ArrayExpression",
 | 
						|
                      "type": "ArrayExpression"
 | 
						|
                    }
 | 
						|
                  },
 | 
						|
                  {
 | 
						|
                    "type": "LabeledArg",
 | 
						|
                    "label": {
 | 
						|
                      "commentStart": 0,
 | 
						|
                      "end": 0,
 | 
						|
                      "name": "tag",
 | 
						|
                      "start": 0,
 | 
						|
                      "type": "Identifier"
 | 
						|
                    },
 | 
						|
                    "arg": {
 | 
						|
                      "commentStart": 0,
 | 
						|
                      "end": 0,
 | 
						|
                      "start": 0,
 | 
						|
                      "type": "TagDeclarator",
 | 
						|
                      "type": "TagDeclarator",
 | 
						|
                      "value": "edge001"
 | 
						|
                    }
 | 
						|
                  }
 | 
						|
                ],
 | 
						|
                "callee": {
 | 
						|
                  "abs_path": false,
 | 
						|
                  "commentStart": 0,
 | 
						|
                  "end": 0,
 | 
						|
                  "name": {
 | 
						|
                    "commentStart": 0,
 | 
						|
                    "end": 0,
 | 
						|
                    "name": "line",
 | 
						|
                    "start": 0,
 | 
						|
                    "type": "Identifier"
 | 
						|
                  },
 | 
						|
                  "path": [],
 | 
						|
                  "start": 0,
 | 
						|
                  "type": "Name"
 | 
						|
                },
 | 
						|
                "commentStart": 0,
 | 
						|
                "end": 0,
 | 
						|
                "start": 0,
 | 
						|
                "type": "CallExpressionKw",
 | 
						|
                "type": "CallExpressionKw",
 | 
						|
                "unlabeled": null
 | 
						|
              }
 | 
						|
            ],
 | 
						|
            "commentStart": 0,
 | 
						|
            "end": 0,
 | 
						|
            "start": 0,
 | 
						|
            "type": "PipeExpression",
 | 
						|
            "type": "PipeExpression"
 | 
						|
          },
 | 
						|
          "start": 0,
 | 
						|
          "type": "VariableDeclarator"
 | 
						|
        },
 | 
						|
        "end": 0,
 | 
						|
        "kind": "const",
 | 
						|
        "preComments": [
 | 
						|
          "// Create a helix around an edge."
 | 
						|
        ],
 | 
						|
        "start": 0,
 | 
						|
        "type": "VariableDeclaration",
 | 
						|
        "type": "VariableDeclaration"
 | 
						|
      },
 | 
						|
      {
 | 
						|
        "commentStart": 0,
 | 
						|
        "declaration": {
 | 
						|
          "commentStart": 0,
 | 
						|
          "end": 0,
 | 
						|
          "id": {
 | 
						|
            "commentStart": 0,
 | 
						|
            "end": 0,
 | 
						|
            "name": "helixPath",
 | 
						|
            "start": 0,
 | 
						|
            "type": "Identifier"
 | 
						|
          },
 | 
						|
          "init": {
 | 
						|
            "arguments": [
 | 
						|
              {
 | 
						|
                "type": "LabeledArg",
 | 
						|
                "label": {
 | 
						|
                  "commentStart": 0,
 | 
						|
                  "end": 0,
 | 
						|
                  "name": "angleStart",
 | 
						|
                  "start": 0,
 | 
						|
                  "type": "Identifier"
 | 
						|
                },
 | 
						|
                "arg": {
 | 
						|
                  "commentStart": 0,
 | 
						|
                  "end": 0,
 | 
						|
                  "raw": "0",
 | 
						|
                  "start": 0,
 | 
						|
                  "type": "Literal",
 | 
						|
                  "type": "Literal",
 | 
						|
                  "value": {
 | 
						|
                    "value": 0.0,
 | 
						|
                    "suffix": "None"
 | 
						|
                  }
 | 
						|
                }
 | 
						|
              },
 | 
						|
              {
 | 
						|
                "type": "LabeledArg",
 | 
						|
                "label": {
 | 
						|
                  "commentStart": 0,
 | 
						|
                  "end": 0,
 | 
						|
                  "name": "ccw",
 | 
						|
                  "start": 0,
 | 
						|
                  "type": "Identifier"
 | 
						|
                },
 | 
						|
                "arg": {
 | 
						|
                  "commentStart": 0,
 | 
						|
                  "end": 0,
 | 
						|
                  "raw": "true",
 | 
						|
                  "start": 0,
 | 
						|
                  "type": "Literal",
 | 
						|
                  "type": "Literal",
 | 
						|
                  "value": true
 | 
						|
                }
 | 
						|
              },
 | 
						|
              {
 | 
						|
                "type": "LabeledArg",
 | 
						|
                "label": {
 | 
						|
                  "commentStart": 0,
 | 
						|
                  "end": 0,
 | 
						|
                  "name": "revolutions",
 | 
						|
                  "start": 0,
 | 
						|
                  "type": "Identifier"
 | 
						|
                },
 | 
						|
                "arg": {
 | 
						|
                  "commentStart": 0,
 | 
						|
                  "end": 0,
 | 
						|
                  "raw": "5",
 | 
						|
                  "start": 0,
 | 
						|
                  "type": "Literal",
 | 
						|
                  "type": "Literal",
 | 
						|
                  "value": {
 | 
						|
                    "value": 5.0,
 | 
						|
                    "suffix": "None"
 | 
						|
                  }
 | 
						|
                }
 | 
						|
              },
 | 
						|
              {
 | 
						|
                "type": "LabeledArg",
 | 
						|
                "label": {
 | 
						|
                  "commentStart": 0,
 | 
						|
                  "end": 0,
 | 
						|
                  "name": "length",
 | 
						|
                  "start": 0,
 | 
						|
                  "type": "Identifier"
 | 
						|
                },
 | 
						|
                "arg": {
 | 
						|
                  "commentStart": 0,
 | 
						|
                  "end": 0,
 | 
						|
                  "raw": "10",
 | 
						|
                  "start": 0,
 | 
						|
                  "type": "Literal",
 | 
						|
                  "type": "Literal",
 | 
						|
                  "value": {
 | 
						|
                    "value": 10.0,
 | 
						|
                    "suffix": "None"
 | 
						|
                  }
 | 
						|
                }
 | 
						|
              },
 | 
						|
              {
 | 
						|
                "type": "LabeledArg",
 | 
						|
                "label": {
 | 
						|
                  "commentStart": 0,
 | 
						|
                  "end": 0,
 | 
						|
                  "name": "radius",
 | 
						|
                  "start": 0,
 | 
						|
                  "type": "Identifier"
 | 
						|
                },
 | 
						|
                "arg": {
 | 
						|
                  "commentStart": 0,
 | 
						|
                  "end": 0,
 | 
						|
                  "raw": "5",
 | 
						|
                  "start": 0,
 | 
						|
                  "type": "Literal",
 | 
						|
                  "type": "Literal",
 | 
						|
                  "value": {
 | 
						|
                    "value": 5.0,
 | 
						|
                    "suffix": "None"
 | 
						|
                  }
 | 
						|
                }
 | 
						|
              },
 | 
						|
              {
 | 
						|
                "type": "LabeledArg",
 | 
						|
                "label": {
 | 
						|
                  "commentStart": 0,
 | 
						|
                  "end": 0,
 | 
						|
                  "name": "axis",
 | 
						|
                  "start": 0,
 | 
						|
                  "type": "Identifier"
 | 
						|
                },
 | 
						|
                "arg": {
 | 
						|
                  "abs_path": false,
 | 
						|
                  "commentStart": 0,
 | 
						|
                  "end": 0,
 | 
						|
                  "name": {
 | 
						|
                    "commentStart": 0,
 | 
						|
                    "end": 0,
 | 
						|
                    "name": "edge001",
 | 
						|
                    "start": 0,
 | 
						|
                    "type": "Identifier"
 | 
						|
                  },
 | 
						|
                  "path": [],
 | 
						|
                  "start": 0,
 | 
						|
                  "type": "Name",
 | 
						|
                  "type": "Name"
 | 
						|
                }
 | 
						|
              }
 | 
						|
            ],
 | 
						|
            "callee": {
 | 
						|
              "abs_path": false,
 | 
						|
              "commentStart": 0,
 | 
						|
              "end": 0,
 | 
						|
              "name": {
 | 
						|
                "commentStart": 0,
 | 
						|
                "end": 0,
 | 
						|
                "name": "helix",
 | 
						|
                "start": 0,
 | 
						|
                "type": "Identifier"
 | 
						|
              },
 | 
						|
              "path": [],
 | 
						|
              "start": 0,
 | 
						|
              "type": "Name"
 | 
						|
            },
 | 
						|
            "commentStart": 0,
 | 
						|
            "end": 0,
 | 
						|
            "start": 0,
 | 
						|
            "type": "CallExpressionKw",
 | 
						|
            "type": "CallExpressionKw",
 | 
						|
            "unlabeled": null
 | 
						|
          },
 | 
						|
          "start": 0,
 | 
						|
          "type": "VariableDeclarator"
 | 
						|
        },
 | 
						|
        "end": 0,
 | 
						|
        "kind": "const",
 | 
						|
        "start": 0,
 | 
						|
        "type": "VariableDeclaration",
 | 
						|
        "type": "VariableDeclaration"
 | 
						|
      }
 | 
						|
    ],
 | 
						|
    "commentStart": 0,
 | 
						|
    "end": 0,
 | 
						|
    "nonCodeMeta": {
 | 
						|
      "nonCodeNodes": {
 | 
						|
        "0": [
 | 
						|
          {
 | 
						|
            "commentStart": 0,
 | 
						|
            "end": 0,
 | 
						|
            "start": 0,
 | 
						|
            "type": "NonCodeNode",
 | 
						|
            "value": {
 | 
						|
              "type": "newLine"
 | 
						|
            }
 | 
						|
          }
 | 
						|
        ]
 | 
						|
      },
 | 
						|
      "startNodes": []
 | 
						|
    },
 | 
						|
    "start": 0
 | 
						|
  }
 | 
						|
}
 |