---
source: kcl/src/simulation_tests.rs
description: Result of parsing pipe_substitution_inside_function_called_from_pipeline.kcl
---
{
  "Ok": {
    "body": [
      {
        "declaration": {
          "end": 89,
          "id": {
            "end": 65,
            "name": "f",
            "start": 64,
            "type": "Identifier"
          },
          "init": {
            "body": {
              "body": [
                {
                  "argument": {
                    "end": 87,
                    "start": 86,
                    "type": "PipeSubstitution",
                    "type": "PipeSubstitution"
                  },
                  "end": 87,
                  "start": 79,
                  "type": "ReturnStatement",
                  "type": "ReturnStatement"
                }
              ],
              "end": 89,
              "start": 75
            },
            "end": 89,
            "params": [
              {
                "type": "Parameter",
                "identifier": {
                  "end": 73,
                  "name": "ignored",
                  "start": 66,
                  "type": "Identifier"
                }
              }
            ],
            "start": 65,
            "type": "FunctionExpression",
            "type": "FunctionExpression"
          },
          "start": 64,
          "type": "VariableDeclarator"
        },
        "end": 89,
        "kind": "fn",
        "start": 61,
        "type": "VariableDeclaration",
        "type": "VariableDeclaration"
      },
      {
        "declaration": {
          "end": 111,
          "id": {
            "end": 97,
            "name": "answer",
            "start": 91,
            "type": "Identifier"
          },
          "init": {
            "body": [
              {
                "end": 101,
                "start": 100,
                "type": "PipeSubstitution",
                "type": "PipeSubstitution"
              },
              {
                "arguments": [
                  {
                    "end": 110,
                    "start": 109,
                    "type": "PipeSubstitution",
                    "type": "PipeSubstitution"
                  }
                ],
                "callee": {
                  "end": 108,
                  "name": "f",
                  "start": 107,
                  "type": "Identifier"
                },
                "end": 111,
                "start": 107,
                "type": "CallExpression",
                "type": "CallExpression"
              }
            ],
            "end": 111,
            "start": 100,
            "type": "PipeExpression",
            "type": "PipeExpression"
          },
          "start": 91,
          "type": "VariableDeclarator"
        },
        "end": 111,
        "kind": "const",
        "start": 91,
        "type": "VariableDeclaration",
        "type": "VariableDeclaration"
      }
    ],
    "end": 112,
    "nonCodeMeta": {
      "nonCodeNodes": {
        "0": [
          {
            "end": 91,
            "start": 89,
            "type": "NonCodeNode",
            "value": {
              "type": "newLine"
            }
          }
        ]
      },
      "startNodes": [
        {
          "end": 60,
          "start": 0,
          "type": "NonCodeNode",
          "value": {
            "type": "blockComment",
            "value": "Make sure pipe value doesn't leak into the function call.",
            "style": "line"
          }
        }
      ]
    },
    "start": 0
  }
}
