Users MUST use keyword call syntax now. Closes https://github.com/KittyCAD/modeling-app/issues/4600
		
			
				
	
	
		
			281 lines
		
	
	
		
			7.4 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			281 lines
		
	
	
		
			7.4 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
---
 | 
						|
source: kcl-lib/src/simulation_tests.rs
 | 
						|
description: Result of parsing kw_fn_with_defaults.kcl
 | 
						|
---
 | 
						|
{
 | 
						|
  "Ok": {
 | 
						|
    "body": [
 | 
						|
      {
 | 
						|
        "commentStart": 0,
 | 
						|
        "declaration": {
 | 
						|
          "commentStart": 0,
 | 
						|
          "end": 0,
 | 
						|
          "id": {
 | 
						|
            "commentStart": 0,
 | 
						|
            "end": 0,
 | 
						|
            "name": "increment",
 | 
						|
            "start": 0,
 | 
						|
            "type": "Identifier"
 | 
						|
          },
 | 
						|
          "init": {
 | 
						|
            "body": {
 | 
						|
              "body": [
 | 
						|
                {
 | 
						|
                  "argument": {
 | 
						|
                    "commentStart": 0,
 | 
						|
                    "end": 0,
 | 
						|
                    "left": {
 | 
						|
                      "abs_path": false,
 | 
						|
                      "commentStart": 0,
 | 
						|
                      "end": 0,
 | 
						|
                      "name": {
 | 
						|
                        "commentStart": 0,
 | 
						|
                        "end": 0,
 | 
						|
                        "name": "x",
 | 
						|
                        "start": 0,
 | 
						|
                        "type": "Identifier"
 | 
						|
                      },
 | 
						|
                      "path": [],
 | 
						|
                      "start": 0,
 | 
						|
                      "type": "Name",
 | 
						|
                      "type": "Name"
 | 
						|
                    },
 | 
						|
                    "operator": "+",
 | 
						|
                    "right": {
 | 
						|
                      "abs_path": false,
 | 
						|
                      "commentStart": 0,
 | 
						|
                      "end": 0,
 | 
						|
                      "name": {
 | 
						|
                        "commentStart": 0,
 | 
						|
                        "end": 0,
 | 
						|
                        "name": "by",
 | 
						|
                        "start": 0,
 | 
						|
                        "type": "Identifier"
 | 
						|
                      },
 | 
						|
                      "path": [],
 | 
						|
                      "start": 0,
 | 
						|
                      "type": "Name",
 | 
						|
                      "type": "Name"
 | 
						|
                    },
 | 
						|
                    "start": 0,
 | 
						|
                    "type": "BinaryExpression",
 | 
						|
                    "type": "BinaryExpression"
 | 
						|
                  },
 | 
						|
                  "commentStart": 0,
 | 
						|
                  "end": 0,
 | 
						|
                  "start": 0,
 | 
						|
                  "type": "ReturnStatement",
 | 
						|
                  "type": "ReturnStatement"
 | 
						|
                }
 | 
						|
              ],
 | 
						|
              "commentStart": 0,
 | 
						|
              "end": 0,
 | 
						|
              "start": 0
 | 
						|
            },
 | 
						|
            "commentStart": 0,
 | 
						|
            "end": 0,
 | 
						|
            "params": [
 | 
						|
              {
 | 
						|
                "type": "Parameter",
 | 
						|
                "identifier": {
 | 
						|
                  "commentStart": 0,
 | 
						|
                  "end": 0,
 | 
						|
                  "name": "x",
 | 
						|
                  "start": 0,
 | 
						|
                  "type": "Identifier"
 | 
						|
                },
 | 
						|
                "labeled": false
 | 
						|
              },
 | 
						|
              {
 | 
						|
                "type": "Parameter",
 | 
						|
                "identifier": {
 | 
						|
                  "commentStart": 0,
 | 
						|
                  "end": 0,
 | 
						|
                  "name": "by",
 | 
						|
                  "start": 0,
 | 
						|
                  "type": "Identifier"
 | 
						|
                },
 | 
						|
                "default_value": {
 | 
						|
                  "commentStart": 0,
 | 
						|
                  "end": 0,
 | 
						|
                  "raw": "1",
 | 
						|
                  "start": 0,
 | 
						|
                  "type": "Literal",
 | 
						|
                  "type": "Literal",
 | 
						|
                  "value": {
 | 
						|
                    "value": 1.0,
 | 
						|
                    "suffix": "None"
 | 
						|
                  }
 | 
						|
                }
 | 
						|
              }
 | 
						|
            ],
 | 
						|
            "start": 0,
 | 
						|
            "type": "FunctionExpression",
 | 
						|
            "type": "FunctionExpression"
 | 
						|
          },
 | 
						|
          "start": 0,
 | 
						|
          "type": "VariableDeclarator"
 | 
						|
        },
 | 
						|
        "end": 0,
 | 
						|
        "kind": "fn",
 | 
						|
        "start": 0,
 | 
						|
        "type": "VariableDeclaration",
 | 
						|
        "type": "VariableDeclaration"
 | 
						|
      },
 | 
						|
      {
 | 
						|
        "commentStart": 0,
 | 
						|
        "declaration": {
 | 
						|
          "commentStart": 0,
 | 
						|
          "end": 0,
 | 
						|
          "id": {
 | 
						|
            "commentStart": 0,
 | 
						|
            "end": 0,
 | 
						|
            "name": "two",
 | 
						|
            "start": 0,
 | 
						|
            "type": "Identifier"
 | 
						|
          },
 | 
						|
          "init": {
 | 
						|
            "callee": {
 | 
						|
              "abs_path": false,
 | 
						|
              "commentStart": 0,
 | 
						|
              "end": 0,
 | 
						|
              "name": {
 | 
						|
                "commentStart": 0,
 | 
						|
                "end": 0,
 | 
						|
                "name": "increment",
 | 
						|
                "start": 0,
 | 
						|
                "type": "Identifier"
 | 
						|
              },
 | 
						|
              "path": [],
 | 
						|
              "start": 0,
 | 
						|
              "type": "Name"
 | 
						|
            },
 | 
						|
            "commentStart": 0,
 | 
						|
            "end": 0,
 | 
						|
            "start": 0,
 | 
						|
            "type": "CallExpressionKw",
 | 
						|
            "type": "CallExpressionKw",
 | 
						|
            "unlabeled": {
 | 
						|
              "commentStart": 0,
 | 
						|
              "end": 0,
 | 
						|
              "raw": "1",
 | 
						|
              "start": 0,
 | 
						|
              "type": "Literal",
 | 
						|
              "type": "Literal",
 | 
						|
              "value": {
 | 
						|
                "value": 1.0,
 | 
						|
                "suffix": "None"
 | 
						|
              }
 | 
						|
            }
 | 
						|
          },
 | 
						|
          "start": 0,
 | 
						|
          "type": "VariableDeclarator"
 | 
						|
        },
 | 
						|
        "end": 0,
 | 
						|
        "kind": "const",
 | 
						|
        "start": 0,
 | 
						|
        "type": "VariableDeclaration",
 | 
						|
        "type": "VariableDeclaration"
 | 
						|
      },
 | 
						|
      {
 | 
						|
        "commentStart": 0,
 | 
						|
        "declaration": {
 | 
						|
          "commentStart": 0,
 | 
						|
          "end": 0,
 | 
						|
          "id": {
 | 
						|
            "commentStart": 0,
 | 
						|
            "end": 0,
 | 
						|
            "name": "twentyOne",
 | 
						|
            "start": 0,
 | 
						|
            "type": "Identifier"
 | 
						|
          },
 | 
						|
          "init": {
 | 
						|
            "arguments": [
 | 
						|
              {
 | 
						|
                "type": "LabeledArg",
 | 
						|
                "label": {
 | 
						|
                  "commentStart": 0,
 | 
						|
                  "end": 0,
 | 
						|
                  "name": "by",
 | 
						|
                  "start": 0,
 | 
						|
                  "type": "Identifier"
 | 
						|
                },
 | 
						|
                "arg": {
 | 
						|
                  "commentStart": 0,
 | 
						|
                  "end": 0,
 | 
						|
                  "raw": "20",
 | 
						|
                  "start": 0,
 | 
						|
                  "type": "Literal",
 | 
						|
                  "type": "Literal",
 | 
						|
                  "value": {
 | 
						|
                    "value": 20.0,
 | 
						|
                    "suffix": "None"
 | 
						|
                  }
 | 
						|
                }
 | 
						|
              }
 | 
						|
            ],
 | 
						|
            "callee": {
 | 
						|
              "abs_path": false,
 | 
						|
              "commentStart": 0,
 | 
						|
              "end": 0,
 | 
						|
              "name": {
 | 
						|
                "commentStart": 0,
 | 
						|
                "end": 0,
 | 
						|
                "name": "increment",
 | 
						|
                "start": 0,
 | 
						|
                "type": "Identifier"
 | 
						|
              },
 | 
						|
              "path": [],
 | 
						|
              "start": 0,
 | 
						|
              "type": "Name"
 | 
						|
            },
 | 
						|
            "commentStart": 0,
 | 
						|
            "end": 0,
 | 
						|
            "start": 0,
 | 
						|
            "type": "CallExpressionKw",
 | 
						|
            "type": "CallExpressionKw",
 | 
						|
            "unlabeled": {
 | 
						|
              "commentStart": 0,
 | 
						|
              "end": 0,
 | 
						|
              "raw": "1",
 | 
						|
              "start": 0,
 | 
						|
              "type": "Literal",
 | 
						|
              "type": "Literal",
 | 
						|
              "value": {
 | 
						|
                "value": 1.0,
 | 
						|
                "suffix": "None"
 | 
						|
              }
 | 
						|
            }
 | 
						|
          },
 | 
						|
          "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
 | 
						|
  }
 | 
						|
}
 |