Support comments on attributes (#5850)

Signed-off-by: Nick Cameron <nrc@ncameron.org>
This commit is contained in:
Nick Cameron
2025-03-20 16:23:20 +13:00
committed by GitHub
parent 79be72c5f0
commit 461a2c3ab2
319 changed files with 37650 additions and 4752 deletions

View File

@ -184,7 +184,6 @@ example = extrude(exampleSketch, length = 1)
```js ```js
// Color the result of a sweep. // Color the result of a sweep.
// Create a path for the sweep. // Create a path for the sweep.
sweepPath = startSketchOn('XZ') sweepPath = startSketchOn('XZ')
|> startProfileAt([0.05, 0.05], %) |> startProfileAt([0.05, 0.05], %)

View File

@ -52,7 +52,6 @@ fn sum(arr):
sumSoFar = add(sumSoFar, i) sumSoFar = add(sumSoFar, i)
return sumSoFar */ return sumSoFar */
// We use `assertEqual` to check that our `sum` function gives the // We use `assertEqual` to check that our `sum` function gives the
// expected result. It's good to check your work! // expected result. It's good to check your work!
assertEqual(sum([1, 2, 3]), 6, 0.00001, "1 + 2 + 3 summed is 6") assertEqual(sum([1, 2, 3]), 6, 0.00001, "1 + 2 + 3 summed is 6")
@ -114,7 +113,6 @@ fn decagon(radius):
fullDecagon = partialDecagon // it's now full fullDecagon = partialDecagon // it's now full
return fullDecagon */ return fullDecagon */
// Use the `decagon` function declared above, to sketch a decagon with radius 5. // Use the `decagon` function declared above, to sketch a decagon with radius 5.
decagon(5.0) decagon(5.0)
|> close() |> close()

View File

@ -57,7 +57,6 @@ rotate(
```js ```js
// Rotate a pipe with roll, pitch, and yaw. // Rotate a pipe with roll, pitch, and yaw.
// Create a path for the sweep. // Create a path for the sweep.
sweepPath = startSketchOn('XZ') sweepPath = startSketchOn('XZ')
|> startProfileAt([0.05, 0.05], %) |> startProfileAt([0.05, 0.05], %)
@ -83,7 +82,6 @@ sweepSketch = startSketchOn('XY')
```js ```js
// Rotate a pipe about an axis with an angle. // Rotate a pipe about an axis with an angle.
// Create a path for the sweep. // Create a path for the sweep.
sweepPath = startSketchOn('XZ') sweepPath = startSketchOn('XZ')
|> startProfileAt([0.05, 0.05], %) |> startProfileAt([0.05, 0.05], %)

View File

@ -37,7 +37,6 @@ scale(
```js ```js
// Scale a pipe. // Scale a pipe.
// Create a path for the sweep. // Create a path for the sweep.
sweepPath = startSketchOn('XZ') sweepPath = startSketchOn('XZ')
|> startProfileAt([0.05, 0.05], %) |> startProfileAt([0.05, 0.05], %)

View File

@ -41312,7 +41312,7 @@
"// Setting the appearance of a 3D pattern can be done _before_ or _after_ the pattern.\n// This example shows _before_ the pattern.\nexampleSketch = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> line(end = [0, 2])\n |> line(end = [3, 1])\n |> line(end = [0, -4])\n |> close()\n\nexample = extrude(exampleSketch, length = 1)\n |> appearance(color = '#ff0000', metalness = 90, roughness = 90)\n |> patternLinear3d(axis = [1, 0, 1], instances = 7, distance = 6)", "// Setting the appearance of a 3D pattern can be done _before_ or _after_ the pattern.\n// This example shows _before_ the pattern.\nexampleSketch = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> line(end = [0, 2])\n |> line(end = [3, 1])\n |> line(end = [0, -4])\n |> close()\n\nexample = extrude(exampleSketch, length = 1)\n |> appearance(color = '#ff0000', metalness = 90, roughness = 90)\n |> patternLinear3d(axis = [1, 0, 1], instances = 7, distance = 6)",
"// Setting the appearance of a 3D pattern can be done _before_ or _after_ the pattern.\n// This example shows _after_ the pattern.\nexampleSketch = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> line(end = [0, 2])\n |> line(end = [3, 1])\n |> line(end = [0, -4])\n |> close()\n\nexample = extrude(exampleSketch, length = 1)\n |> patternLinear3d(axis = [1, 0, 1], instances = 7, distance = 6)\n |> appearance(color = '#ff0000', metalness = 90, roughness = 90)", "// Setting the appearance of a 3D pattern can be done _before_ or _after_ the pattern.\n// This example shows _after_ the pattern.\nexampleSketch = startSketchOn('XZ')\n |> startProfileAt([0, 0], %)\n |> line(end = [0, 2])\n |> line(end = [3, 1])\n |> line(end = [0, -4])\n |> close()\n\nexample = extrude(exampleSketch, length = 1)\n |> patternLinear3d(axis = [1, 0, 1], instances = 7, distance = 6)\n |> appearance(color = '#ff0000', metalness = 90, roughness = 90)",
"// Color the result of a 2D pattern that was extruded.\nexampleSketch = startSketchOn('XZ')\n |> startProfileAt([.5, 25], %)\n |> line(end = [0, 5])\n |> line(end = [-1, 0])\n |> line(end = [0, -5])\n |> close()\n |> patternCircular2d(\n center = [0, 0],\n instances = 13,\n arcDegrees = 360,\n rotateDuplicates = true,\n )\n\nexample = extrude(exampleSketch, length = 1)\n |> appearance(color = '#ff0000', metalness = 90, roughness = 90)", "// Color the result of a 2D pattern that was extruded.\nexampleSketch = startSketchOn('XZ')\n |> startProfileAt([.5, 25], %)\n |> line(end = [0, 5])\n |> line(end = [-1, 0])\n |> line(end = [0, -5])\n |> close()\n |> patternCircular2d(\n center = [0, 0],\n instances = 13,\n arcDegrees = 360,\n rotateDuplicates = true,\n )\n\nexample = extrude(exampleSketch, length = 1)\n |> appearance(color = '#ff0000', metalness = 90, roughness = 90)",
"// Color the result of a sweep.\n\n\n// Create a path for the sweep.\nsweepPath = startSketchOn('XZ')\n |> startProfileAt([0.05, 0.05], %)\n |> line(end = [0, 7])\n |> tangentialArc({ offset = 90, radius = 5 }, %)\n |> line(end = [-3, 0])\n |> tangentialArc({ offset = -90, radius = 5 }, %)\n |> line(end = [0, 7])\n\npipeHole = startSketchOn('XY')\n |> circle(center = [0, 0], radius = 1.5)\n\nsweepSketch = startSketchOn('XY')\n |> circle(center = [0, 0], radius = 2)\n |> hole(pipeHole, %)\n |> sweep(path = sweepPath)\n |> appearance(color = \"#ff0000\", metalness = 50, roughness = 50)" "// Color the result of a sweep.\n\n// Create a path for the sweep.\nsweepPath = startSketchOn('XZ')\n |> startProfileAt([0.05, 0.05], %)\n |> line(end = [0, 7])\n |> tangentialArc({ offset = 90, radius = 5 }, %)\n |> line(end = [-3, 0])\n |> tangentialArc({ offset = -90, radius = 5 }, %)\n |> line(end = [0, 7])\n\npipeHole = startSketchOn('XY')\n |> circle(center = [0, 0], radius = 1.5)\n\nsweepSketch = startSketchOn('XY')\n |> circle(center = [0, 0], radius = 2)\n |> hole(pipeHole, %)\n |> sweep(path = sweepPath)\n |> appearance(color = \"#ff0000\", metalness = 50, roughness = 50)"
] ]
}, },
{ {
@ -246617,9 +246617,9 @@
"unpublished": false, "unpublished": false,
"deprecated": false, "deprecated": false,
"examples": [ "examples": [
"// This function adds two numbers.\nfn add(a, b) {\n return a + b\n}\n\n// This function adds an array of numbers.\n// It uses the `reduce` function, to call the `add` function on every\n// element of the `arr` parameter. The starting value is 0.\nfn sum(arr) {\n return reduce(arr, 0, add)\n}\n\n/* The above is basically like this pseudo-code:\nfn sum(arr):\n sumSoFar = 0\n for i in arr:\n sumSoFar = add(sumSoFar, i)\n return sumSoFar */\n\n\n// We use `assertEqual` to check that our `sum` function gives the\n// expected result. It's good to check your work!\nassertEqual(sum([1, 2, 3]), 6, 0.00001, \"1 + 2 + 3 summed is 6\")", "// This function adds two numbers.\nfn add(a, b) {\n return a + b\n}\n\n// This function adds an array of numbers.\n// It uses the `reduce` function, to call the `add` function on every\n// element of the `arr` parameter. The starting value is 0.\nfn sum(arr) {\n return reduce(arr, 0, add)\n}\n\n/* The above is basically like this pseudo-code:\nfn sum(arr):\n sumSoFar = 0\n for i in arr:\n sumSoFar = add(sumSoFar, i)\n return sumSoFar */\n\n// We use `assertEqual` to check that our `sum` function gives the\n// expected result. It's good to check your work!\nassertEqual(sum([1, 2, 3]), 6, 0.00001, \"1 + 2 + 3 summed is 6\")",
"// This example works just like the previous example above, but it uses\n// an anonymous `add` function as its parameter, instead of declaring a\n// named function outside.\narr = [1, 2, 3]\nsum = reduce(arr, 0, fn(i, result_so_far) {\n return i + result_so_far\n})\n\n// We use `assertEqual` to check that our `sum` function gives the\n// expected result. It's good to check your work!\nassertEqual(sum, 6, 0.00001, \"1 + 2 + 3 summed is 6\")", "// This example works just like the previous example above, but it uses\n// an anonymous `add` function as its parameter, instead of declaring a\n// named function outside.\narr = [1, 2, 3]\nsum = reduce(arr, 0, fn(i, result_so_far) {\n return i + result_so_far\n})\n\n// We use `assertEqual` to check that our `sum` function gives the\n// expected result. It's good to check your work!\nassertEqual(sum, 6, 0.00001, \"1 + 2 + 3 summed is 6\")",
"// Declare a function that sketches a decagon.\nfn decagon(radius) {\n // Each side of the decagon is turned this many degrees from the previous angle.\n stepAngle = 1 / 10 * TAU\n\n // Start the decagon sketch at this point.\n startOfDecagonSketch = startSketchOn('XY')\n |> startProfileAt([cos(0) * radius, sin(0) * radius], %)\n\n // Use a `reduce` to draw the remaining decagon sides.\n // For each number in the array 1..10, run the given function,\n // which takes a partially-sketched decagon and adds one more edge to it.\n fullDecagon = reduce([1..10], startOfDecagonSketch, fn(i, partialDecagon) {\n // Draw one edge of the decagon.\n x = cos(stepAngle * i) * radius\n y = sin(stepAngle * i) * radius\n return line(partialDecagon, end = [x, y])\n })\n\n return fullDecagon\n}\n\n/* The `decagon` above is basically like this pseudo-code:\nfn decagon(radius):\n stepAngle = (1/10) * TAU\n plane = startSketchOn('XY')\n startOfDecagonSketch = startProfileAt([(cos(0)*radius), (sin(0) * radius)], plane)\n\n // Here's the reduce part.\n partialDecagon = startOfDecagonSketch\n for i in [1..10]:\n x = cos(stepAngle * i) * radius\n y = sin(stepAngle * i) * radius\n partialDecagon = line(partialDecagon, end = [x, y])\n fullDecagon = partialDecagon // it's now full\n return fullDecagon */\n\n\n// Use the `decagon` function declared above, to sketch a decagon with radius 5.\ndecagon(5.0)\n |> close()" "// Declare a function that sketches a decagon.\nfn decagon(radius) {\n // Each side of the decagon is turned this many degrees from the previous angle.\n stepAngle = 1 / 10 * TAU\n\n // Start the decagon sketch at this point.\n startOfDecagonSketch = startSketchOn('XY')\n |> startProfileAt([cos(0) * radius, sin(0) * radius], %)\n\n // Use a `reduce` to draw the remaining decagon sides.\n // For each number in the array 1..10, run the given function,\n // which takes a partially-sketched decagon and adds one more edge to it.\n fullDecagon = reduce([1..10], startOfDecagonSketch, fn(i, partialDecagon) {\n // Draw one edge of the decagon.\n x = cos(stepAngle * i) * radius\n y = sin(stepAngle * i) * radius\n return line(partialDecagon, end = [x, y])\n })\n\n return fullDecagon\n}\n\n/* The `decagon` above is basically like this pseudo-code:\nfn decagon(radius):\n stepAngle = (1/10) * TAU\n plane = startSketchOn('XY')\n startOfDecagonSketch = startProfileAt([(cos(0)*radius), (sin(0) * radius)], plane)\n\n // Here's the reduce part.\n partialDecagon = startOfDecagonSketch\n for i in [1..10]:\n x = cos(stepAngle * i) * radius\n y = sin(stepAngle * i) * radius\n partialDecagon = line(partialDecagon, end = [x, y])\n fullDecagon = partialDecagon // it's now full\n return fullDecagon */\n\n// Use the `decagon` function declared above, to sketch a decagon with radius 5.\ndecagon(5.0)\n |> close()"
] ]
}, },
{ {
@ -271286,8 +271286,8 @@
"unpublished": false, "unpublished": false,
"deprecated": false, "deprecated": false,
"examples": [ "examples": [
"// Rotate a pipe with roll, pitch, and yaw.\n\n\n// Create a path for the sweep.\nsweepPath = startSketchOn('XZ')\n |> startProfileAt([0.05, 0.05], %)\n |> line(end = [0, 7])\n |> tangentialArc({ offset = 90, radius = 5 }, %)\n |> line(end = [-3, 0])\n |> tangentialArc({ offset = -90, radius = 5 }, %)\n |> line(end = [0, 7])\n\n// Create a hole for the pipe.\npipeHole = startSketchOn('XY')\n |> circle(center = [0, 0], radius = 1.5)\n\nsweepSketch = startSketchOn('XY')\n |> circle(center = [0, 0], radius = 2)\n |> hole(pipeHole, %)\n |> sweep(path = sweepPath)\n |> rotate(roll = 10, pitch = 10, yaw = 90)", "// Rotate a pipe with roll, pitch, and yaw.\n\n// Create a path for the sweep.\nsweepPath = startSketchOn('XZ')\n |> startProfileAt([0.05, 0.05], %)\n |> line(end = [0, 7])\n |> tangentialArc({ offset = 90, radius = 5 }, %)\n |> line(end = [-3, 0])\n |> tangentialArc({ offset = -90, radius = 5 }, %)\n |> line(end = [0, 7])\n\n// Create a hole for the pipe.\npipeHole = startSketchOn('XY')\n |> circle(center = [0, 0], radius = 1.5)\n\nsweepSketch = startSketchOn('XY')\n |> circle(center = [0, 0], radius = 2)\n |> hole(pipeHole, %)\n |> sweep(path = sweepPath)\n |> rotate(roll = 10, pitch = 10, yaw = 90)",
"// Rotate a pipe about an axis with an angle.\n\n\n// Create a path for the sweep.\nsweepPath = startSketchOn('XZ')\n |> startProfileAt([0.05, 0.05], %)\n |> line(end = [0, 7])\n |> tangentialArc({ offset = 90, radius = 5 }, %)\n |> line(end = [-3, 0])\n |> tangentialArc({ offset = -90, radius = 5 }, %)\n |> line(end = [0, 7])\n\n// Create a hole for the pipe.\npipeHole = startSketchOn('XY')\n |> circle(center = [0, 0], radius = 1.5)\n\nsweepSketch = startSketchOn('XY')\n |> circle(center = [0, 0], radius = 2)\n |> hole(pipeHole, %)\n |> sweep(path = sweepPath)\n |> rotate(axis = [0, 0, 1.0], angle = 90)", "// Rotate a pipe about an axis with an angle.\n\n// Create a path for the sweep.\nsweepPath = startSketchOn('XZ')\n |> startProfileAt([0.05, 0.05], %)\n |> line(end = [0, 7])\n |> tangentialArc({ offset = 90, radius = 5 }, %)\n |> line(end = [-3, 0])\n |> tangentialArc({ offset = -90, radius = 5 }, %)\n |> line(end = [0, 7])\n\n// Create a hole for the pipe.\npipeHole = startSketchOn('XY')\n |> circle(center = [0, 0], radius = 1.5)\n\nsweepSketch = startSketchOn('XY')\n |> circle(center = [0, 0], radius = 2)\n |> hole(pipeHole, %)\n |> sweep(path = sweepPath)\n |> rotate(axis = [0, 0, 1.0], angle = 90)",
"// Rotate an imported model.\n\n\nimport \"tests/inputs/cube.sldprt\" as cube\n\ncube\n |> rotate(axis = [0, 0, 1.0], angle = 90)", "// Rotate an imported model.\n\n\nimport \"tests/inputs/cube.sldprt\" as cube\n\ncube\n |> rotate(axis = [0, 0, 1.0], angle = 90)",
"// Sweep two sketches along the same path.\n\n\nsketch001 = startSketchOn('XY')\nrectangleSketch = startProfileAt([-200, 23.86], sketch001)\n |> angledLine([0, 73.47], %, $rectangleSegmentA001)\n |> angledLine([\n segAng(rectangleSegmentA001) - 90,\n 50.61\n ], %)\n |> angledLine([\n segAng(rectangleSegmentA001),\n -segLen(rectangleSegmentA001)\n ], %)\n |> line(endAbsolute = [profileStartX(%), profileStartY(%)])\n |> close()\n\ncircleSketch = circle(sketch001, center = [200, -30.29], radius = 32.63)\n\nsketch002 = startSketchOn('YZ')\nsweepPath = startProfileAt([0, 0], sketch002)\n |> yLine(length = 231.81)\n |> tangentialArc({ radius = 80, offset = -90 }, %)\n |> xLine(length = 384.93)\n\nparts = sweep([rectangleSketch, circleSketch], path = sweepPath)\n\n// Rotate the sweeps.\nrotate(parts, axis = [0, 0, 1.0], angle = 90)", "// Sweep two sketches along the same path.\n\n\nsketch001 = startSketchOn('XY')\nrectangleSketch = startProfileAt([-200, 23.86], sketch001)\n |> angledLine([0, 73.47], %, $rectangleSegmentA001)\n |> angledLine([\n segAng(rectangleSegmentA001) - 90,\n 50.61\n ], %)\n |> angledLine([\n segAng(rectangleSegmentA001),\n -segLen(rectangleSegmentA001)\n ], %)\n |> line(endAbsolute = [profileStartX(%), profileStartY(%)])\n |> close()\n\ncircleSketch = circle(sketch001, center = [200, -30.29], radius = 32.63)\n\nsketch002 = startSketchOn('YZ')\nsweepPath = startProfileAt([0, 0], sketch002)\n |> yLine(length = 231.81)\n |> tangentialArc({ radius = 80, offset = -90 }, %)\n |> xLine(length = 384.93)\n\nparts = sweep([rectangleSketch, circleSketch], path = sweepPath)\n\n// Rotate the sweeps.\nrotate(parts, axis = [0, 0, 1.0], angle = 90)",
"// Translate and rotate a sketch to create a loft.\nsketch001 = startSketchOn('XY')\n\nfn square() {\n return startProfileAt([-10, 10], sketch001)\n |> xLine(length = 20)\n |> yLine(length = -20)\n |> xLine(length = -20)\n |> line(endAbsolute = [profileStartX(%), profileStartY(%)])\n |> close()\n}\n\nprofile001 = square()\n\nprofile002 = square()\n |> translate(translate = [0, 0, 20])\n |> rotate(axis = [0, 0, 1.0], angle = 45)\n\nloft([profile001, profile002])" "// Translate and rotate a sketch to create a loft.\nsketch001 = startSketchOn('XY')\n\nfn square() {\n return startProfileAt([-10, 10], sketch001)\n |> xLine(length = 20)\n |> yLine(length = -20)\n |> xLine(length = -20)\n |> line(endAbsolute = [profileStartX(%), profileStartY(%)])\n |> close()\n}\n\nprofile001 = square()\n\nprofile002 = square()\n |> translate(translate = [0, 0, 20])\n |> rotate(axis = [0, 0, 1.0], angle = 45)\n\nloft([profile001, profile002])"
@ -277877,7 +277877,7 @@
"unpublished": false, "unpublished": false,
"deprecated": false, "deprecated": false,
"examples": [ "examples": [
"// Scale a pipe.\n\n\n// Create a path for the sweep.\nsweepPath = startSketchOn('XZ')\n |> startProfileAt([0.05, 0.05], %)\n |> line(end = [0, 7])\n |> tangentialArc({ offset = 90, radius = 5 }, %)\n |> line(end = [-3, 0])\n |> tangentialArc({ offset = -90, radius = 5 }, %)\n |> line(end = [0, 7])\n\n// Create a hole for the pipe.\npipeHole = startSketchOn('XY')\n |> circle(center = [0, 0], radius = 1.5)\n\nsweepSketch = startSketchOn('XY')\n |> circle(center = [0, 0], radius = 2)\n |> hole(pipeHole, %)\n |> sweep(path = sweepPath)\n |> scale(scale = [1.0, 1.0, 2.5])", "// Scale a pipe.\n\n// Create a path for the sweep.\nsweepPath = startSketchOn('XZ')\n |> startProfileAt([0.05, 0.05], %)\n |> line(end = [0, 7])\n |> tangentialArc({ offset = 90, radius = 5 }, %)\n |> line(end = [-3, 0])\n |> tangentialArc({ offset = -90, radius = 5 }, %)\n |> line(end = [0, 7])\n\n// Create a hole for the pipe.\npipeHole = startSketchOn('XY')\n |> circle(center = [0, 0], radius = 1.5)\n\nsweepSketch = startSketchOn('XY')\n |> circle(center = [0, 0], radius = 2)\n |> hole(pipeHole, %)\n |> sweep(path = sweepPath)\n |> scale(scale = [1.0, 1.0, 2.5])",
"// Scale an imported model.\n\n\nimport \"tests/inputs/cube.sldprt\" as cube\n\ncube\n |> scale(scale = [1.0, 1.0, 2.5])", "// Scale an imported model.\n\n\nimport \"tests/inputs/cube.sldprt\" as cube\n\ncube\n |> scale(scale = [1.0, 1.0, 2.5])",
"// Sweep two sketches along the same path.\n\n\nsketch001 = startSketchOn('XY')\nrectangleSketch = startProfileAt([-200, 23.86], sketch001)\n |> angledLine([0, 73.47], %, $rectangleSegmentA001)\n |> angledLine([\n segAng(rectangleSegmentA001) - 90,\n 50.61\n ], %)\n |> angledLine([\n segAng(rectangleSegmentA001),\n -segLen(rectangleSegmentA001)\n ], %)\n |> line(endAbsolute = [profileStartX(%), profileStartY(%)])\n |> close()\n\ncircleSketch = circle(sketch001, center = [200, -30.29], radius = 32.63)\n\nsketch002 = startSketchOn('YZ')\nsweepPath = startProfileAt([0, 0], sketch002)\n |> yLine(length = 231.81)\n |> tangentialArc({ radius = 80, offset = -90 }, %)\n |> xLine(length = 384.93)\n\nparts = sweep([rectangleSketch, circleSketch], path = sweepPath)\n\n// Scale the sweep.\nscale(parts, scale = [1.0, 1.0, 0.5])" "// Sweep two sketches along the same path.\n\n\nsketch001 = startSketchOn('XY')\nrectangleSketch = startProfileAt([-200, 23.86], sketch001)\n |> angledLine([0, 73.47], %, $rectangleSegmentA001)\n |> angledLine([\n segAng(rectangleSegmentA001) - 90,\n 50.61\n ], %)\n |> angledLine([\n segAng(rectangleSegmentA001),\n -segLen(rectangleSegmentA001)\n ], %)\n |> line(endAbsolute = [profileStartX(%), profileStartY(%)])\n |> close()\n\ncircleSketch = circle(sketch001, center = [200, -30.29], radius = 32.63)\n\nsketch002 = startSketchOn('YZ')\nsweepPath = startProfileAt([0, 0], sketch002)\n |> yLine(length = 231.81)\n |> tangentialArc({ radius = 80, offset = -90 }, %)\n |> xLine(length = 384.93)\n\nparts = sweep([rectangleSketch, circleSketch], path = sweepPath)\n\n// Scale the sweep.\nscale(parts, scale = [1.0, 1.0, 0.5])"
] ]
@ -311369,8 +311369,8 @@
"unpublished": false, "unpublished": false,
"deprecated": false, "deprecated": false,
"examples": [ "examples": [
"// Create a pipe using a sweep.\n\n\n// Create a path for the sweep.\nsweepPath = startSketchOn('XZ')\n |> startProfileAt([0.05, 0.05], %)\n |> line(end = [0, 7])\n |> tangentialArc({ offset = 90, radius = 5 }, %)\n |> line(end = [-3, 0])\n |> tangentialArc({ offset = -90, radius = 5 }, %)\n |> line(end = [0, 7])\n\n// Create a hole for the pipe.\npipeHole = startSketchOn('XY')\n |> circle(center = [0, 0], radius = 1.5)\n\nsweepSketch = startSketchOn('XY')\n |> circle(center = [0, 0], radius = 2)\n |> hole(pipeHole, %)\n |> sweep(path = sweepPath)", "// Create a pipe using a sweep.\n\n// Create a path for the sweep.\nsweepPath = startSketchOn('XZ')\n |> startProfileAt([0.05, 0.05], %)\n |> line(end = [0, 7])\n |> tangentialArc({ offset = 90, radius = 5 }, %)\n |> line(end = [-3, 0])\n |> tangentialArc({ offset = -90, radius = 5 }, %)\n |> line(end = [0, 7])\n\n// Create a hole for the pipe.\npipeHole = startSketchOn('XY')\n |> circle(center = [0, 0], radius = 1.5)\n\nsweepSketch = startSketchOn('XY')\n |> circle(center = [0, 0], radius = 2)\n |> hole(pipeHole, %)\n |> sweep(path = sweepPath)",
"// Create a spring by sweeping around a helix path.\n\n\n// Create a helix around the Z axis.\nhelixPath = helix(\n angleStart = 0,\n ccw = true,\n revolutions = 4,\n length = 10,\n radius = 5,\n axis = 'Z',\n)\n\n// Create a spring by sweeping around the helix path.\nspringSketch = startSketchOn('YZ')\n |> circle(center = [0, 0], radius = 1)\n |> sweep(path = helixPath)", "// Create a spring by sweeping around a helix path.\n\n// Create a helix around the Z axis.\nhelixPath = helix(\n angleStart = 0,\n ccw = true,\n revolutions = 4,\n length = 10,\n radius = 5,\n axis = 'Z',\n)\n\n// Create a spring by sweeping around the helix path.\nspringSketch = startSketchOn('YZ')\n |> circle(center = [0, 0], radius = 1)\n |> sweep(path = helixPath)",
"// Sweep two sketches along the same path.\n\n\nsketch001 = startSketchOn('XY')\nrectangleSketch = startProfileAt([-200, 23.86], sketch001)\n |> angledLine([0, 73.47], %, $rectangleSegmentA001)\n |> angledLine([\n segAng(rectangleSegmentA001) - 90,\n 50.61\n ], %)\n |> angledLine([\n segAng(rectangleSegmentA001),\n -segLen(rectangleSegmentA001)\n ], %)\n |> line(endAbsolute = [profileStartX(%), profileStartY(%)])\n |> close()\n\ncircleSketch = circle(sketch001, center = [200, -30.29], radius = 32.63)\n\nsketch002 = startSketchOn('YZ')\nsweepPath = startProfileAt([0, 0], sketch002)\n |> yLine(length = 231.81)\n |> tangentialArc({ radius = 80, offset = -90 }, %)\n |> xLine(length = 384.93)\n\nsweep([rectangleSketch, circleSketch], path = sweepPath)" "// Sweep two sketches along the same path.\n\n\nsketch001 = startSketchOn('XY')\nrectangleSketch = startProfileAt([-200, 23.86], sketch001)\n |> angledLine([0, 73.47], %, $rectangleSegmentA001)\n |> angledLine([\n segAng(rectangleSegmentA001) - 90,\n 50.61\n ], %)\n |> angledLine([\n segAng(rectangleSegmentA001),\n -segLen(rectangleSegmentA001)\n ], %)\n |> line(endAbsolute = [profileStartX(%), profileStartY(%)])\n |> close()\n\ncircleSketch = circle(sketch001, center = [200, -30.29], radius = 32.63)\n\nsketch002 = startSketchOn('YZ')\nsweepPath = startProfileAt([0, 0], sketch002)\n |> yLine(length = 231.81)\n |> tangentialArc({ radius = 80, offset = -90 }, %)\n |> xLine(length = 384.93)\n\nsweep([rectangleSketch, circleSketch], path = sweepPath)"
] ]
}, },
@ -332924,7 +332924,7 @@
"unpublished": false, "unpublished": false,
"deprecated": false, "deprecated": false,
"examples": [ "examples": [
"// Move a pipe.\n\n\n// Create a path for the sweep.\nsweepPath = startSketchOn('XZ')\n |> startProfileAt([0.05, 0.05], %)\n |> line(end = [0, 7])\n |> tangentialArc({ offset = 90, radius = 5 }, %)\n |> line(end = [-3, 0])\n |> tangentialArc({ offset = -90, radius = 5 }, %)\n |> line(end = [0, 7])\n\n// Create a hole for the pipe.\npipeHole = startSketchOn('XY')\n |> circle(center = [0, 0], radius = 1.5)\n\nsweepSketch = startSketchOn('XY')\n |> circle(center = [0, 0], radius = 2)\n |> hole(pipeHole, %)\n |> sweep(path = sweepPath)\n |> translate(translate = [1.0, 1.0, 2.5])", "// Move a pipe.\n\n// Create a path for the sweep.\nsweepPath = startSketchOn('XZ')\n |> startProfileAt([0.05, 0.05], %)\n |> line(end = [0, 7])\n |> tangentialArc({ offset = 90, radius = 5 }, %)\n |> line(end = [-3, 0])\n |> tangentialArc({ offset = -90, radius = 5 }, %)\n |> line(end = [0, 7])\n\n// Create a hole for the pipe.\npipeHole = startSketchOn('XY')\n |> circle(center = [0, 0], radius = 1.5)\n\nsweepSketch = startSketchOn('XY')\n |> circle(center = [0, 0], radius = 2)\n |> hole(pipeHole, %)\n |> sweep(path = sweepPath)\n |> translate(translate = [1.0, 1.0, 2.5])",
"// Move an imported model.\n\n\nimport \"tests/inputs/cube.sldprt\" as cube\n\ncube\n |> translate(translate = [1.0, 1.0, 2.5])", "// Move an imported model.\n\n\nimport \"tests/inputs/cube.sldprt\" as cube\n\ncube\n |> translate(translate = [1.0, 1.0, 2.5])",
"// Sweep two sketches along the same path.\n\n\nsketch001 = startSketchOn('XY')\nrectangleSketch = startProfileAt([-200, 23.86], sketch001)\n |> angledLine([0, 73.47], %, $rectangleSegmentA001)\n |> angledLine([\n segAng(rectangleSegmentA001) - 90,\n 50.61\n ], %)\n |> angledLine([\n segAng(rectangleSegmentA001),\n -segLen(rectangleSegmentA001)\n ], %)\n |> line(endAbsolute = [profileStartX(%), profileStartY(%)])\n |> close()\n\ncircleSketch = circle(sketch001, center = [200, -30.29], radius = 32.63)\n\nsketch002 = startSketchOn('YZ')\nsweepPath = startProfileAt([0, 0], sketch002)\n |> yLine(length = 231.81)\n |> tangentialArc({ radius = 80, offset = -90 }, %)\n |> xLine(length = 384.93)\n\nparts = sweep([rectangleSketch, circleSketch], path = sweepPath)\n\n// Move the sweeps.\ntranslate(parts, translate = [1.0, 1.0, 2.5])", "// Sweep two sketches along the same path.\n\n\nsketch001 = startSketchOn('XY')\nrectangleSketch = startProfileAt([-200, 23.86], sketch001)\n |> angledLine([0, 73.47], %, $rectangleSegmentA001)\n |> angledLine([\n segAng(rectangleSegmentA001) - 90,\n 50.61\n ], %)\n |> angledLine([\n segAng(rectangleSegmentA001),\n -segLen(rectangleSegmentA001)\n ], %)\n |> line(endAbsolute = [profileStartX(%), profileStartY(%)])\n |> close()\n\ncircleSketch = circle(sketch001, center = [200, -30.29], radius = 32.63)\n\nsketch002 = startSketchOn('YZ')\nsweepPath = startProfileAt([0, 0], sketch002)\n |> yLine(length = 231.81)\n |> tangentialArc({ radius = 80, offset = -90 }, %)\n |> xLine(length = 384.93)\n\nparts = sweep([rectangleSketch, circleSketch], path = sweepPath)\n\n// Move the sweeps.\ntranslate(parts, translate = [1.0, 1.0, 2.5])",
"// Move a sketch.\n\n\nfn square(length) {\n l = length / 2\n p0 = [-l, -l]\n p1 = [-l, l]\n p2 = [l, l]\n p3 = [l, -l]\n\n return startSketchOn(XY)\n |> startProfileAt(p0, %)\n |> line(endAbsolute = p1)\n |> line(endAbsolute = p2)\n |> line(endAbsolute = p3)\n |> close()\n}\n\nsquare(10)\n |> translate(translate = [5, 5, 0])\n |> extrude(length = 10)", "// Move a sketch.\n\n\nfn square(length) {\n l = length / 2\n p0 = [-l, -l]\n p1 = [-l, l]\n p2 = [l, l]\n p3 = [l, -l]\n\n return startSketchOn(XY)\n |> startProfileAt(p0, %)\n |> line(endAbsolute = p1)\n |> line(endAbsolute = p2)\n |> line(endAbsolute = p3)\n |> close()\n}\n\nsquare(10)\n |> translate(translate = [5, 5, 0])\n |> extrude(length = 10)",

View File

@ -43,7 +43,6 @@ sweep(
```js ```js
// Create a pipe using a sweep. // Create a pipe using a sweep.
// Create a path for the sweep. // Create a path for the sweep.
sweepPath = startSketchOn('XZ') sweepPath = startSketchOn('XZ')
|> startProfileAt([0.05, 0.05], %) |> startProfileAt([0.05, 0.05], %)
@ -68,7 +67,6 @@ sweepSketch = startSketchOn('XY')
```js ```js
// Create a spring by sweeping around a helix path. // Create a spring by sweeping around a helix path.
// Create a helix around the Z axis. // Create a helix around the Z axis.
helixPath = helix( helixPath = helix(
angleStart = 0, angleStart = 0,

View File

@ -35,7 +35,6 @@ translate(
```js ```js
// Move a pipe. // Move a pipe.
// Create a path for the sweep. // Create a path for the sweep.
sweepPath = startSketchOn('XZ') sweepPath = startSketchOn('XZ')
|> startProfileAt([0.05, 0.05], %) |> startProfileAt([0.05, 0.05], %)

View File

@ -8,7 +8,7 @@ use tower_lsp::lsp_types::{
use crate::{ use crate::{
execution::annotations, execution::annotations,
parsing::{ parsing::{
ast::types::{Annotation, Node, NonCodeNode, NonCodeValue, VariableKind}, ast::types::{Annotation, Node, NonCodeNode, VariableKind},
token::NumericSuffix, token::NumericSuffix,
}, },
ModuleId, ModuleId,
@ -36,7 +36,7 @@ impl CollectionVisitor {
.unwrap(); .unwrap();
self.id += 1; self.id += 1;
for (i, n) in parsed.body.iter().enumerate() { for n in &parsed.body {
match n { match n {
crate::parsing::ast::types::BodyItem::ImportStatement(import) if !import.visibility.is_default() => { crate::parsing::ast::types::BodyItem::ImportStatement(import) if !import.visibility.is_default() => {
// Only supports glob imports for now. // Only supports glob imports for now.
@ -63,12 +63,11 @@ impl CollectionVisitor {
VariableKind::Const => DocData::Const(ConstData::from_ast(var, qual_name)), VariableKind::Const => DocData::Const(ConstData::from_ast(var, qual_name)),
}; };
// FIXME this association of metadata with items is pretty flaky. dd.with_meta(&var.outer_attrs);
if i == 0 { for a in &var.outer_attrs {
dd.with_meta(&parsed.non_code_meta.start_nodes, &var.outer_attrs); dd.with_comments(&a.pre_comments);
} else if let Some(meta) = parsed.non_code_meta.non_code_nodes.get(&(i - 1)) {
dd.with_meta(meta, &var.outer_attrs);
} }
dd.with_comments(n.get_comments());
self.result.push(dd); self.result.push(dd);
} }
@ -80,12 +79,11 @@ impl CollectionVisitor {
}; };
let mut dd = DocData::Ty(TyData::from_ast(ty, qual_name)); let mut dd = DocData::Ty(TyData::from_ast(ty, qual_name));
// FIXME this association of metadata with items is pretty flaky. dd.with_meta(&ty.outer_attrs);
if i == 0 { for a in &ty.outer_attrs {
dd.with_meta(&parsed.non_code_meta.start_nodes, &ty.outer_attrs); dd.with_comments(&a.pre_comments);
} else if let Some(meta) = parsed.non_code_meta.non_code_nodes.get(&(i - 1)) {
dd.with_meta(meta, &ty.outer_attrs);
} }
dd.with_comments(n.get_comments());
self.result.push(dd); self.result.push(dd);
} }
@ -172,11 +170,19 @@ impl DocData {
} }
} }
fn with_meta(&mut self, meta: &[Node<NonCodeNode>], attrs: &[Node<Annotation>]) { fn with_meta(&mut self, attrs: &[Node<Annotation>]) {
match self { match self {
DocData::Fn(f) => f.with_meta(meta, attrs), DocData::Fn(f) => f.with_meta(attrs),
DocData::Const(c) => c.with_meta(meta, attrs), DocData::Const(c) => c.with_meta(attrs),
DocData::Ty(t) => t.with_meta(meta, attrs), DocData::Ty(t) => t.with_meta(attrs),
}
}
fn with_comments(&mut self, comments: &[String]) {
match self {
DocData::Fn(f) => f.with_comments(comments),
DocData::Const(c) => c.with_comments(comments),
DocData::Ty(t) => t.with_comments(comments),
} }
} }
@ -640,55 +646,20 @@ trait ApplyMeta {
fn doc_hidden(&mut self, doc_hidden: bool); fn doc_hidden(&mut self, doc_hidden: bool);
fn impl_kind(&mut self, impl_kind: annotations::Impl); fn impl_kind(&mut self, impl_kind: annotations::Impl);
fn with_meta(&mut self, meta: &[Node<NonCodeNode>], attrs: &[Node<Annotation>]) { fn with_comments(&mut self, comments: &[String]) {
for attr in attrs { if comments.iter().all(|s| s.is_empty()) {
if let Annotation { return;
name: None,
properties: Some(props),
..
} = &attr.inner
{
for p in props {
match &*p.key.name {
annotations::IMPL => {
if let Some(s) = p.value.ident_name() {
self.impl_kind(annotations::Impl::from_str(s).unwrap());
}
}
"deprecated" => {
if let Some(b) = p.value.literal_bool() {
self.deprecated(b);
}
}
"doc_hidden" => {
if let Some(b) = p.value.literal_bool() {
self.doc_hidden(b);
}
}
_ => {}
}
}
}
}
let mut comments = Vec::new();
for m in meta {
match &m.value {
NonCodeValue::BlockComment { value, .. } | NonCodeValue::NewLineBlockComment { value, .. } => {
comments.push(value)
}
_ => {}
}
} }
let mut summary = None; let mut summary = None;
let mut description = None; let mut description = None;
let mut example: Option<(String, ExampleProperties)> = None; let mut example: Option<(String, ExampleProperties)> = None;
let mut examples = Vec::new(); let mut examples = Vec::new();
for l in comments.into_iter().filter(|l| l.starts_with('/')).map(|l| { for l in comments.iter().filter(|l| l.starts_with("///")).map(|l| {
if let Some(ll) = l.strip_prefix("/ ") { if let Some(ll) = l.strip_prefix("/// ") {
ll ll
} else { } else {
&l[1..] &l[3..]
} }
}) { }) {
if description.is_none() && summary.is_none() { if description.is_none() && summary.is_none() {
@ -763,6 +734,38 @@ trait ApplyMeta {
examples, examples,
); );
} }
fn with_meta(&mut self, attrs: &[Node<Annotation>]) {
for attr in attrs {
if let Annotation {
name: None,
properties: Some(props),
..
} = &attr.inner
{
for p in props {
match &*p.key.name {
annotations::IMPL => {
if let Some(s) = p.value.ident_name() {
self.impl_kind(annotations::Impl::from_str(s).unwrap());
}
}
"deprecated" => {
if let Some(b) = p.value.literal_bool() {
self.deprecated(b);
}
}
"doc_hidden" => {
if let Some(b) = p.value.literal_bool() {
self.doc_hidden(b);
}
}
_ => {}
}
}
}
}
}
} }
impl ApplyMeta for ConstData { impl ApplyMeta for ConstData {

View File

@ -1714,7 +1714,6 @@ outsideRevolve = startSketchOn('XZ')
r#"// Ball Bearing r#"// Ball Bearing
// A ball bearing is a type of rolling-element bearing that uses balls to maintain the separation between the bearing races. The primary purpose of a ball bearing is to reduce rotational friction and support radial and axial loads. // A ball bearing is a type of rolling-element bearing that uses balls to maintain the separation between the bearing races. The primary purpose of a ball bearing is to reduce rotational friction and support radial and axial loads.
// Define constants like ball diameter, inside diameter, overhange length, and thickness // Define constants like ball diameter, inside diameter, overhange length, and thickness
sphereDia = 0.5 sphereDia = 0.5
insideDia = 1 insideDia = 1

View File

@ -53,6 +53,12 @@ pub struct Node<T> {
pub module_id: ModuleId, pub module_id: ModuleId,
#[serde(default, skip_serializing_if = "Vec::is_empty")] #[serde(default, skip_serializing_if = "Vec::is_empty")]
pub outer_attrs: NodeList<Annotation>, pub outer_attrs: NodeList<Annotation>,
// Some comments are kept here, some are kept in NonCodeMeta, and some are ignored. See how each
// node is parsed to check for certain. In any case, only comments which are strongly associated
// with an item are kept here.
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub pre_comments: Vec<String>,
pub comment_start: usize,
} }
impl<T: JsonSchema> schemars::JsonSchema for Node<T> { impl<T: JsonSchema> schemars::JsonSchema for Node<T> {
@ -85,6 +91,20 @@ impl<T> Node<T> {
end, end,
module_id, module_id,
outer_attrs: Vec::new(), outer_attrs: Vec::new(),
pre_comments: Vec::new(),
comment_start: start,
}
}
pub fn new_node(start: usize, end: usize, module_id: ModuleId, inner: T) -> Self {
Self {
inner,
start,
end,
module_id,
outer_attrs: Vec::new(),
pre_comments: Vec::new(),
comment_start: start,
} }
} }
@ -95,6 +115,8 @@ impl<T> Node<T> {
end: 0, end: 0,
module_id: ModuleId::default(), module_id: ModuleId::default(),
outer_attrs: Vec::new(), outer_attrs: Vec::new(),
pre_comments: Vec::new(),
comment_start: 0,
} }
} }
@ -105,6 +127,8 @@ impl<T> Node<T> {
end, end,
module_id, module_id,
outer_attrs: Vec::new(), outer_attrs: Vec::new(),
pre_comments: Vec::new(),
comment_start: start,
}) })
} }
@ -133,8 +157,15 @@ impl<T> Node<T> {
end: self.end, end: self.end,
module_id: self.module_id, module_id: self.module_id,
outer_attrs: self.outer_attrs, outer_attrs: self.outer_attrs,
pre_comments: self.pre_comments,
comment_start: self.comment_start,
} }
} }
pub fn set_comments(&mut self, comments: Vec<String>, start: usize) {
self.pre_comments = comments;
self.comment_start = start;
}
} }
impl<T> Deref for Node<T> { impl<T> Deref for Node<T> {
@ -373,6 +404,26 @@ impl Program {
if self.non_code_meta.in_comment(pos) { if self.non_code_meta.in_comment(pos) {
return true; return true;
} }
for item in &self.body {
let r = item.comment_range();
eprintln!("item {r:?}");
if pos >= r.0 && pos < r.1 {
return true;
}
if pos < r.0 {
break;
}
}
for n in &self.inner_attrs {
if pos >= n.comment_start && pos < n.start {
return true;
}
if pos < n.comment_start {
break;
}
}
let item = self.get_body_item_for_position(pos); let item = self.get_body_item_for_position(pos);
// Recurse over the item. // Recurse over the item.
@ -660,6 +711,36 @@ impl BodyItem {
BodyItem::ReturnStatement(node) => &mut node.outer_attrs, BodyItem::ReturnStatement(node) => &mut node.outer_attrs,
} }
} }
pub(crate) fn set_comments(&mut self, comments: Vec<String>, start: usize) {
match self {
BodyItem::ImportStatement(node) => node.set_comments(comments, start),
BodyItem::ExpressionStatement(node) => node.set_comments(comments, start),
BodyItem::VariableDeclaration(node) => node.set_comments(comments, start),
BodyItem::TypeDeclaration(node) => node.set_comments(comments, start),
BodyItem::ReturnStatement(node) => node.set_comments(comments, start),
}
}
pub(crate) fn get_comments(&self) -> &[String] {
match self {
BodyItem::ImportStatement(node) => &node.pre_comments,
BodyItem::ExpressionStatement(node) => &node.pre_comments,
BodyItem::VariableDeclaration(node) => &node.pre_comments,
BodyItem::TypeDeclaration(node) => &node.pre_comments,
BodyItem::ReturnStatement(node) => &node.pre_comments,
}
}
pub(crate) fn comment_range(&self) -> (usize, usize) {
match self {
BodyItem::ImportStatement(node) => (node.comment_start, node.start),
BodyItem::ExpressionStatement(node) => (node.comment_start, node.start),
BodyItem::VariableDeclaration(node) => (node.comment_start, node.start),
BodyItem::TypeDeclaration(node) => (node.comment_start, node.start),
BodyItem::ReturnStatement(node) => (node.comment_start, node.start),
}
}
} }
impl From<BodyItem> for SourceRange { impl From<BodyItem> for SourceRange {
@ -1171,6 +1252,23 @@ pub enum CommentStyle {
Block, Block,
} }
impl CommentStyle {
pub fn render_comment(&self, comment: &str) -> String {
match self {
CommentStyle::Line => {
let comment = comment.trim();
let mut result = "//".to_owned();
if !comment.is_empty() && !comment.starts_with('/') {
result.push(' ');
}
result.push_str(comment);
result
}
CommentStyle::Block => format!("/* {comment} */"),
}
}
}
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)] #[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)]
#[ts(export)] #[ts(export)]
#[serde(tag = "type", rename_all = "camelCase")] #[serde(tag = "type", rename_all = "camelCase")]
@ -1186,7 +1284,7 @@ pub enum NonCodeValue {
}, },
/// A block comment. /// A block comment.
/// An example of this is the following: /// An example of this is the following:
/// ```python,no_run /// ```no_run
/// /* This is a /// /* This is a
/// block comment */ /// block comment */
/// 1 + 1 /// 1 + 1
@ -3890,7 +3988,6 @@ startSketchOn('XY')"#;
formatted, formatted,
r#"@settings(defaultLengthUnit = mm) r#"@settings(defaultLengthUnit = mm)
startSketchOn('XY') startSketchOn('XY')
"# "#
); );
@ -3925,6 +4022,7 @@ startSketchOn('XY')
assert_eq!( assert_eq!(
formatted, formatted,
r#"@settings(defaultLengthUnit = mm) r#"@settings(defaultLengthUnit = mm)
startSketchOn('XY') startSketchOn('XY')
"# "#
); );

View File

@ -300,16 +300,17 @@ fn annotation(i: &mut TokenSlice) -> PResult<Node<Annotation>> {
terminated(one_of((TokenType::Operator, "=")), opt(whitespace)), terminated(one_of((TokenType::Operator, "=")), opt(whitespace)),
expression, expression,
) )
.map(|(key, value)| Node { .map(|(key, value)| {
start: key.start, Node::new_node(
end: value.end(), key.start,
module_id: key.module_id, value.end(),
inner: ObjectProperty { key.module_id,
key, ObjectProperty {
value, key,
digest: None, value,
}, digest: None,
outer_attrs: Vec::new(), },
)
}), }),
comma_sep, comma_sep,
) )
@ -417,17 +418,16 @@ fn pipe_expression(i: &mut TokenSlice) -> PResult<Node<PipeExpression>> {
non_code_meta.insert(code_count, nc); non_code_meta.insert(code_count, nc);
} }
} }
Ok(Node { Ok(Node::new_node(
start: values.first().unwrap().start(), values.first().unwrap().start(),
end: values.last().unwrap().end().max(max_noncode_end), values.last().unwrap().end().max(max_noncode_end),
module_id: values.first().unwrap().module_id(), values.first().unwrap().module_id(),
inner: PipeExpression { PipeExpression {
body: values, body: values,
non_code_meta, non_code_meta,
digest: None, digest: None,
}, },
outer_attrs: Vec::new(), ))
})
} }
fn bool_value(i: &mut TokenSlice) -> PResult<BoxNode<Literal>> { fn bool_value(i: &mut TokenSlice) -> PResult<BoxNode<Literal>> {
@ -858,17 +858,16 @@ fn array_end_start(i: &mut TokenSlice) -> PResult<Node<ArrayRangeExpression>> {
fn object_property_same_key_and_val(i: &mut TokenSlice) -> PResult<Node<ObjectProperty>> { fn object_property_same_key_and_val(i: &mut TokenSlice) -> PResult<Node<ObjectProperty>> {
let key = nameable_identifier.context(expected("the property's key (the name or identifier of the property), e.g. in 'height = 4', 'height' is the property key")).parse_next(i)?; let key = nameable_identifier.context(expected("the property's key (the name or identifier of the property), e.g. in 'height = 4', 'height' is the property key")).parse_next(i)?;
ignore_whitespace(i); ignore_whitespace(i);
Ok(Node { Ok(Node::new_node(
start: key.start, key.start,
end: key.end, key.end,
module_id: key.module_id, key.module_id,
inner: ObjectProperty { ObjectProperty {
value: Expr::Identifier(Box::new(key.clone())), value: Expr::Identifier(Box::new(key.clone())),
key, key,
digest: None, digest: None,
}, },
outer_attrs: Vec::new(), ))
})
} }
fn object_property(i: &mut TokenSlice) -> PResult<Node<ObjectProperty>> { fn object_property(i: &mut TokenSlice) -> PResult<Node<ObjectProperty>> {
@ -899,17 +898,16 @@ fn object_property(i: &mut TokenSlice) -> PResult<Node<ObjectProperty>> {
} }
}; };
let result = Node { let result = Node::new_node(
start: key.start, key.start,
end: expr.end(), expr.end(),
module_id: key.module_id, key.module_id,
inner: ObjectProperty { ObjectProperty {
key, key,
value: expr, value: expr,
digest: None, digest: None,
}, },
outer_attrs: Vec::new(), );
};
if sep.token_type == TokenType::Colon { if sep.token_type == TokenType::Colon {
ParseContext::warn( ParseContext::warn(
@ -1552,14 +1550,57 @@ fn function_body(i: &mut TokenSlice) -> PResult<Node<Program>> {
let mut inner_attrs = Vec::new(); let mut inner_attrs = Vec::new();
let mut pending_attrs = Vec::new(); let mut pending_attrs = Vec::new();
let mut non_code_meta = NonCodeMeta::default(); let mut non_code_meta = NonCodeMeta::default();
let mut pending_non_code: Vec<Node<NonCodeNode>> = Vec::new();
let mut end = 0; let mut end = 0;
let mut start = leading_whitespace_start; let mut start = leading_whitespace_start;
macro_rules! handle_pending_non_code {
($node: ident) => {
if !pending_non_code.is_empty() {
let start = pending_non_code[0].start;
let force_disoc = matches!(
&pending_non_code.last().unwrap().inner.value,
NonCodeValue::NewLine
);
let mut comments = Vec::new();
for nc in pending_non_code {
match nc.inner.value {
NonCodeValue::BlockComment { value, style } if !force_disoc => {
comments.push(style.render_comment(&value));
}
NonCodeValue::NewLineBlockComment { value, style } if !force_disoc => {
if comments.is_empty() && nc.start != 0 {
comments.push(String::new());
comments.push(String::new());
}
comments.push(style.render_comment(&value));
}
NonCodeValue::NewLine if !force_disoc && !comments.is_empty() => {
comments.push(String::new());
comments.push(String::new());
}
_ => {
if body.is_empty() {
non_code_meta.start_nodes.push(nc);
} else {
non_code_meta.insert(body.len() - 1, nc);
}
}
}
}
$node.set_comments(comments, start);
pending_non_code = Vec::new();
}
};
}
for thing_in_body in things_within_body { for thing_in_body in things_within_body {
match thing_in_body { match thing_in_body {
WithinFunction::Annotation(attr) => { WithinFunction::Annotation(mut attr) => {
if start.is_none() { if start.is_none() {
start = Some((attr.start, attr.module_id)) start = Some((attr.start, attr.module_id))
} }
handle_pending_non_code!(attr);
if attr.is_inner() { if attr.is_inner() {
inner_attrs.push(attr); inner_attrs.push(attr);
} else { } else {
@ -1575,10 +1616,11 @@ fn function_body(i: &mut TokenSlice) -> PResult<Node<Program>> {
b.set_attrs(pending_attrs); b.set_attrs(pending_attrs);
pending_attrs = Vec::new(); pending_attrs = Vec::new();
} }
handle_pending_non_code!(b);
body.push(b); body.push(b);
if let Some(nc) = maybe_noncode { if let Some(nc) = maybe_noncode {
end = nc.end; end = nc.end;
non_code_meta.insert(body.len() - 1, nc); pending_non_code.push(nc);
} }
} }
WithinFunction::NonCode(nc) => { WithinFunction::NonCode(nc) => {
@ -1586,11 +1628,7 @@ fn function_body(i: &mut TokenSlice) -> PResult<Node<Program>> {
start = Some((nc.start, nc.module_id)); start = Some((nc.start, nc.module_id));
} }
end = nc.end; end = nc.end;
if body.is_empty() { pending_non_code.push(nc);
non_code_meta.start_nodes.push(nc);
} else {
non_code_meta.insert(body.len() - 1, nc);
}
} }
} }
} }
@ -1614,6 +1652,15 @@ fn function_body(i: &mut TokenSlice) -> PResult<Node<Program>> {
.into(), .into(),
)); ));
} }
for nc in pending_non_code {
if body.is_empty() {
non_code_meta.start_nodes.push(nc);
} else {
non_code_meta.insert(body.len() - 1, nc);
}
}
// Safe to unwrap `body.first()` because `body` is `separated1` therefore guaranteed // Safe to unwrap `body.first()` because `body` is `separated1` therefore guaranteed
// to have len >= 1. // to have len >= 1.
let end_ws = opt(whitespace) let end_ws = opt(whitespace)
@ -1922,13 +1969,12 @@ fn return_stmt(i: &mut TokenSlice) -> PResult<Node<ReturnStatement>> {
.parse_next(i)?; .parse_next(i)?;
require_whitespace(i)?; require_whitespace(i)?;
let argument = expression(i)?; let argument = expression(i)?;
Ok(Node { Ok(Node::new_node(
start: ret.start, ret.start,
end: argument.end(), argument.end(),
module_id: ret.module_id, ret.module_id,
inner: ReturnStatement { argument, digest: None }, ReturnStatement { argument, digest: None },
outer_attrs: Vec::new(), ))
})
} }
/// Parse a KCL expression. /// Parse a KCL expression.
@ -2134,28 +2180,27 @@ fn declaration(i: &mut TokenSlice) -> PResult<BoxNode<VariableDeclaration>> {
.map_err(|e| e.cut())?; .map_err(|e| e.cut())?;
let end = val.end(); let end = val.end();
Ok(Box::new(Node { let module_id = id.module_id;
start, Ok(Node::boxed(
end, VariableDeclaration {
module_id: id.module_id, declaration: Node::new_node(
inner: VariableDeclaration { id.start,
declaration: Node {
start: id.start,
end, end,
module_id: id.module_id, module_id,
inner: VariableDeclarator { VariableDeclarator {
id, id,
init: val, init: val,
digest: None, digest: None,
}, },
outer_attrs: Vec::new(), ),
},
visibility, visibility,
kind, kind,
digest: None, digest: None,
}, },
outer_attrs: Vec::new(), start,
})) end,
module_id,
))
} }
fn ty_decl(i: &mut TokenSlice) -> PResult<BoxNode<TypeDeclaration>> { fn ty_decl(i: &mut TokenSlice) -> PResult<BoxNode<TypeDeclaration>> {
@ -2183,18 +2228,18 @@ fn ty_decl(i: &mut TokenSlice) -> PResult<BoxNode<TypeDeclaration>> {
None None
}; };
let result = Box::new(Node { let module_id = name.module_id;
start, let result = Node::boxed(
end, TypeDeclaration {
module_id: name.module_id,
outer_attrs: Vec::new(),
inner: TypeDeclaration {
name, name,
args, args,
visibility, visibility,
digest: None, digest: None,
}, },
}); start,
end,
module_id,
);
ParseContext::warn(CompilationError::err( ParseContext::warn(CompilationError::err(
result.as_source_range(), result.as_source_range(),
@ -2374,17 +2419,16 @@ fn unary_expression(i: &mut TokenSlice) -> PResult<Node<UnaryExpression>> {
.context(expected("a unary expression, e.g. -x or -3")) .context(expected("a unary expression, e.g. -x or -3"))
.parse_next(i)?; .parse_next(i)?;
let argument = operand.parse_next(i)?; let argument = operand.parse_next(i)?;
Ok(Node { Ok(Node::new_node(
start: op_token.start, op_token.start,
end: argument.end(), argument.end(),
module_id: op_token.module_id, op_token.module_id,
inner: UnaryExpression { UnaryExpression {
operator, operator,
argument, argument,
digest: None, digest: None,
}, },
outer_attrs: Vec::new(), ))
})
} }
/// Consume tokens that make up a binary expression, but don't actually return them. /// Consume tokens that make up a binary expression, but don't actually return them.
@ -2456,16 +2500,15 @@ fn expression_stmt(i: &mut TokenSlice) -> PResult<Node<ExpressionStatement>> {
"an expression (i.e. a value, or an algorithm for calculating one), e.g. 'x + y' or '3' or 'width * 2'", "an expression (i.e. a value, or an algorithm for calculating one), e.g. 'x + y' or '3' or 'width * 2'",
)) ))
.parse_next(i)?; .parse_next(i)?;
Ok(Node { Ok(Node::new_node(
start: val.start(), val.start(),
end: val.end(), val.end(),
module_id: val.module_id(), val.module_id(),
inner: ExpressionStatement { ExpressionStatement {
expression: val, expression: val,
digest: None, digest: None,
}, },
outer_attrs: Vec::new(), ))
})
} }
/// Parse the given brace symbol. /// Parse the given brace symbol.
@ -2889,17 +2932,16 @@ fn fn_call(i: &mut TokenSlice) -> PResult<Node<CallExpression>> {
} }
let end = preceded(opt(whitespace), close_paren).parse_next(i)?.end; let end = preceded(opt(whitespace), close_paren).parse_next(i)?.end;
Ok(Node { Ok(Node::new_node(
start: fn_name.start, fn_name.start,
end, end,
module_id: fn_name.module_id, fn_name.module_id,
inner: CallExpression { CallExpression {
callee: fn_name, callee: fn_name,
arguments: args, arguments: args,
digest: None, digest: None,
}, },
outer_attrs: Vec::new(), ))
})
} }
fn fn_call_kw(i: &mut TokenSlice) -> PResult<Node<CallExpressionKw>> { fn fn_call_kw(i: &mut TokenSlice) -> PResult<Node<CallExpressionKw>> {
@ -2971,19 +3013,18 @@ fn fn_call_kw(i: &mut TokenSlice) -> PResult<Node<CallExpressionKw>> {
non_code_nodes, non_code_nodes,
..Default::default() ..Default::default()
}; };
Ok(Node { Ok(Node::new_node(
start: fn_name.start, fn_name.start,
end, end,
module_id: fn_name.module_id, fn_name.module_id,
inner: CallExpressionKw { CallExpressionKw {
callee: fn_name, callee: fn_name,
unlabeled: initial_unlabeled_arg, unlabeled: initial_unlabeled_arg,
arguments: args, arguments: args,
digest: None, digest: None,
non_code_meta, non_code_meta,
}, },
outer_attrs: Vec::new(), ))
})
} }
#[cfg(test)] #[cfg(test)]
@ -3094,18 +3135,18 @@ mod tests {
a = 1 a = 1
// comment 1 // comment 1
b = 2 b = 2
// comment 2 /// comment 2
return 1 return 1
}"#; }"#;
let tokens = crate::parsing::token::lex(test_program, ModuleId::default()).unwrap(); let tokens = crate::parsing::token::lex(test_program, ModuleId::default()).unwrap();
let expr = function_decl.map(|t| t.0).parse_next(&mut tokens.as_slice()).unwrap(); let expr = function_decl.map(|t| t.0).parse_next(&mut tokens.as_slice()).unwrap();
assert_eq!(expr.params, vec![]); assert_eq!(expr.params, vec![]);
let comment_start = expr.body.non_code_meta.start_nodes.first().unwrap(); let comment_start = expr.body.body[0].get_comments();
let comment0 = &expr.body.non_code_meta.non_code_nodes.get(&0).unwrap()[0]; let comment0 = expr.body.body[1].get_comments();
let comment1 = &expr.body.non_code_meta.non_code_nodes.get(&1).unwrap()[0]; let comment1 = expr.body.body[2].get_comments();
assert_eq!(comment_start.value(), "comment 0"); assert_eq!(comment_start, vec!["// comment 0".to_owned()]);
assert_eq!(comment0.value(), "comment 1"); assert_eq!(comment0, vec!["// comment 1".to_owned()]);
assert_eq!(comment1.value(), "comment 2"); assert_eq!(comment1, vec!["/// comment 2".to_owned()]);
} }
#[test] #[test]
@ -3186,61 +3227,16 @@ mySk1 = startSketchOn(XY)
let tokens = crate::parsing::token::lex(test_program, module_id).unwrap(); let tokens = crate::parsing::token::lex(test_program, module_id).unwrap();
let expr = function_decl.map(|t| t.0).parse_next(&mut tokens.as_slice()).unwrap(); let expr = function_decl.map(|t| t.0).parse_next(&mut tokens.as_slice()).unwrap();
assert_eq!( assert_eq!(
expr, expr.body.non_code_meta.start_nodes,
Node::new( vec![Node::new(
FunctionExpression { NonCodeNode {
params: Default::default(), value: NonCodeValue::NewLine,
body: Node::new( digest: None
Program {
body: vec![BodyItem::ReturnStatement(Node::new(
ReturnStatement {
argument: Expr::Literal(Box::new(Node::new(
Literal {
value: LiteralValue::Number {
value: 2.0,
suffix: NumericSuffix::None
},
raw: "2".to_owned(),
digest: None,
},
29,
30,
module_id,
))),
digest: None,
},
22,
30,
module_id,
))],
non_code_meta: NonCodeMeta {
non_code_nodes: Default::default(),
start_nodes: vec![Node::new(
NonCodeNode {
value: NonCodeValue::NewLine,
digest: None
},
4,
22,
module_id,
)],
digest: None,
},
inner_attrs: Vec::new(),
shebang: None,
digest: None,
},
4,
44,
module_id,
),
return_type: None,
digest: None,
}, },
0, 4,
44, 22,
module_id, module_id,
) )]
); );
} }
@ -3282,22 +3278,10 @@ mySk1 = startSketchOn(XY)
let module_id = ModuleId::default(); let module_id = ModuleId::default();
let tokens = crate::parsing::token::lex(test_program, module_id).unwrap(); let tokens = crate::parsing::token::lex(test_program, module_id).unwrap();
let Program { non_code_meta, .. } = function_body.parse(tokens.as_slice()).unwrap().inner; let Program {
assert_eq!( body, non_code_meta, ..
vec![Node::new( } = function_body.parse(tokens.as_slice()).unwrap().inner;
NonCodeNode { assert_eq!(body[0].get_comments(), vec!["// this is a comment".to_owned()],);
value: NonCodeValue::BlockComment {
value: "this is a comment".to_owned(),
style: CommentStyle::Line
},
digest: None,
},
0,
20,
module_id,
)],
non_code_meta.start_nodes,
);
assert_eq!( assert_eq!(
Some(&vec![ Some(&vec![
@ -3326,21 +3310,7 @@ mySk1 = startSketchOn(XY)
non_code_meta.non_code_nodes.get(&0), non_code_meta.non_code_nodes.get(&0),
); );
assert_eq!( assert_eq!(body[2].get_comments(), vec!["// this is also a comment".to_owned()],);
Some(&vec![Node::new(
NonCodeNode {
value: NonCodeValue::BlockComment {
value: "this is also a comment".to_owned(),
style: CommentStyle::Line
},
digest: None,
},
94,
120,
module_id,
)]),
non_code_meta.non_code_nodes.get(&1),
);
} }
#[test] #[test]

View File

@ -1,5 +1,5 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
@ -14,7 +14,8 @@ expression: actual
}, },
"raw": "1", "raw": "1",
"start": 0, "start": 0,
"end": 1 "end": 1,
"commentStart": 0
}, },
"right": { "right": {
"type": "Literal", "type": "Literal",
@ -25,8 +26,10 @@ expression: actual
}, },
"raw": "2", "raw": "2",
"start": 4, "start": 4,
"end": 5 "end": 5,
"commentStart": 4
}, },
"start": 0, "start": 0,
"end": 5 "end": 5,
"commentStart": 0
} }

View File

@ -1,5 +1,5 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
@ -14,7 +14,8 @@ expression: actual
}, },
"raw": "1", "raw": "1",
"start": 0, "start": 0,
"end": 1 "end": 1,
"commentStart": 0
}, },
"right": { "right": {
"type": "Literal", "type": "Literal",
@ -25,8 +26,10 @@ expression: actual
}, },
"raw": "2", "raw": "2",
"start": 2, "start": 2,
"end": 3 "end": 3,
"commentStart": 2
}, },
"start": 0, "start": 0,
"end": 3 "end": 3,
"commentStart": 0
} }

View File

@ -1,5 +1,5 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
@ -14,7 +14,8 @@ expression: actual
}, },
"raw": "1", "raw": "1",
"start": 0, "start": 0,
"end": 1 "end": 1,
"commentStart": 0
}, },
"right": { "right": {
"type": "Literal", "type": "Literal",
@ -25,8 +26,10 @@ expression: actual
}, },
"raw": "2", "raw": "2",
"start": 3, "start": 3,
"end": 4 "end": 4,
"commentStart": 3
}, },
"start": 0, "start": 0,
"end": 4 "end": 4,
"commentStart": 0
} }

View File

@ -1,5 +1,5 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
@ -14,7 +14,8 @@ expression: actual
}, },
"raw": "1", "raw": "1",
"start": 0, "start": 0,
"end": 1 "end": 1,
"commentStart": 0
}, },
"right": { "right": {
"type": "BinaryExpression", "type": "BinaryExpression",
@ -29,7 +30,8 @@ expression: actual
}, },
"raw": "2", "raw": "2",
"start": 4, "start": 4,
"end": 5 "end": 5,
"commentStart": 4
}, },
"right": { "right": {
"type": "Literal", "type": "Literal",
@ -40,11 +42,14 @@ expression: actual
}, },
"raw": "3", "raw": "3",
"start": 8, "start": 8,
"end": 9 "end": 9,
"commentStart": 8
}, },
"start": 4, "start": 4,
"end": 9 "end": 9,
"commentStart": 4
}, },
"start": 0, "start": 0,
"end": 9 "end": 9,
"commentStart": 0
} }

View File

@ -1,5 +1,5 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
@ -14,7 +14,8 @@ expression: actual
}, },
"raw": "1", "raw": "1",
"start": 0, "start": 0,
"end": 1 "end": 1,
"commentStart": 0
}, },
"right": { "right": {
"type": "BinaryExpression", "type": "BinaryExpression",
@ -29,7 +30,8 @@ expression: actual
}, },
"raw": "2", "raw": "2",
"start": 6, "start": 6,
"end": 7 "end": 7,
"commentStart": 6
}, },
"right": { "right": {
"type": "Literal", "type": "Literal",
@ -40,11 +42,14 @@ expression: actual
}, },
"raw": "3", "raw": "3",
"start": 10, "start": 10,
"end": 11 "end": 11,
"commentStart": 10
}, },
"start": 6, "start": 6,
"end": 11 "end": 11,
"commentStart": 6
}, },
"start": 0, "start": 0,
"end": 11 "end": 11,
"commentStart": 0
} }

View File

@ -1,5 +1,5 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
@ -18,7 +18,8 @@ expression: actual
}, },
"raw": "1", "raw": "1",
"start": 0, "start": 0,
"end": 1 "end": 1,
"commentStart": 0
}, },
"right": { "right": {
"type": "BinaryExpression", "type": "BinaryExpression",
@ -33,7 +34,8 @@ expression: actual
}, },
"raw": "2", "raw": "2",
"start": 6, "start": 6,
"end": 7 "end": 7,
"commentStart": 6
}, },
"right": { "right": {
"type": "Literal", "type": "Literal",
@ -44,13 +46,16 @@ expression: actual
}, },
"raw": "3", "raw": "3",
"start": 10, "start": 10,
"end": 11 "end": 11,
"commentStart": 10
}, },
"start": 6, "start": 6,
"end": 11 "end": 11,
"commentStart": 6
}, },
"start": 0, "start": 0,
"end": 11 "end": 11,
"commentStart": 0
}, },
"right": { "right": {
"type": "Literal", "type": "Literal",
@ -61,8 +66,10 @@ expression: actual
}, },
"raw": "4", "raw": "4",
"start": 16, "start": 16,
"end": 17 "end": 17,
"commentStart": 16
}, },
"start": 0, "start": 0,
"end": 17 "end": 17,
"commentStart": 0
} }

View File

@ -1,5 +1,5 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
@ -14,7 +14,8 @@ expression: actual
}, },
"raw": "1", "raw": "1",
"start": 0, "start": 0,
"end": 1 "end": 1,
"commentStart": 0
}, },
"right": { "right": {
"type": "BinaryExpression", "type": "BinaryExpression",
@ -33,7 +34,8 @@ expression: actual
}, },
"raw": "2", "raw": "2",
"start": 6, "start": 6,
"end": 7 "end": 7,
"commentStart": 6
}, },
"right": { "right": {
"type": "Literal", "type": "Literal",
@ -44,10 +46,12 @@ expression: actual
}, },
"raw": "3", "raw": "3",
"start": 10, "start": 10,
"end": 11 "end": 11,
"commentStart": 10
}, },
"start": 6, "start": 6,
"end": 11 "end": 11,
"commentStart": 6
}, },
"right": { "right": {
"type": "Literal", "type": "Literal",
@ -58,11 +62,14 @@ expression: actual
}, },
"raw": "4", "raw": "4",
"start": 16, "start": 16,
"end": 17 "end": 17,
"commentStart": 16
}, },
"start": 6, "start": 6,
"end": 17 "end": 17,
"commentStart": 6
}, },
"start": 0, "start": 0,
"end": 17 "end": 17,
"commentStart": 0
} }

View File

@ -1,5 +1,5 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
@ -14,7 +14,8 @@ expression: actual
}, },
"raw": "1", "raw": "1",
"start": 0, "start": 0,
"end": 1 "end": 1,
"commentStart": 0
}, },
"right": { "right": {
"type": "BinaryExpression", "type": "BinaryExpression",
@ -37,7 +38,8 @@ expression: actual
}, },
"raw": "2", "raw": "2",
"start": 7, "start": 7,
"end": 8 "end": 8,
"commentStart": 7
}, },
"right": { "right": {
"type": "Literal", "type": "Literal",
@ -48,10 +50,12 @@ expression: actual
}, },
"raw": "3", "raw": "3",
"start": 11, "start": 11,
"end": 12 "end": 12,
"commentStart": 11
}, },
"start": 7, "start": 7,
"end": 12 "end": 12,
"commentStart": 7
}, },
"right": { "right": {
"type": "Literal", "type": "Literal",
@ -62,10 +66,12 @@ expression: actual
}, },
"raw": "4", "raw": "4",
"start": 17, "start": 17,
"end": 18 "end": 18,
"commentStart": 17
}, },
"start": 7, "start": 7,
"end": 18 "end": 18,
"commentStart": 7
}, },
"right": { "right": {
"type": "Literal", "type": "Literal",
@ -76,11 +82,14 @@ expression: actual
}, },
"raw": "5", "raw": "5",
"start": 21, "start": 21,
"end": 22 "end": 22,
"commentStart": 21
}, },
"start": 7, "start": 7,
"end": 22 "end": 22,
"commentStart": 7
}, },
"start": 0, "start": 0,
"end": 22 "end": 22,
"commentStart": 0
} }

View File

@ -1,5 +1,5 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
@ -14,7 +14,8 @@ expression: actual
}, },
"raw": "1", "raw": "1",
"start": 0, "start": 0,
"end": 1 "end": 1,
"commentStart": 0
}, },
"right": { "right": {
"type": "BinaryExpression", "type": "BinaryExpression",
@ -29,7 +30,8 @@ expression: actual
}, },
"raw": "2", "raw": "2",
"start": 8, "start": 8,
"end": 9 "end": 9,
"commentStart": 8
}, },
"right": { "right": {
"type": "Literal", "type": "Literal",
@ -40,11 +42,14 @@ expression: actual
}, },
"raw": "3", "raw": "3",
"start": 12, "start": 12,
"end": 13 "end": 13,
"commentStart": 12
}, },
"start": 8, "start": 8,
"end": 13 "end": 13,
"commentStart": 8
}, },
"start": 0, "start": 0,
"end": 13 "end": 13,
"commentStart": 0
} }

View File

@ -1,5 +1,5 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
@ -22,27 +22,32 @@ expression: actual
"type": "Identifier", "type": "Identifier",
"name": "distance", "name": "distance",
"start": 0, "start": 0,
"end": 8 "end": 8,
"commentStart": 0
}, },
"right": { "right": {
"type": "Identifier", "type": "Identifier",
"type": "Identifier", "type": "Identifier",
"name": "p", "name": "p",
"start": 11, "start": 11,
"end": 12 "end": 12,
"commentStart": 11
}, },
"start": 0, "start": 0,
"end": 12 "end": 12,
"commentStart": 0
}, },
"right": { "right": {
"type": "Identifier", "type": "Identifier",
"type": "Identifier", "type": "Identifier",
"name": "FOS", "name": "FOS",
"start": 15, "start": 15,
"end": 18 "end": 18,
"commentStart": 15
}, },
"start": 0, "start": 0,
"end": 18 "end": 18,
"commentStart": 0
}, },
"right": { "right": {
"type": "Literal", "type": "Literal",
@ -53,10 +58,12 @@ expression: actual
}, },
"raw": "6", "raw": "6",
"start": 21, "start": 21,
"end": 22 "end": 22,
"commentStart": 21
}, },
"start": 0, "start": 0,
"end": 22 "end": 22,
"commentStart": 0
}, },
"right": { "right": {
"type": "BinaryExpression", "type": "BinaryExpression",
@ -67,18 +74,22 @@ expression: actual
"type": "Identifier", "type": "Identifier",
"name": "sigmaAllow", "name": "sigmaAllow",
"start": 26, "start": 26,
"end": 36 "end": 36,
"commentStart": 26
}, },
"right": { "right": {
"type": "Identifier", "type": "Identifier",
"type": "Identifier", "type": "Identifier",
"name": "width", "name": "width",
"start": 39, "start": 39,
"end": 44 "end": 44,
"commentStart": 39
}, },
"start": 26, "start": 26,
"end": 44 "end": 44,
"commentStart": 26
}, },
"start": 0, "start": 0,
"end": 44 "end": 44,
"commentStart": 0
} }

View File

@ -1,5 +1,5 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
@ -14,7 +14,8 @@ expression: actual
}, },
"raw": "2", "raw": "2",
"start": 0, "start": 0,
"end": 1 "end": 1,
"commentStart": 0
}, },
"right": { "right": {
"type": "Literal", "type": "Literal",
@ -25,8 +26,10 @@ expression: actual
}, },
"raw": "3", "raw": "3",
"start": 7, "start": 7,
"end": 8 "end": 8,
"commentStart": 7
}, },
"start": 0, "start": 0,
"end": 8 "end": 8,
"commentStart": 0
} }

View File

@ -5,9 +5,12 @@ expression: actual
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 0,
"end": 170, "end": 170,
"id": { "id": {
"commentStart": 0,
"end": 9, "end": 9,
"name": "boxSketch", "name": "boxSketch",
"start": 0, "start": 0,
@ -18,6 +21,7 @@ expression: actual
{ {
"arguments": [ "arguments": [
{ {
"commentStart": 26,
"end": 28, "end": 28,
"name": "XY", "name": "XY",
"start": 26, "start": 26,
@ -26,11 +30,13 @@ expression: actual
} }
], ],
"callee": { "callee": {
"commentStart": 12,
"end": 25, "end": 25,
"name": "startSketchOn", "name": "startSketchOn",
"start": 12, "start": 12,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 12,
"end": 29, "end": 29,
"start": 12, "start": 12,
"type": "CallExpression", "type": "CallExpression",
@ -39,8 +45,10 @@ expression: actual
{ {
"arguments": [ "arguments": [
{ {
"commentStart": 52,
"elements": [ "elements": [
{ {
"commentStart": 53,
"end": 54, "end": 54,
"raw": "0", "raw": "0",
"start": 53, "start": 53,
@ -52,6 +60,7 @@ expression: actual
} }
}, },
{ {
"commentStart": 56,
"end": 57, "end": 57,
"raw": "0", "raw": "0",
"start": 56, "start": 56,
@ -69,6 +78,7 @@ expression: actual
"type": "ArrayExpression" "type": "ArrayExpression"
}, },
{ {
"commentStart": 60,
"end": 61, "end": 61,
"start": 60, "start": 60,
"type": "PipeSubstitution", "type": "PipeSubstitution",
@ -76,11 +86,13 @@ expression: actual
} }
], ],
"callee": { "callee": {
"commentStart": 37,
"end": 51, "end": 51,
"name": "startProfileAt", "name": "startProfileAt",
"start": 37, "start": 37,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 37,
"end": 62, "end": 62,
"start": 37, "start": 37,
"type": "CallExpression", "type": "CallExpression",
@ -89,8 +101,10 @@ expression: actual
{ {
"arguments": [ "arguments": [
{ {
"commentStart": 75,
"elements": [ "elements": [
{ {
"commentStart": 76,
"end": 77, "end": 77,
"raw": "0", "raw": "0",
"start": 76, "start": 76,
@ -102,6 +116,7 @@ expression: actual
} }
}, },
{ {
"commentStart": 79,
"end": 81, "end": 81,
"raw": "10", "raw": "10",
"start": 79, "start": 79,
@ -119,6 +134,7 @@ expression: actual
"type": "ArrayExpression" "type": "ArrayExpression"
}, },
{ {
"commentStart": 84,
"end": 85, "end": 85,
"start": 84, "start": 84,
"type": "PipeSubstitution", "type": "PipeSubstitution",
@ -126,11 +142,13 @@ expression: actual
} }
], ],
"callee": { "callee": {
"commentStart": 70,
"end": 74, "end": 74,
"name": "line", "name": "line",
"start": 70, "start": 70,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 70,
"end": 86, "end": 86,
"start": 70, "start": 70,
"type": "CallExpression", "type": "CallExpression",
@ -139,9 +157,11 @@ expression: actual
{ {
"arguments": [ "arguments": [
{ {
"commentStart": 108,
"elements": [ "elements": [
{ {
"argument": { "argument": {
"commentStart": 110,
"end": 111, "end": 111,
"raw": "5", "raw": "5",
"start": 110, "start": 110,
@ -152,6 +172,7 @@ expression: actual
"suffix": "None" "suffix": "None"
} }
}, },
"commentStart": 109,
"end": 111, "end": 111,
"operator": "-", "operator": "-",
"start": 109, "start": 109,
@ -159,6 +180,7 @@ expression: actual
"type": "UnaryExpression" "type": "UnaryExpression"
}, },
{ {
"commentStart": 113,
"end": 114, "end": 114,
"raw": "5", "raw": "5",
"start": 113, "start": 113,
@ -176,6 +198,7 @@ expression: actual
"type": "ArrayExpression" "type": "ArrayExpression"
}, },
{ {
"commentStart": 117,
"end": 118, "end": 118,
"start": 117, "start": 117,
"type": "PipeSubstitution", "type": "PipeSubstitution",
@ -183,11 +206,13 @@ expression: actual
} }
], ],
"callee": { "callee": {
"commentStart": 94,
"end": 107, "end": 107,
"name": "tangentialArc", "name": "tangentialArc",
"start": 94, "start": 94,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 94,
"end": 119, "end": 119,
"start": 94, "start": 94,
"type": "CallExpression", "type": "CallExpression",
@ -196,8 +221,10 @@ expression: actual
{ {
"arguments": [ "arguments": [
{ {
"commentStart": 132,
"elements": [ "elements": [
{ {
"commentStart": 133,
"end": 134, "end": 134,
"raw": "5", "raw": "5",
"start": 133, "start": 133,
@ -210,6 +237,7 @@ expression: actual
}, },
{ {
"argument": { "argument": {
"commentStart": 137,
"end": 139, "end": 139,
"raw": "15", "raw": "15",
"start": 137, "start": 137,
@ -220,6 +248,7 @@ expression: actual
"suffix": "None" "suffix": "None"
} }
}, },
"commentStart": 136,
"end": 139, "end": 139,
"operator": "-", "operator": "-",
"start": 136, "start": 136,
@ -233,6 +262,7 @@ expression: actual
"type": "ArrayExpression" "type": "ArrayExpression"
}, },
{ {
"commentStart": 142,
"end": 143, "end": 143,
"start": 142, "start": 142,
"type": "PipeSubstitution", "type": "PipeSubstitution",
@ -240,11 +270,13 @@ expression: actual
} }
], ],
"callee": { "callee": {
"commentStart": 127,
"end": 131, "end": 131,
"name": "line", "name": "line",
"start": 127, "start": 127,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 127,
"end": 144, "end": 144,
"start": 127, "start": 127,
"type": "CallExpression", "type": "CallExpression",
@ -255,12 +287,14 @@ expression: actual
{ {
"type": "LabeledArg", "type": "LabeledArg",
"label": { "label": {
"commentStart": 160,
"end": 166, "end": 166,
"name": "length", "name": "length",
"start": 160, "start": 160,
"type": "Identifier" "type": "Identifier"
}, },
"arg": { "arg": {
"commentStart": 167,
"end": 169, "end": 169,
"raw": "10", "raw": "10",
"start": 167, "start": 167,
@ -274,11 +308,13 @@ expression: actual
} }
], ],
"callee": { "callee": {
"commentStart": 152,
"end": 159, "end": 159,
"name": "extrude", "name": "extrude",
"start": 152, "start": 152,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 152,
"end": 170, "end": 170,
"start": 152, "start": 152,
"type": "CallExpressionKw", "type": "CallExpressionKw",
@ -286,6 +322,7 @@ expression: actual
"unlabeled": null "unlabeled": null
} }
], ],
"commentStart": 12,
"end": 170, "end": 170,
"start": 12, "start": 12,
"type": "PipeExpression", "type": "PipeExpression",
@ -301,6 +338,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 171, "end": 171,
"start": 0 "start": 0
} }

View File

@ -1,13 +1,16 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 0,
"end": 11, "end": 11,
"id": { "id": {
"commentStart": 0,
"end": 2, "end": 2,
"name": "sg", "name": "sg",
"start": 0, "start": 0,
@ -15,12 +18,14 @@ expression: actual
}, },
"init": { "init": {
"argument": { "argument": {
"commentStart": 6,
"end": 11, "end": 11,
"name": "scale", "name": "scale",
"start": 6, "start": 6,
"type": "Identifier", "type": "Identifier",
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 5,
"end": 11, "end": 11,
"operator": "-", "operator": "-",
"start": 5, "start": 5,
@ -37,6 +42,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 11, "end": 11,
"start": 0 "start": 0
} }

View File

@ -5,20 +5,24 @@ expression: actual
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"end": 27, "end": 27,
"expression": { "expression": {
"arguments": [ "arguments": [
{ {
"type": "LabeledArg", "type": "LabeledArg",
"label": { "label": {
"commentStart": 5,
"end": 16, "end": 16,
"name": "endAbsolute", "name": "endAbsolute",
"start": 5, "start": 5,
"type": "Identifier" "type": "Identifier"
}, },
"arg": { "arg": {
"commentStart": 19,
"elements": [ "elements": [
{ {
"commentStart": 20,
"end": 21, "end": 21,
"raw": "0", "raw": "0",
"start": 20, "start": 20,
@ -31,6 +35,7 @@ expression: actual
}, },
{ {
"argument": { "argument": {
"commentStart": 24,
"end": 25, "end": 25,
"raw": "1", "raw": "1",
"start": 24, "start": 24,
@ -41,6 +46,7 @@ expression: actual
"suffix": "None" "suffix": "None"
} }
}, },
"commentStart": 23,
"end": 25, "end": 25,
"operator": "-", "operator": "-",
"start": 23, "start": 23,
@ -56,11 +62,13 @@ expression: actual
} }
], ],
"callee": { "callee": {
"commentStart": 0,
"end": 4, "end": 4,
"name": "line", "name": "line",
"start": 0, "start": 0,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 0,
"end": 27, "end": 27,
"start": 0, "start": 0,
"type": "CallExpressionKw", "type": "CallExpressionKw",
@ -72,6 +80,7 @@ expression: actual
"type": "ExpressionStatement" "type": "ExpressionStatement"
} }
], ],
"commentStart": 0,
"end": 27, "end": 27,
"start": 0 "start": 0
} }

View File

@ -1,21 +1,26 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 0,
"end": 17, "end": 17,
"id": { "id": {
"commentStart": 0,
"end": 7, "end": 7,
"name": "myArray", "name": "myArray",
"start": 0, "start": 0,
"type": "Identifier" "type": "Identifier"
}, },
"init": { "init": {
"commentStart": 10,
"end": 17, "end": 17,
"endElement": { "endElement": {
"commentStart": 14,
"end": 16, "end": 16,
"raw": "10", "raw": "10",
"start": 14, "start": 14,
@ -29,6 +34,7 @@ expression: actual
"endInclusive": true, "endInclusive": true,
"start": 10, "start": 10,
"startElement": { "startElement": {
"commentStart": 11,
"end": 12, "end": 12,
"raw": "0", "raw": "0",
"start": 11, "start": 11,
@ -52,6 +58,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 17, "end": 17,
"start": 0 "start": 0
} }

View File

@ -1,13 +1,16 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
"body": [ "body": [
{ {
"commentStart": 5,
"declaration": { "declaration": {
"commentStart": 8,
"end": 57, "end": 57,
"id": { "id": {
"commentStart": 8,
"end": 24, "end": 24,
"name": "firstPrimeNumber", "name": "firstPrimeNumber",
"start": 8, "start": 8,
@ -18,6 +21,7 @@ expression: actual
"body": [ "body": [
{ {
"argument": { "argument": {
"commentStart": 50,
"end": 51, "end": 51,
"raw": "2", "raw": "2",
"start": 50, "start": 50,
@ -28,15 +32,18 @@ expression: actual
"suffix": "None" "suffix": "None"
} }
}, },
"commentStart": 43,
"end": 51, "end": 51,
"start": 43, "start": 43,
"type": "ReturnStatement", "type": "ReturnStatement",
"type": "ReturnStatement" "type": "ReturnStatement"
} }
], ],
"commentStart": 33,
"end": 57, "end": 57,
"start": 33 "start": 33
}, },
"commentStart": 27,
"end": 57, "end": 57,
"params": [], "params": [],
"start": 27, "start": 27,
@ -53,15 +60,18 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
}, },
{ {
"commentStart": 62,
"end": 80, "end": 80,
"expression": { "expression": {
"arguments": [], "arguments": [],
"callee": { "callee": {
"commentStart": 62,
"end": 78, "end": 78,
"name": "firstPrimeNumber", "name": "firstPrimeNumber",
"start": 62, "start": 62,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 62,
"end": 80, "end": 80,
"start": 62, "start": 62,
"type": "CallExpression", "type": "CallExpression",
@ -72,6 +82,7 @@ expression: actual
"type": "ExpressionStatement" "type": "ExpressionStatement"
} }
], ],
"commentStart": 0,
"end": 80, "end": 80,
"start": 0 "start": 0
} }

View File

@ -1,13 +1,16 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 3,
"end": 49, "end": 49,
"id": { "id": {
"commentStart": 3,
"end": 8, "end": 8,
"name": "thing", "name": "thing",
"start": 3, "start": 3,
@ -18,6 +21,7 @@ expression: actual
"body": [ "body": [
{ {
"argument": { "argument": {
"commentStart": 39,
"end": 43, "end": 43,
"raw": "true", "raw": "true",
"start": 39, "start": 39,
@ -25,20 +29,24 @@ expression: actual
"type": "Literal", "type": "Literal",
"value": true "value": true
}, },
"commentStart": 32,
"end": 43, "end": 43,
"start": 32, "start": 32,
"type": "ReturnStatement", "type": "ReturnStatement",
"type": "ReturnStatement" "type": "ReturnStatement"
} }
], ],
"commentStart": 22,
"end": 49, "end": 49,
"start": 22 "start": 22
}, },
"commentStart": 11,
"end": 49, "end": 49,
"params": [ "params": [
{ {
"type": "Parameter", "type": "Parameter",
"identifier": { "identifier": {
"commentStart": 12,
"end": 17, "end": 17,
"name": "param", "name": "param",
"start": 12, "start": 12,
@ -60,10 +68,12 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
}, },
{ {
"commentStart": 54,
"end": 66, "end": 66,
"expression": { "expression": {
"arguments": [ "arguments": [
{ {
"commentStart": 60,
"end": 65, "end": 65,
"raw": "false", "raw": "false",
"start": 60, "start": 60,
@ -73,11 +83,13 @@ expression: actual
} }
], ],
"callee": { "callee": {
"commentStart": 54,
"end": 59, "end": 59,
"name": "thing", "name": "thing",
"start": 54, "start": 54,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 54,
"end": 66, "end": 66,
"start": 54, "start": 54,
"type": "CallExpression", "type": "CallExpression",
@ -88,6 +100,7 @@ expression: actual
"type": "ExpressionStatement" "type": "ExpressionStatement"
} }
], ],
"commentStart": 0,
"end": 66, "end": 66,
"start": 0 "start": 0
} }

View File

@ -5,9 +5,12 @@ expression: actual
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 0,
"end": 230, "end": 230,
"id": { "id": {
"commentStart": 0,
"end": 8, "end": 8,
"name": "mySketch", "name": "mySketch",
"start": 0, "start": 0,
@ -18,6 +21,7 @@ expression: actual
{ {
"arguments": [ "arguments": [
{ {
"commentStart": 25,
"end": 27, "end": 27,
"name": "XY", "name": "XY",
"start": 25, "start": 25,
@ -26,11 +30,13 @@ expression: actual
} }
], ],
"callee": { "callee": {
"commentStart": 11,
"end": 24, "end": 24,
"name": "startSketchOn", "name": "startSketchOn",
"start": 11, "start": 11,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 11,
"end": 28, "end": 28,
"start": 11, "start": 11,
"type": "CallExpression", "type": "CallExpression",
@ -39,8 +45,10 @@ expression: actual
{ {
"arguments": [ "arguments": [
{ {
"commentStart": 55,
"elements": [ "elements": [
{ {
"commentStart": 56,
"end": 57, "end": 57,
"raw": "0", "raw": "0",
"start": 56, "start": 56,
@ -52,6 +60,7 @@ expression: actual
} }
}, },
{ {
"commentStart": 58,
"end": 59, "end": 59,
"raw": "0", "raw": "0",
"start": 58, "start": 58,
@ -69,6 +78,7 @@ expression: actual
"type": "ArrayExpression" "type": "ArrayExpression"
}, },
{ {
"commentStart": 62,
"end": 63, "end": 63,
"start": 62, "start": 62,
"type": "PipeSubstitution", "type": "PipeSubstitution",
@ -76,11 +86,13 @@ expression: actual
} }
], ],
"callee": { "callee": {
"commentStart": 40,
"end": 54, "end": 54,
"name": "startProfileAt", "name": "startProfileAt",
"start": 40, "start": 40,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 40,
"end": 64, "end": 64,
"start": 40, "start": 40,
"type": "CallExpression", "type": "CallExpression",
@ -91,14 +103,17 @@ expression: actual
{ {
"type": "LabeledArg", "type": "LabeledArg",
"label": { "label": {
"commentStart": 81,
"end": 92, "end": 92,
"name": "endAbsolute", "name": "endAbsolute",
"start": 81, "start": 81,
"type": "Identifier" "type": "Identifier"
}, },
"arg": { "arg": {
"commentStart": 95,
"elements": [ "elements": [
{ {
"commentStart": 96,
"end": 97, "end": 97,
"raw": "0", "raw": "0",
"start": 96, "start": 96,
@ -110,6 +125,7 @@ expression: actual
} }
}, },
{ {
"commentStart": 99,
"end": 100, "end": 100,
"raw": "1", "raw": "1",
"start": 99, "start": 99,
@ -130,12 +146,14 @@ expression: actual
{ {
"type": "LabeledArg", "type": "LabeledArg",
"label": { "label": {
"commentStart": 103,
"end": 106, "end": 106,
"name": "tag", "name": "tag",
"start": 103, "start": 103,
"type": "Identifier" "type": "Identifier"
}, },
"arg": { "arg": {
"commentStart": 109,
"end": 116, "end": 116,
"start": 109, "start": 109,
"type": "TagDeclarator", "type": "TagDeclarator",
@ -145,11 +163,13 @@ expression: actual
} }
], ],
"callee": { "callee": {
"commentStart": 76,
"end": 80, "end": 80,
"name": "line", "name": "line",
"start": 76, "start": 76,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 76,
"end": 117, "end": 117,
"start": 76, "start": 76,
"type": "CallExpressionKw", "type": "CallExpressionKw",
@ -161,14 +181,17 @@ expression: actual
{ {
"type": "LabeledArg", "type": "LabeledArg",
"label": { "label": {
"commentStart": 134,
"end": 145, "end": 145,
"name": "endAbsolute", "name": "endAbsolute",
"start": 134, "start": 134,
"type": "Identifier" "type": "Identifier"
}, },
"arg": { "arg": {
"commentStart": 148,
"elements": [ "elements": [
{ {
"commentStart": 149,
"end": 150, "end": 150,
"raw": "1", "raw": "1",
"start": 149, "start": 149,
@ -180,6 +203,7 @@ expression: actual
} }
}, },
{ {
"commentStart": 152,
"end": 153, "end": 153,
"raw": "1", "raw": "1",
"start": 152, "start": 152,
@ -199,11 +223,13 @@ expression: actual
} }
], ],
"callee": { "callee": {
"commentStart": 129,
"end": 133, "end": 133,
"name": "line", "name": "line",
"start": 129, "start": 129,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 129,
"end": 155, "end": 155,
"start": 129, "start": 129,
"type": "CallExpressionKw", "type": "CallExpressionKw",
@ -215,14 +241,17 @@ expression: actual
{ {
"type": "LabeledArg", "type": "LabeledArg",
"label": { "label": {
"commentStart": 172,
"end": 183, "end": 183,
"name": "endAbsolute", "name": "endAbsolute",
"start": 172, "start": 172,
"type": "Identifier" "type": "Identifier"
}, },
"arg": { "arg": {
"commentStart": 186,
"elements": [ "elements": [
{ {
"commentStart": 187,
"end": 188, "end": 188,
"raw": "1", "raw": "1",
"start": 187, "start": 187,
@ -234,6 +263,7 @@ expression: actual
} }
}, },
{ {
"commentStart": 190,
"end": 191, "end": 191,
"raw": "0", "raw": "0",
"start": 190, "start": 190,
@ -254,12 +284,14 @@ expression: actual
{ {
"type": "LabeledArg", "type": "LabeledArg",
"label": { "label": {
"commentStart": 194,
"end": 197, "end": 197,
"name": "tag", "name": "tag",
"start": 194, "start": 194,
"type": "Identifier" "type": "Identifier"
}, },
"arg": { "arg": {
"commentStart": 200,
"end": 210, "end": 210,
"start": 200, "start": 200,
"type": "TagDeclarator", "type": "TagDeclarator",
@ -269,11 +301,13 @@ expression: actual
} }
], ],
"callee": { "callee": {
"commentStart": 167,
"end": 171, "end": 171,
"name": "line", "name": "line",
"start": 167, "start": 167,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 167,
"end": 211, "end": 211,
"start": 167, "start": 167,
"type": "CallExpressionKw", "type": "CallExpressionKw",
@ -283,17 +317,20 @@ expression: actual
{ {
"arguments": [], "arguments": [],
"callee": { "callee": {
"commentStart": 223,
"end": 228, "end": 228,
"name": "close", "name": "close",
"start": 223, "start": 223,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 223,
"end": 230, "end": 230,
"start": 223, "start": 223,
"type": "CallExpression", "type": "CallExpression",
"type": "CallExpression" "type": "CallExpression"
} }
], ],
"commentStart": 11,
"end": 230, "end": 230,
"start": 11, "start": 11,
"type": "PipeExpression", "type": "PipeExpression",
@ -309,6 +346,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 230, "end": 230,
"start": 0 "start": 0
} }

View File

@ -5,9 +5,12 @@ expression: actual
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 0,
"end": 97, "end": 97,
"id": { "id": {
"commentStart": 0,
"end": 8, "end": 8,
"name": "mySketch", "name": "mySketch",
"start": 0, "start": 0,
@ -18,6 +21,7 @@ expression: actual
{ {
"arguments": [ "arguments": [
{ {
"commentStart": 25,
"end": 27, "end": 27,
"name": "XY", "name": "XY",
"start": 25, "start": 25,
@ -26,11 +30,13 @@ expression: actual
} }
], ],
"callee": { "callee": {
"commentStart": 11,
"end": 24, "end": 24,
"name": "startSketchOn", "name": "startSketchOn",
"start": 11, "start": 11,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 11,
"end": 28, "end": 28,
"start": 11, "start": 11,
"type": "CallExpression", "type": "CallExpression",
@ -39,8 +45,10 @@ expression: actual
{ {
"arguments": [ "arguments": [
{ {
"commentStart": 47,
"elements": [ "elements": [
{ {
"commentStart": 48,
"end": 49, "end": 49,
"raw": "0", "raw": "0",
"start": 48, "start": 48,
@ -52,6 +60,7 @@ expression: actual
} }
}, },
{ {
"commentStart": 50,
"end": 51, "end": 51,
"raw": "0", "raw": "0",
"start": 50, "start": 50,
@ -69,6 +78,7 @@ expression: actual
"type": "ArrayExpression" "type": "ArrayExpression"
}, },
{ {
"commentStart": 54,
"end": 55, "end": 55,
"start": 54, "start": 54,
"type": "PipeSubstitution", "type": "PipeSubstitution",
@ -76,11 +86,13 @@ expression: actual
} }
], ],
"callee": { "callee": {
"commentStart": 32,
"end": 46, "end": 46,
"name": "startProfileAt", "name": "startProfileAt",
"start": 32, "start": 32,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 32,
"end": 56, "end": 56,
"start": 32, "start": 32,
"type": "CallExpression", "type": "CallExpression",
@ -91,14 +103,17 @@ expression: actual
{ {
"type": "LabeledArg", "type": "LabeledArg",
"label": { "label": {
"commentStart": 65,
"end": 76, "end": 76,
"name": "endAbsolute", "name": "endAbsolute",
"start": 65, "start": 65,
"type": "Identifier" "type": "Identifier"
}, },
"arg": { "arg": {
"commentStart": 79,
"elements": [ "elements": [
{ {
"commentStart": 80,
"end": 81, "end": 81,
"raw": "1", "raw": "1",
"start": 80, "start": 80,
@ -110,6 +125,7 @@ expression: actual
} }
}, },
{ {
"commentStart": 83,
"end": 84, "end": 84,
"raw": "1", "raw": "1",
"start": 83, "start": 83,
@ -129,11 +145,13 @@ expression: actual
} }
], ],
"callee": { "callee": {
"commentStart": 60,
"end": 64, "end": 64,
"name": "line", "name": "line",
"start": 60, "start": 60,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 60,
"end": 86, "end": 86,
"start": 60, "start": 60,
"type": "CallExpressionKw", "type": "CallExpressionKw",
@ -143,17 +161,20 @@ expression: actual
{ {
"arguments": [], "arguments": [],
"callee": { "callee": {
"commentStart": 90,
"end": 95, "end": 95,
"name": "close", "name": "close",
"start": 90, "start": 90,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 90,
"end": 97, "end": 97,
"start": 90, "start": 90,
"type": "CallExpression", "type": "CallExpression",
"type": "CallExpression" "type": "CallExpression"
} }
], ],
"commentStart": 11,
"end": 97, "end": 97,
"start": 11, "start": 11,
"type": "PipeExpression", "type": "PipeExpression",
@ -169,6 +190,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 97, "end": 97,
"start": 0 "start": 0
} }

View File

@ -5,9 +5,12 @@ expression: actual
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 0,
"end": 49, "end": 49,
"id": { "id": {
"commentStart": 0,
"end": 5, "end": 5,
"name": "myBox", "name": "myBox",
"start": 0, "start": 0,
@ -18,6 +21,7 @@ expression: actual
{ {
"arguments": [ "arguments": [
{ {
"commentStart": 22,
"end": 24, "end": 24,
"name": "XY", "name": "XY",
"start": 22, "start": 22,
@ -26,11 +30,13 @@ expression: actual
} }
], ],
"callee": { "callee": {
"commentStart": 8,
"end": 21, "end": 21,
"name": "startSketchOn", "name": "startSketchOn",
"start": 8, "start": 8,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 8,
"end": 25, "end": 25,
"start": 8, "start": 8,
"type": "CallExpression", "type": "CallExpression",
@ -39,6 +45,7 @@ expression: actual
{ {
"arguments": [ "arguments": [
{ {
"commentStart": 44,
"end": 45, "end": 45,
"name": "p", "name": "p",
"start": 44, "start": 44,
@ -46,6 +53,7 @@ expression: actual
"type": "Identifier" "type": "Identifier"
}, },
{ {
"commentStart": 47,
"end": 48, "end": 48,
"start": 47, "start": 47,
"type": "PipeSubstitution", "type": "PipeSubstitution",
@ -53,17 +61,20 @@ expression: actual
} }
], ],
"callee": { "callee": {
"commentStart": 29,
"end": 43, "end": 43,
"name": "startProfileAt", "name": "startProfileAt",
"start": 29, "start": 29,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 29,
"end": 49, "end": 49,
"start": 29, "start": 29,
"type": "CallExpression", "type": "CallExpression",
"type": "CallExpression" "type": "CallExpression"
} }
], ],
"commentStart": 8,
"end": 49, "end": 49,
"start": 8, "start": 8,
"type": "PipeExpression", "type": "PipeExpression",
@ -79,6 +90,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 49, "end": 49,
"start": 0 "start": 0
} }

View File

@ -1,13 +1,16 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 0,
"end": 23, "end": 23,
"id": { "id": {
"commentStart": 0,
"end": 5, "end": 5,
"name": "myBox", "name": "myBox",
"start": 0, "start": 0,
@ -18,6 +21,7 @@ expression: actual
{ {
"arguments": [ "arguments": [
{ {
"commentStart": 10,
"end": 11, "end": 11,
"raw": "1", "raw": "1",
"start": 10, "start": 10,
@ -30,11 +34,13 @@ expression: actual
} }
], ],
"callee": { "callee": {
"commentStart": 8,
"end": 9, "end": 9,
"name": "f", "name": "f",
"start": 8, "start": 8,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 8,
"end": 12, "end": 12,
"start": 8, "start": 8,
"type": "CallExpression", "type": "CallExpression",
@ -43,6 +49,7 @@ expression: actual
{ {
"arguments": [ "arguments": [
{ {
"commentStart": 18,
"end": 19, "end": 19,
"raw": "2", "raw": "2",
"start": 18, "start": 18,
@ -54,6 +61,7 @@ expression: actual
} }
}, },
{ {
"commentStart": 21,
"end": 22, "end": 22,
"start": 21, "start": 21,
"type": "PipeSubstitution", "type": "PipeSubstitution",
@ -61,17 +69,20 @@ expression: actual
} }
], ],
"callee": { "callee": {
"commentStart": 16,
"end": 17, "end": 17,
"name": "g", "name": "g",
"start": 16, "start": 16,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 16,
"end": 23, "end": 23,
"start": 16, "start": 16,
"type": "CallExpression", "type": "CallExpression",
"type": "CallExpression" "type": "CallExpression"
} }
], ],
"commentStart": 8,
"end": 23, "end": 23,
"start": 8, "start": 8,
"type": "PipeExpression", "type": "PipeExpression",
@ -87,6 +98,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 23, "end": 23,
"start": 0 "start": 0
} }

View File

@ -5,9 +5,12 @@ expression: actual
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 0,
"end": 71, "end": 71,
"id": { "id": {
"commentStart": 0,
"end": 5, "end": 5,
"name": "myBox", "name": "myBox",
"start": 0, "start": 0,
@ -18,6 +21,7 @@ expression: actual
{ {
"arguments": [ "arguments": [
{ {
"commentStart": 22,
"end": 24, "end": 24,
"name": "XY", "name": "XY",
"start": 22, "start": 22,
@ -26,11 +30,13 @@ expression: actual
} }
], ],
"callee": { "callee": {
"commentStart": 8,
"end": 21, "end": 21,
"name": "startSketchOn", "name": "startSketchOn",
"start": 8, "start": 8,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 8,
"end": 25, "end": 25,
"start": 8, "start": 8,
"type": "CallExpression", "type": "CallExpression",
@ -39,6 +45,7 @@ expression: actual
{ {
"arguments": [ "arguments": [
{ {
"commentStart": 44,
"end": 45, "end": 45,
"name": "p", "name": "p",
"start": 44, "start": 44,
@ -46,6 +53,7 @@ expression: actual
"type": "Identifier" "type": "Identifier"
}, },
{ {
"commentStart": 47,
"end": 48, "end": 48,
"start": 47, "start": 47,
"type": "PipeSubstitution", "type": "PipeSubstitution",
@ -53,11 +61,13 @@ expression: actual
} }
], ],
"callee": { "callee": {
"commentStart": 29,
"end": 43, "end": 43,
"name": "startProfileAt", "name": "startProfileAt",
"start": 29, "start": 29,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 29,
"end": 49, "end": 49,
"start": 29, "start": 29,
"type": "CallExpression", "type": "CallExpression",
@ -68,14 +78,17 @@ expression: actual
{ {
"type": "LabeledArg", "type": "LabeledArg",
"label": { "label": {
"commentStart": 58,
"end": 61, "end": 61,
"name": "end", "name": "end",
"start": 58, "start": 58,
"type": "Identifier" "type": "Identifier"
}, },
"arg": { "arg": {
"commentStart": 64,
"elements": [ "elements": [
{ {
"commentStart": 65,
"end": 66, "end": 66,
"raw": "0", "raw": "0",
"start": 65, "start": 65,
@ -87,6 +100,7 @@ expression: actual
} }
}, },
{ {
"commentStart": 68,
"end": 69, "end": 69,
"name": "l", "name": "l",
"start": 68, "start": 68,
@ -102,11 +116,13 @@ expression: actual
} }
], ],
"callee": { "callee": {
"commentStart": 53,
"end": 57, "end": 57,
"name": "line", "name": "line",
"start": 53, "start": 53,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 53,
"end": 71, "end": 71,
"start": 53, "start": 53,
"type": "CallExpressionKw", "type": "CallExpressionKw",
@ -114,6 +130,7 @@ expression: actual
"unlabeled": null "unlabeled": null
} }
], ],
"commentStart": 8,
"end": 71, "end": 71,
"start": 8, "start": 8,
"type": "PipeExpression", "type": "PipeExpression",
@ -129,6 +146,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 71, "end": 71,
"start": 0 "start": 0
} }

View File

@ -5,20 +5,24 @@ expression: actual
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"end": 26, "end": 26,
"expression": { "expression": {
"arguments": [ "arguments": [
{ {
"type": "LabeledArg", "type": "LabeledArg",
"label": { "label": {
"commentStart": 5,
"end": 16, "end": 16,
"name": "endAbsolute", "name": "endAbsolute",
"start": 5, "start": 5,
"type": "Identifier" "type": "Identifier"
}, },
"arg": { "arg": {
"commentStart": 19,
"elements": [ "elements": [
{ {
"commentStart": 20,
"end": 21, "end": 21,
"raw": "0", "raw": "0",
"start": 20, "start": 20,
@ -30,6 +34,7 @@ expression: actual
} }
}, },
{ {
"commentStart": 23,
"end": 24, "end": 24,
"raw": "1", "raw": "1",
"start": 23, "start": 23,
@ -49,11 +54,13 @@ expression: actual
} }
], ],
"callee": { "callee": {
"commentStart": 0,
"end": 4, "end": 4,
"name": "line", "name": "line",
"start": 0, "start": 0,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 0,
"end": 26, "end": 26,
"start": 0, "start": 0,
"type": "CallExpressionKw", "type": "CallExpressionKw",
@ -65,6 +72,7 @@ expression: actual
"type": "ExpressionStatement" "type": "ExpressionStatement"
} }
], ],
"commentStart": 0,
"end": 26, "end": 26,
"start": 0 "start": 0
} }

View File

@ -5,9 +5,12 @@ expression: actual
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 0,
"end": 56, "end": 56,
"id": { "id": {
"commentStart": 0,
"end": 8, "end": 8,
"name": "mySketch", "name": "mySketch",
"start": 0, "start": 0,
@ -18,6 +21,7 @@ expression: actual
{ {
"arguments": [ "arguments": [
{ {
"commentStart": 25,
"end": 27, "end": 27,
"name": "XY", "name": "XY",
"start": 25, "start": 25,
@ -26,11 +30,13 @@ expression: actual
} }
], ],
"callee": { "callee": {
"commentStart": 11,
"end": 24, "end": 24,
"name": "startSketchOn", "name": "startSketchOn",
"start": 11, "start": 11,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 11,
"end": 28, "end": 28,
"start": 11, "start": 11,
"type": "CallExpression", "type": "CallExpression",
@ -39,8 +45,10 @@ expression: actual
{ {
"arguments": [ "arguments": [
{ {
"commentStart": 47,
"elements": [ "elements": [
{ {
"commentStart": 48,
"end": 49, "end": 49,
"raw": "0", "raw": "0",
"start": 48, "start": 48,
@ -52,6 +60,7 @@ expression: actual
} }
}, },
{ {
"commentStart": 50,
"end": 51, "end": 51,
"raw": "0", "raw": "0",
"start": 50, "start": 50,
@ -69,6 +78,7 @@ expression: actual
"type": "ArrayExpression" "type": "ArrayExpression"
}, },
{ {
"commentStart": 54,
"end": 55, "end": 55,
"start": 54, "start": 54,
"type": "PipeSubstitution", "type": "PipeSubstitution",
@ -76,17 +86,20 @@ expression: actual
} }
], ],
"callee": { "callee": {
"commentStart": 32,
"end": 46, "end": 46,
"name": "startProfileAt", "name": "startProfileAt",
"start": 32, "start": 32,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 32,
"end": 56, "end": 56,
"start": 32, "start": 32,
"type": "CallExpression", "type": "CallExpression",
"type": "CallExpression" "type": "CallExpression"
} }
], ],
"commentStart": 11,
"end": 56, "end": 56,
"start": 11, "start": 11,
"type": "PipeExpression", "type": "PipeExpression",
@ -102,6 +115,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 56, "end": 56,
"start": 0 "start": 0
} }

View File

@ -1,14 +1,16 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"end": 28, "end": 28,
"expression": { "expression": {
"arguments": [ "arguments": [
{ {
"commentStart": 4,
"end": 5, "end": 5,
"raw": "5", "raw": "5",
"start": 4, "start": 4,
@ -20,6 +22,7 @@ expression: actual
} }
}, },
{ {
"commentStart": 7,
"end": 14, "end": 14,
"raw": "\"hello\"", "raw": "\"hello\"",
"start": 7, "start": 7,
@ -28,6 +31,7 @@ expression: actual
"value": "hello" "value": "hello"
}, },
{ {
"commentStart": 16,
"end": 27, "end": 27,
"name": "aIdentifier", "name": "aIdentifier",
"start": 16, "start": 16,
@ -36,11 +40,13 @@ expression: actual
} }
], ],
"callee": { "callee": {
"commentStart": 0,
"end": 3, "end": 3,
"name": "log", "name": "log",
"start": 0, "start": 0,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 0,
"end": 28, "end": 28,
"start": 0, "start": 0,
"type": "CallExpression", "type": "CallExpression",
@ -51,6 +57,7 @@ expression: actual
"type": "ExpressionStatement" "type": "ExpressionStatement"
} }
], ],
"commentStart": 0,
"end": 28, "end": 28,
"start": 0 "start": 0
} }

View File

@ -1,14 +1,17 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"end": 7, "end": 7,
"expression": { "expression": {
"commentStart": 0,
"end": 7, "end": 7,
"left": { "left": {
"commentStart": 0,
"end": 1, "end": 1,
"raw": "5", "raw": "5",
"start": 0, "start": 0,
@ -21,6 +24,7 @@ expression: actual
}, },
"operator": "+", "operator": "+",
"right": { "right": {
"commentStart": 4,
"end": 7, "end": 7,
"raw": "\"a\"", "raw": "\"a\"",
"start": 4, "start": 4,
@ -37,6 +41,7 @@ expression: actual
"type": "ExpressionStatement" "type": "ExpressionStatement"
} }
], ],
"commentStart": 0,
"end": 7, "end": 7,
"start": 0 "start": 0
} }

View File

@ -1,16 +1,19 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"end": 15, "end": 15,
"expression": { "expression": {
"arguments": [ "arguments": [
{ {
"commentStart": 5,
"elements": [ "elements": [
{ {
"commentStart": 6,
"end": 7, "end": 7,
"raw": "0", "raw": "0",
"start": 6, "start": 6,
@ -22,6 +25,7 @@ expression: actual
} }
}, },
{ {
"commentStart": 9,
"end": 10, "end": 10,
"name": "l", "name": "l",
"start": 9, "start": 9,
@ -35,6 +39,7 @@ expression: actual
"type": "ArrayExpression" "type": "ArrayExpression"
}, },
{ {
"commentStart": 13,
"end": 14, "end": 14,
"start": 13, "start": 13,
"type": "PipeSubstitution", "type": "PipeSubstitution",
@ -42,11 +47,13 @@ expression: actual
} }
], ],
"callee": { "callee": {
"commentStart": 0,
"end": 4, "end": 4,
"name": "line", "name": "line",
"start": 0, "start": 0,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 0,
"end": 15, "end": 15,
"start": 0, "start": 0,
"type": "CallExpression", "type": "CallExpression",
@ -57,6 +64,7 @@ expression: actual
"type": "ExpressionStatement" "type": "ExpressionStatement"
} }
], ],
"commentStart": 0,
"end": 15, "end": 15,
"start": 0 "start": 0
} }

View File

@ -5,9 +5,12 @@ expression: actual
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 6,
"end": 106, "end": 106,
"id": { "id": {
"commentStart": 6,
"end": 14, "end": 14,
"name": "cylinder", "name": "cylinder",
"start": 6, "start": 6,
@ -18,6 +21,7 @@ expression: actual
{ {
"arguments": [ "arguments": [
{ {
"commentStart": 31,
"end": 35, "end": 35,
"raw": "'XY'", "raw": "'XY'",
"start": 31, "start": 31,
@ -27,11 +31,13 @@ expression: actual
} }
], ],
"callee": { "callee": {
"commentStart": 17,
"end": 30, "end": 30,
"name": "startSketchOn", "name": "startSketchOn",
"start": 17, "start": 17,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 17,
"end": 36, "end": 36,
"start": 17, "start": 17,
"type": "CallExpression", "type": "CallExpression",
@ -42,14 +48,17 @@ expression: actual
{ {
"type": "LabeledArg", "type": "LabeledArg",
"label": { "label": {
"commentStart": 51,
"end": 57, "end": 57,
"name": "center", "name": "center",
"start": 51, "start": 51,
"type": "Identifier" "type": "Identifier"
}, },
"arg": { "arg": {
"commentStart": 59,
"elements": [ "elements": [
{ {
"commentStart": 60,
"end": 61, "end": 61,
"raw": "0", "raw": "0",
"start": 60, "start": 60,
@ -61,6 +70,7 @@ expression: actual
} }
}, },
{ {
"commentStart": 63,
"end": 64, "end": 64,
"raw": "0", "raw": "0",
"start": 63, "start": 63,
@ -81,12 +91,14 @@ expression: actual
{ {
"type": "LabeledArg", "type": "LabeledArg",
"label": { "label": {
"commentStart": 67,
"end": 73, "end": 73,
"name": "radius", "name": "radius",
"start": 67, "start": 67,
"type": "Identifier" "type": "Identifier"
}, },
"arg": { "arg": {
"commentStart": 75,
"end": 77, "end": 77,
"raw": "22", "raw": "22",
"start": 75, "start": 75,
@ -100,11 +112,13 @@ expression: actual
} }
], ],
"callee": { "callee": {
"commentStart": 44,
"end": 50, "end": 50,
"name": "circle", "name": "circle",
"start": 44, "start": 44,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 44,
"end": 78, "end": 78,
"start": 44, "start": 44,
"type": "CallExpressionKw", "type": "CallExpressionKw",
@ -116,12 +130,14 @@ expression: actual
{ {
"type": "LabeledArg", "type": "LabeledArg",
"label": { "label": {
"commentStart": 94,
"end": 100, "end": 100,
"name": "length", "name": "length",
"start": 94, "start": 94,
"type": "Identifier" "type": "Identifier"
}, },
"arg": { "arg": {
"commentStart": 103,
"end": 105, "end": 105,
"raw": "14", "raw": "14",
"start": 103, "start": 103,
@ -135,11 +151,13 @@ expression: actual
} }
], ],
"callee": { "callee": {
"commentStart": 86,
"end": 93, "end": 93,
"name": "extrude", "name": "extrude",
"start": 86, "start": 86,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 86,
"end": 106, "end": 106,
"start": 86, "start": 86,
"type": "CallExpressionKw", "type": "CallExpressionKw",
@ -147,6 +165,7 @@ expression: actual
"unlabeled": null "unlabeled": null
} }
], ],
"commentStart": 17,
"end": 106, "end": 106,
"start": 17, "start": 17,
"type": "PipeExpression", "type": "PipeExpression",
@ -162,6 +181,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 107, "end": 107,
"start": 0 "start": 0
} }

View File

@ -1,13 +1,16 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 3,
"end": 49, "end": 49,
"id": { "id": {
"commentStart": 3,
"end": 4, "end": 4,
"name": "f", "name": "f",
"start": 3, "start": 3,
@ -20,6 +23,7 @@ expression: actual
"argument": { "argument": {
"arguments": [ "arguments": [
{ {
"commentStart": 36,
"end": 41, "end": 41,
"name": "angle", "name": "angle",
"start": 36, "start": 36,
@ -27,6 +31,7 @@ expression: actual
"type": "Identifier" "type": "Identifier"
}, },
{ {
"commentStart": 43,
"end": 46, "end": 46,
"raw": "360", "raw": "360",
"start": 43, "start": 43,
@ -39,30 +44,36 @@ expression: actual
} }
], ],
"callee": { "callee": {
"commentStart": 28,
"end": 35, "end": 35,
"name": "default", "name": "default",
"start": 28, "start": 28,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 28,
"end": 47, "end": 47,
"start": 28, "start": 28,
"type": "CallExpression", "type": "CallExpression",
"type": "CallExpression" "type": "CallExpression"
}, },
"commentStart": 21,
"end": 47, "end": 47,
"start": 21, "start": 21,
"type": "ReturnStatement", "type": "ReturnStatement",
"type": "ReturnStatement" "type": "ReturnStatement"
} }
], ],
"commentStart": 19,
"end": 49, "end": 49,
"start": 19 "start": 19
}, },
"commentStart": 7,
"end": 49, "end": 49,
"params": [ "params": [
{ {
"type": "Parameter", "type": "Parameter",
"identifier": { "identifier": {
"commentStart": 8,
"end": 13, "end": 13,
"name": "angle", "name": "angle",
"start": 8, "start": 8,
@ -89,6 +100,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 49, "end": 49,
"start": 0 "start": 0
} }

View File

@ -1,21 +1,26 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 4,
"end": 91, "end": 91,
"id": { "id": {
"commentStart": 4,
"end": 11, "end": 11,
"name": "numbers", "name": "numbers",
"start": 4, "start": 4,
"type": "Identifier" "type": "Identifier"
}, },
"init": { "init": {
"commentStart": 14,
"elements": [ "elements": [
{ {
"commentStart": 28,
"end": 29, "end": 29,
"raw": "1", "raw": "1",
"start": 28, "start": 28,
@ -27,6 +32,7 @@ expression: actual
} }
}, },
{ {
"commentStart": 79,
"end": 80, "end": 80,
"raw": "3", "raw": "3",
"start": 79, "start": 79,
@ -43,6 +49,7 @@ expression: actual
"nonCodeNodes": { "nonCodeNodes": {
"1": [ "1": [
{ {
"commentStart": 43,
"end": 48, "end": 48,
"start": 43, "start": 43,
"type": "NonCodeNode", "type": "NonCodeNode",
@ -55,6 +62,7 @@ expression: actual
], ],
"2": [ "2": [
{ {
"commentStart": 61,
"end": 66, "end": 66,
"start": 61, "start": 61,
"type": "NonCodeNode", "type": "NonCodeNode",
@ -82,6 +90,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 91, "end": 91,
"start": 0 "start": 0
} }

View File

@ -1,21 +1,26 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 4,
"end": 91, "end": 91,
"id": { "id": {
"commentStart": 4,
"end": 11, "end": 11,
"name": "numbers", "name": "numbers",
"start": 4, "start": 4,
"type": "Identifier" "type": "Identifier"
}, },
"init": { "init": {
"commentStart": 14,
"elements": [ "elements": [
{ {
"commentStart": 28,
"end": 29, "end": 29,
"raw": "1", "raw": "1",
"start": 28, "start": 28,
@ -27,6 +32,7 @@ expression: actual
} }
}, },
{ {
"commentStart": 43,
"end": 44, "end": 44,
"raw": "2", "raw": "2",
"start": 43, "start": 43,
@ -43,6 +49,7 @@ expression: actual
"nonCodeNodes": { "nonCodeNodes": {
"2": [ "2": [
{ {
"commentStart": 58,
"end": 63, "end": 63,
"start": 58, "start": 58,
"type": "NonCodeNode", "type": "NonCodeNode",
@ -55,6 +62,7 @@ expression: actual
], ],
"3": [ "3": [
{ {
"commentStart": 76,
"end": 81, "end": 81,
"start": 76, "start": 76,
"type": "NonCodeNode", "type": "NonCodeNode",
@ -82,6 +90,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 91, "end": 91,
"start": 0 "start": 0
} }

View File

@ -1,24 +1,29 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 4,
"end": 80, "end": 80,
"id": { "id": {
"commentStart": 4,
"end": 9, "end": 9,
"name": "props", "name": "props",
"start": 4, "start": 4,
"type": "Identifier" "type": "Identifier"
}, },
"init": { "init": {
"commentStart": 12,
"end": 80, "end": 80,
"nonCodeMeta": { "nonCodeMeta": {
"nonCodeNodes": { "nonCodeNodes": {
"1": [ "1": [
{ {
"commentStart": 44,
"end": 52, "end": 52,
"start": 44, "start": 44,
"type": "NonCodeNode", "type": "NonCodeNode",
@ -34,8 +39,10 @@ expression: actual
}, },
"properties": [ "properties": [
{ {
"commentStart": 26,
"end": 30, "end": 30,
"key": { "key": {
"commentStart": 26,
"end": 27, "end": 27,
"name": "a", "name": "a",
"start": 26, "start": 26,
@ -44,6 +51,7 @@ expression: actual
"start": 26, "start": 26,
"type": "ObjectProperty", "type": "ObjectProperty",
"value": { "value": {
"commentStart": 29,
"end": 30, "end": 30,
"raw": "1", "raw": "1",
"start": 29, "start": 29,
@ -56,8 +64,10 @@ expression: actual
} }
}, },
{ {
"commentStart": 65,
"end": 69, "end": 69,
"key": { "key": {
"commentStart": 65,
"end": 66, "end": 66,
"name": "c", "name": "c",
"start": 65, "start": 65,
@ -66,6 +76,7 @@ expression: actual
"start": 65, "start": 65,
"type": "ObjectProperty", "type": "ObjectProperty",
"value": { "value": {
"commentStart": 68,
"end": 69, "end": 69,
"raw": "3", "raw": "3",
"start": 68, "start": 68,
@ -92,6 +103,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 80, "end": 80,
"start": 0 "start": 0
} }

View File

@ -1,24 +1,29 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 4,
"end": 79, "end": 79,
"id": { "id": {
"commentStart": 4,
"end": 9, "end": 9,
"name": "props", "name": "props",
"start": 4, "start": 4,
"type": "Identifier" "type": "Identifier"
}, },
"init": { "init": {
"commentStart": 12,
"end": 79, "end": 79,
"nonCodeMeta": { "nonCodeMeta": {
"nonCodeNodes": { "nonCodeNodes": {
"1": [ "1": [
{ {
"commentStart": 44,
"end": 52, "end": 52,
"start": 44, "start": 44,
"type": "NonCodeNode", "type": "NonCodeNode",
@ -34,8 +39,10 @@ expression: actual
}, },
"properties": [ "properties": [
{ {
"commentStart": 26,
"end": 30, "end": 30,
"key": { "key": {
"commentStart": 26,
"end": 27, "end": 27,
"name": "a", "name": "a",
"start": 26, "start": 26,
@ -44,6 +51,7 @@ expression: actual
"start": 26, "start": 26,
"type": "ObjectProperty", "type": "ObjectProperty",
"value": { "value": {
"commentStart": 29,
"end": 30, "end": 30,
"raw": "1", "raw": "1",
"start": 29, "start": 29,
@ -56,8 +64,10 @@ expression: actual
} }
}, },
{ {
"commentStart": 65,
"end": 69, "end": 69,
"key": { "key": {
"commentStart": 65,
"end": 66, "end": 66,
"name": "c", "name": "c",
"start": 65, "start": 65,
@ -66,6 +76,7 @@ expression: actual
"start": 65, "start": 65,
"type": "ObjectProperty", "type": "ObjectProperty",
"value": { "value": {
"commentStart": 68,
"end": 69, "end": 69,
"raw": "3", "raw": "3",
"start": 68, "start": 68,
@ -92,6 +103,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 79, "end": 79,
"start": 0 "start": 0
} }

View File

@ -1,13 +1,16 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 0,
"end": 30, "end": 30,
"id": { "id": {
"commentStart": 0,
"end": 5, "end": 5,
"name": "myVar", "name": "myVar",
"start": 0, "start": 0,
@ -16,6 +19,7 @@ expression: actual
"init": { "init": {
"arguments": [ "arguments": [
{ {
"commentStart": 12,
"end": 13, "end": 13,
"raw": "5", "raw": "5",
"start": 12, "start": 12,
@ -30,6 +34,7 @@ expression: actual
"argument": { "argument": {
"arguments": [ "arguments": [
{ {
"commentStart": 24,
"end": 25, "end": 25,
"raw": "5", "raw": "5",
"start": 24, "start": 24,
@ -41,6 +46,7 @@ expression: actual
} }
}, },
{ {
"commentStart": 27,
"end": 28, "end": 28,
"raw": "4", "raw": "4",
"start": 27, "start": 27,
@ -53,16 +59,19 @@ expression: actual
} }
], ],
"callee": { "callee": {
"commentStart": 17,
"end": 23, "end": 23,
"name": "legLen", "name": "legLen",
"start": 17, "start": 17,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 17,
"end": 29, "end": 29,
"start": 17, "start": 17,
"type": "CallExpression", "type": "CallExpression",
"type": "CallExpression" "type": "CallExpression"
}, },
"commentStart": 16,
"end": 29, "end": 29,
"operator": "-", "operator": "-",
"start": 16, "start": 16,
@ -71,11 +80,13 @@ expression: actual
} }
], ],
"callee": { "callee": {
"commentStart": 8,
"end": 11, "end": 11,
"name": "min", "name": "min",
"start": 8, "start": 8,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 8,
"end": 30, "end": 30,
"start": 8, "start": 8,
"type": "CallExpression", "type": "CallExpression",
@ -91,6 +102,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 30, "end": 30,
"start": 0 "start": 0
} }

View File

@ -1,13 +1,16 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
"body": [ "body": [
{ {
"commentStart": 1,
"declaration": { "declaration": {
"commentStart": 1,
"end": 126, "end": 126,
"id": { "id": {
"commentStart": 1,
"end": 10, "end": 10,
"name": "sketch001", "name": "sketch001",
"start": 1, "start": 1,
@ -18,6 +21,7 @@ expression: actual
{ {
"arguments": [ "arguments": [
{ {
"commentStart": 27,
"end": 31, "end": 31,
"raw": "'XY'", "raw": "'XY'",
"start": 27, "start": 27,
@ -27,11 +31,13 @@ expression: actual
} }
], ],
"callee": { "callee": {
"commentStart": 13,
"end": 26, "end": 26,
"name": "startSketchOn", "name": "startSketchOn",
"start": 13, "start": 13,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 13,
"end": 32, "end": 32,
"start": 13, "start": 13,
"type": "CallExpression", "type": "CallExpression",
@ -40,6 +46,7 @@ expression: actual
{ {
"arguments": [ "arguments": [
{ {
"commentStart": 124,
"end": 125, "end": 125,
"start": 124, "start": 124,
"type": "PipeSubstitution", "type": "PipeSubstitution",
@ -47,22 +54,26 @@ expression: actual
} }
], ],
"callee": { "callee": {
"commentStart": 109,
"end": 123, "end": 123,
"name": "startProfileAt", "name": "startProfileAt",
"start": 109, "start": 109,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 109,
"end": 126, "end": 126,
"start": 109, "start": 109,
"type": "CallExpression", "type": "CallExpression",
"type": "CallExpression" "type": "CallExpression"
} }
], ],
"commentStart": 13,
"end": 126, "end": 126,
"nonCodeMeta": { "nonCodeMeta": {
"nonCodeNodes": { "nonCodeNodes": {
"0": [ "0": [
{ {
"commentStart": 35,
"end": 46, "end": 46,
"start": 35, "start": 35,
"type": "NonCodeNode", "type": "NonCodeNode",
@ -73,6 +84,7 @@ expression: actual
} }
}, },
{ {
"commentStart": 49,
"end": 68, "end": 68,
"start": 49, "start": 49,
"type": "NonCodeNode", "type": "NonCodeNode",
@ -83,6 +95,7 @@ expression: actual
} }
}, },
{ {
"commentStart": 71,
"end": 92, "end": 92,
"start": 71, "start": 71,
"type": "NonCodeNode", "type": "NonCodeNode",
@ -93,6 +106,7 @@ expression: actual
} }
}, },
{ {
"commentStart": 95,
"end": 103, "end": 103,
"start": 95, "start": 95,
"type": "NonCodeNode", "type": "NonCodeNode",
@ -120,6 +134,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 127, "end": 127,
"start": 0 "start": 0
} }

View File

@ -1,23 +1,29 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
"body": [ "body": [
{ {
"commentStart": 1,
"declaration": { "declaration": {
"commentStart": 1,
"end": 25, "end": 25,
"id": { "id": {
"commentStart": 1,
"end": 5, "end": 5,
"name": "my14", "name": "my14",
"start": 1, "start": 1,
"type": "Identifier" "type": "Identifier"
}, },
"init": { "init": {
"commentStart": 8,
"end": 25, "end": 25,
"left": { "left": {
"commentStart": 8,
"end": 13, "end": 13,
"left": { "left": {
"commentStart": 8,
"end": 9, "end": 9,
"raw": "4", "raw": "4",
"start": 8, "start": 8,
@ -30,6 +36,7 @@ expression: actual
}, },
"operator": "^", "operator": "^",
"right": { "right": {
"commentStart": 12,
"end": 13, "end": 13,
"raw": "2", "raw": "2",
"start": 12, "start": 12,
@ -46,10 +53,13 @@ expression: actual
}, },
"operator": "-", "operator": "-",
"right": { "right": {
"commentStart": 16,
"end": 25, "end": 25,
"left": { "left": {
"commentStart": 16,
"end": 21, "end": 21,
"left": { "left": {
"commentStart": 16,
"end": 17, "end": 17,
"raw": "3", "raw": "3",
"start": 16, "start": 16,
@ -62,6 +72,7 @@ expression: actual
}, },
"operator": "^", "operator": "^",
"right": { "right": {
"commentStart": 20,
"end": 21, "end": 21,
"raw": "2", "raw": "2",
"start": 20, "start": 20,
@ -78,6 +89,7 @@ expression: actual
}, },
"operator": "*", "operator": "*",
"right": { "right": {
"commentStart": 24,
"end": 25, "end": 25,
"raw": "2", "raw": "2",
"start": 24, "start": 24,
@ -106,6 +118,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 26, "end": 26,
"start": 0 "start": 0
} }

View File

@ -1,20 +1,25 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 0,
"end": 68, "end": 68,
"id": { "id": {
"commentStart": 0,
"end": 1, "end": 1,
"name": "x", "name": "x",
"start": 0, "start": 0,
"type": "Identifier" "type": "Identifier"
}, },
"init": { "init": {
"commentStart": 4,
"cond": { "cond": {
"commentStart": 7,
"end": 11, "end": 11,
"raw": "true", "raw": "true",
"start": 7, "start": 7,
@ -28,8 +33,10 @@ expression: actual
"final_else": { "final_else": {
"body": [ "body": [
{ {
"commentStart": 57,
"end": 58, "end": 58,
"expression": { "expression": {
"commentStart": 57,
"end": 58, "end": 58,
"raw": "4", "raw": "4",
"start": 57, "start": 57,
@ -45,6 +52,7 @@ expression: actual
"type": "ExpressionStatement" "type": "ExpressionStatement"
} }
], ],
"commentStart": 57,
"end": 67, "end": 67,
"start": 57 "start": 57
}, },
@ -52,8 +60,10 @@ expression: actual
"then_val": { "then_val": {
"body": [ "body": [
{ {
"commentStart": 26,
"end": 27, "end": 27,
"expression": { "expression": {
"commentStart": 26,
"end": 27, "end": 27,
"raw": "3", "raw": "3",
"start": 26, "start": 26,
@ -69,6 +79,7 @@ expression: actual
"type": "ExpressionStatement" "type": "ExpressionStatement"
} }
], ],
"commentStart": 26,
"end": 36, "end": 36,
"start": 26 "start": 26
}, },
@ -85,6 +96,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 68, "end": 68,
"start": 0 "start": 0
} }

View File

@ -1,20 +1,25 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 0,
"end": 115, "end": 115,
"id": { "id": {
"commentStart": 0,
"end": 1, "end": 1,
"name": "x", "name": "x",
"start": 0, "start": 0,
"type": "Identifier" "type": "Identifier"
}, },
"init": { "init": {
"commentStart": 4,
"cond": { "cond": {
"commentStart": 7,
"end": 11, "end": 11,
"raw": "true", "raw": "true",
"start": 7, "start": 7,
@ -25,9 +30,11 @@ expression: actual
"digest": null, "digest": null,
"else_ifs": [ "else_ifs": [
{ {
"commentStart": 38,
"cond": { "cond": {
"arguments": [ "arguments": [
{ {
"commentStart": 51,
"end": 57, "end": 57,
"name": "radius", "name": "radius",
"start": 51, "start": 51,
@ -36,11 +43,13 @@ expression: actual
} }
], ],
"callee": { "callee": {
"commentStart": 46,
"end": 50, "end": 50,
"name": "func", "name": "func",
"start": 46, "start": 46,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 46,
"end": 58, "end": 58,
"start": 46, "start": 46,
"type": "CallExpression", "type": "CallExpression",
@ -52,8 +61,10 @@ expression: actual
"then_val": { "then_val": {
"body": [ "body": [
{ {
"commentStart": 73,
"end": 74, "end": 74,
"expression": { "expression": {
"commentStart": 73,
"end": 74, "end": 74,
"raw": "4", "raw": "4",
"start": 73, "start": 73,
@ -69,6 +80,7 @@ expression: actual
"type": "ExpressionStatement" "type": "ExpressionStatement"
} }
], ],
"commentStart": 59,
"end": 83, "end": 83,
"start": 59 "start": 59
}, },
@ -79,8 +91,10 @@ expression: actual
"final_else": { "final_else": {
"body": [ "body": [
{ {
"commentStart": 104,
"end": 105, "end": 105,
"expression": { "expression": {
"commentStart": 104,
"end": 105, "end": 105,
"raw": "5", "raw": "5",
"start": 104, "start": 104,
@ -96,6 +110,7 @@ expression: actual
"type": "ExpressionStatement" "type": "ExpressionStatement"
} }
], ],
"commentStart": 104,
"end": 114, "end": 114,
"start": 104 "start": 104
}, },
@ -103,8 +118,10 @@ expression: actual
"then_val": { "then_val": {
"body": [ "body": [
{ {
"commentStart": 26,
"end": 27, "end": 27,
"expression": { "expression": {
"commentStart": 26,
"end": 27, "end": 27,
"raw": "3", "raw": "3",
"start": 26, "start": 26,
@ -120,6 +137,7 @@ expression: actual
"type": "ExpressionStatement" "type": "ExpressionStatement"
} }
], ],
"commentStart": 26,
"end": 36, "end": 36,
"start": 26 "start": 26
}, },
@ -136,6 +154,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 115, "end": 115,
"start": 0 "start": 0
} }

View File

@ -1,21 +1,26 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 4,
"end": 14, "end": 14,
"id": { "id": {
"commentStart": 4,
"end": 5, "end": 5,
"name": "x", "name": "x",
"start": 4, "start": 4,
"type": "Identifier" "type": "Identifier"
}, },
"init": { "init": {
"commentStart": 8,
"end": 14, "end": 14,
"left": { "left": {
"commentStart": 8,
"end": 9, "end": 9,
"raw": "3", "raw": "3",
"start": 8, "start": 8,
@ -28,6 +33,7 @@ expression: actual
}, },
"operator": "==", "operator": "==",
"right": { "right": {
"commentStart": 13,
"end": 14, "end": 14,
"raw": "3", "raw": "3",
"start": 13, "start": 13,
@ -52,6 +58,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 14, "end": 14,
"start": 0 "start": 0
} }

View File

@ -1,21 +1,26 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 4,
"end": 14, "end": 14,
"id": { "id": {
"commentStart": 4,
"end": 5, "end": 5,
"name": "x", "name": "x",
"start": 4, "start": 4,
"type": "Identifier" "type": "Identifier"
}, },
"init": { "init": {
"commentStart": 8,
"end": 14, "end": 14,
"left": { "left": {
"commentStart": 8,
"end": 9, "end": 9,
"raw": "3", "raw": "3",
"start": 8, "start": 8,
@ -28,6 +33,7 @@ expression: actual
}, },
"operator": "!=", "operator": "!=",
"right": { "right": {
"commentStart": 13,
"end": 14, "end": 14,
"raw": "3", "raw": "3",
"start": 13, "start": 13,
@ -52,6 +58,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 14, "end": 14,
"start": 0 "start": 0
} }

View File

@ -1,19 +1,23 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 0,
"end": 5, "end": 5,
"id": { "id": {
"commentStart": 0,
"end": 1, "end": 1,
"name": "x", "name": "x",
"start": 0, "start": 0,
"type": "Identifier" "type": "Identifier"
}, },
"init": { "init": {
"commentStart": 4,
"end": 5, "end": 5,
"raw": "4", "raw": "4",
"start": 4, "start": 4,
@ -34,6 +38,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 5, "end": 5,
"start": 0 "start": 0
} }

View File

@ -1,24 +1,30 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 0,
"end": 36, "end": 36,
"id": { "id": {
"commentStart": 0,
"end": 3, "end": 3,
"name": "obj", "name": "obj",
"start": 0, "start": 0,
"type": "Identifier" "type": "Identifier"
}, },
"init": { "init": {
"commentStart": 6,
"end": 36, "end": 36,
"properties": [ "properties": [
{ {
"commentStart": 7,
"end": 24, "end": 24,
"key": { "key": {
"commentStart": 7,
"end": 13, "end": 13,
"name": "center", "name": "center",
"start": 7, "start": 7,
@ -27,8 +33,10 @@ expression: actual
"start": 7, "start": 7,
"type": "ObjectProperty", "type": "ObjectProperty",
"value": { "value": {
"commentStart": 16,
"elements": [ "elements": [
{ {
"commentStart": 17,
"end": 19, "end": 19,
"raw": "10", "raw": "10",
"start": 17, "start": 17,
@ -40,6 +48,7 @@ expression: actual
} }
}, },
{ {
"commentStart": 21,
"end": 23, "end": 23,
"raw": "10", "raw": "10",
"start": 21, "start": 21,
@ -58,8 +67,10 @@ expression: actual
} }
}, },
{ {
"commentStart": 26,
"end": 35, "end": 35,
"key": { "key": {
"commentStart": 26,
"end": 32, "end": 32,
"name": "radius", "name": "radius",
"start": 26, "start": 26,
@ -68,6 +79,7 @@ expression: actual
"start": 26, "start": 26,
"type": "ObjectProperty", "type": "ObjectProperty",
"value": { "value": {
"commentStart": 34,
"end": 35, "end": 35,
"raw": "5", "raw": "5",
"start": 34, "start": 34,
@ -94,6 +106,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 36, "end": 36,
"start": 0 "start": 0
} }

View File

@ -1,19 +1,23 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 0,
"end": 5, "end": 5,
"id": { "id": {
"commentStart": 0,
"end": 1, "end": 1,
"name": "x", "name": "x",
"start": 0, "start": 0,
"type": "Identifier" "type": "Identifier"
}, },
"init": { "init": {
"commentStart": 4,
"end": 5, "end": 5,
"raw": "3", "raw": "3",
"start": 4, "start": 4,
@ -34,20 +38,26 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
}, },
{ {
"commentStart": 14,
"declaration": { "declaration": {
"commentStart": 14,
"end": 30, "end": 30,
"id": { "id": {
"commentStart": 14,
"end": 17, "end": 17,
"name": "obj", "name": "obj",
"start": 14, "start": 14,
"type": "Identifier" "type": "Identifier"
}, },
"init": { "init": {
"commentStart": 20,
"end": 30, "end": 30,
"properties": [ "properties": [
{ {
"commentStart": 22,
"end": 23, "end": 23,
"key": { "key": {
"commentStart": 22,
"end": 23, "end": 23,
"name": "x", "name": "x",
"start": 22, "start": 22,
@ -56,6 +66,7 @@ expression: actual
"start": 22, "start": 22,
"type": "ObjectProperty", "type": "ObjectProperty",
"value": { "value": {
"commentStart": 22,
"end": 23, "end": 23,
"name": "x", "name": "x",
"start": 22, "start": 22,
@ -64,8 +75,10 @@ expression: actual
} }
}, },
{ {
"commentStart": 25,
"end": 29, "end": 29,
"key": { "key": {
"commentStart": 25,
"end": 26, "end": 26,
"name": "y", "name": "y",
"start": 25, "start": 25,
@ -74,6 +87,7 @@ expression: actual
"start": 25, "start": 25,
"type": "ObjectProperty", "type": "ObjectProperty",
"value": { "value": {
"commentStart": 28,
"end": 29, "end": 29,
"raw": "4", "raw": "4",
"start": 28, "start": 28,
@ -100,6 +114,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 30, "end": 30,
"start": 0 "start": 0
} }

View File

@ -1,12 +1,14 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"end": 4, "end": 4,
"expression": { "expression": {
"commentStart": 0,
"end": 4, "end": 4,
"raw": "true", "raw": "true",
"start": 0, "start": 0,
@ -19,6 +21,7 @@ expression: actual
"type": "ExpressionStatement" "type": "ExpressionStatement"
} }
], ],
"commentStart": 0,
"end": 4, "end": 4,
"start": 0 "start": 0
} }

View File

@ -1,12 +1,14 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"end": 5, "end": 5,
"expression": { "expression": {
"commentStart": 0,
"end": 5, "end": 5,
"name": "truee", "name": "truee",
"start": 0, "start": 0,
@ -18,6 +20,7 @@ expression: actual
"type": "ExpressionStatement" "type": "ExpressionStatement"
} }
], ],
"commentStart": 0,
"end": 5, "end": 5,
"start": 0 "start": 0
} }

View File

@ -1,13 +1,16 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 0,
"end": 9, "end": 9,
"id": { "id": {
"commentStart": 0,
"end": 1, "end": 1,
"name": "x", "name": "x",
"start": 0, "start": 0,
@ -15,6 +18,7 @@ expression: actual
}, },
"init": { "init": {
"argument": { "argument": {
"commentStart": 5,
"end": 9, "end": 9,
"raw": "true", "raw": "true",
"start": 5, "start": 5,
@ -22,6 +26,7 @@ expression: actual
"type": "Literal", "type": "Literal",
"value": true "value": true
}, },
"commentStart": 4,
"end": 9, "end": 9,
"operator": "!", "operator": "!",
"start": 4, "start": 4,
@ -38,6 +43,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 9, "end": 9,
"start": 0 "start": 0
} }

View File

@ -1,21 +1,26 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 0,
"end": 16, "end": 16,
"id": { "id": {
"commentStart": 0,
"end": 1, "end": 1,
"name": "x", "name": "x",
"start": 0, "start": 0,
"type": "Identifier" "type": "Identifier"
}, },
"init": { "init": {
"commentStart": 4,
"end": 16, "end": 16,
"left": { "left": {
"commentStart": 4,
"end": 8, "end": 8,
"raw": "true", "raw": "true",
"start": 4, "start": 4,
@ -25,6 +30,7 @@ expression: actual
}, },
"operator": "&", "operator": "&",
"right": { "right": {
"commentStart": 11,
"end": 16, "end": 16,
"raw": "false", "raw": "false",
"start": 11, "start": 11,
@ -46,6 +52,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 16, "end": 16,
"start": 0 "start": 0
} }

View File

@ -1,21 +1,26 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 0,
"end": 16, "end": 16,
"id": { "id": {
"commentStart": 0,
"end": 1, "end": 1,
"name": "x", "name": "x",
"start": 0, "start": 0,
"type": "Identifier" "type": "Identifier"
}, },
"init": { "init": {
"commentStart": 4,
"end": 16, "end": 16,
"left": { "left": {
"commentStart": 4,
"end": 8, "end": 8,
"raw": "true", "raw": "true",
"start": 4, "start": 4,
@ -25,6 +30,7 @@ expression: actual
}, },
"operator": "|", "operator": "|",
"right": { "right": {
"commentStart": 11,
"end": 16, "end": 16,
"raw": "false", "raw": "false",
"start": 11, "start": 11,
@ -46,6 +52,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 16, "end": 16,
"start": 0 "start": 0
} }

View File

@ -1,13 +1,16 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 0,
"end": 29, "end": 29,
"id": { "id": {
"commentStart": 0,
"end": 5, "end": 5,
"name": "myVar", "name": "myVar",
"start": 0, "start": 0,
@ -19,6 +22,7 @@ expression: actual
"argument": { "argument": {
"arguments": [ "arguments": [
{ {
"commentStart": 20,
"end": 21, "end": 21,
"raw": "5", "raw": "5",
"start": 20, "start": 20,
@ -30,6 +34,7 @@ expression: actual
} }
}, },
{ {
"commentStart": 23,
"end": 24, "end": 24,
"raw": "4", "raw": "4",
"start": 23, "start": 23,
@ -42,16 +47,19 @@ expression: actual
} }
], ],
"callee": { "callee": {
"commentStart": 13,
"end": 19, "end": 19,
"name": "legLen", "name": "legLen",
"start": 13, "start": 13,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 13,
"end": 25, "end": 25,
"start": 13, "start": 13,
"type": "CallExpression", "type": "CallExpression",
"type": "CallExpression" "type": "CallExpression"
}, },
"commentStart": 12,
"end": 25, "end": 25,
"operator": "-", "operator": "-",
"start": 12, "start": 12,
@ -59,6 +67,7 @@ expression: actual
"type": "UnaryExpression" "type": "UnaryExpression"
}, },
{ {
"commentStart": 27,
"end": 28, "end": 28,
"raw": "5", "raw": "5",
"start": 27, "start": 27,
@ -71,11 +80,13 @@ expression: actual
} }
], ],
"callee": { "callee": {
"commentStart": 8,
"end": 11, "end": 11,
"name": "min", "name": "min",
"start": 8, "start": 8,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 8,
"end": 29, "end": 29,
"start": 8, "start": 8,
"type": "CallExpression", "type": "CallExpression",
@ -91,6 +102,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 29, "end": 29,
"start": 0 "start": 0
} }

View File

@ -1,13 +1,16 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 0,
"end": 30, "end": 30,
"id": { "id": {
"commentStart": 0,
"end": 5, "end": 5,
"name": "myVar", "name": "myVar",
"start": 0, "start": 0,
@ -16,8 +19,10 @@ expression: actual
"init": { "init": {
"body": [ "body": [
{ {
"commentStart": 8,
"end": 13, "end": 13,
"left": { "left": {
"commentStart": 8,
"end": 9, "end": 9,
"raw": "5", "raw": "5",
"start": 8, "start": 8,
@ -30,6 +35,7 @@ expression: actual
}, },
"operator": "+", "operator": "+",
"right": { "right": {
"commentStart": 12,
"end": 13, "end": 13,
"raw": "6", "raw": "6",
"start": 12, "start": 12,
@ -47,6 +53,7 @@ expression: actual
{ {
"arguments": [ "arguments": [
{ {
"commentStart": 24,
"end": 26, "end": 26,
"raw": "45", "raw": "45",
"start": 24, "start": 24,
@ -58,6 +65,7 @@ expression: actual
} }
}, },
{ {
"commentStart": 28,
"end": 29, "end": 29,
"start": 28, "start": 28,
"type": "PipeSubstitution", "type": "PipeSubstitution",
@ -65,17 +73,20 @@ expression: actual
} }
], ],
"callee": { "callee": {
"commentStart": 17,
"end": 23, "end": 23,
"name": "myFunc", "name": "myFunc",
"start": 17, "start": 17,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 17,
"end": 30, "end": 30,
"start": 17, "start": 17,
"type": "CallExpression", "type": "CallExpression",
"type": "CallExpression" "type": "CallExpression"
} }
], ],
"commentStart": 8,
"end": 30, "end": 30,
"start": 8, "start": 8,
"type": "PipeExpression", "type": "PipeExpression",
@ -91,6 +102,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 30, "end": 30,
"start": 0 "start": 0
} }

View File

@ -1,28 +1,34 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 0,
"end": 21, "end": 21,
"id": { "id": {
"commentStart": 0,
"end": 1, "end": 1,
"name": "x", "name": "x",
"start": 0, "start": 0,
"type": "Identifier" "type": "Identifier"
}, },
"init": { "init": {
"commentStart": 4,
"end": 21, "end": 21,
"left": { "left": {
"argument": { "argument": {
"commentStart": 5,
"end": 9, "end": 9,
"name": "leg2", "name": "leg2",
"start": 5, "start": 5,
"type": "Identifier", "type": "Identifier",
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 4,
"end": 9, "end": 9,
"operator": "-", "operator": "-",
"start": 4, "start": 4,
@ -31,6 +37,7 @@ expression: actual
}, },
"operator": "+", "operator": "+",
"right": { "right": {
"commentStart": 12,
"end": 21, "end": 21,
"name": "thickness", "name": "thickness",
"start": 12, "start": 12,
@ -51,6 +58,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 21, "end": 21,
"start": 0 "start": 0
} }

View File

@ -1,21 +1,26 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 4,
"end": 18, "end": 18,
"id": { "id": {
"commentStart": 4,
"end": 5, "end": 5,
"name": "x", "name": "x",
"start": 4, "start": 4,
"type": "Identifier" "type": "Identifier"
}, },
"init": { "init": {
"commentStart": 8,
"end": 18, "end": 18,
"left": { "left": {
"commentStart": 8,
"end": 9, "end": 9,
"raw": "1", "raw": "1",
"start": 8, "start": 8,
@ -28,8 +33,10 @@ expression: actual
}, },
"operator": "*", "operator": "*",
"right": { "right": {
"commentStart": 13,
"end": 18, "end": 18,
"left": { "left": {
"commentStart": 13,
"end": 14, "end": 14,
"raw": "3", "raw": "3",
"start": 13, "start": 13,
@ -42,6 +49,7 @@ expression: actual
}, },
"operator": "-", "operator": "-",
"right": { "right": {
"commentStart": 17,
"end": 18, "end": 18,
"raw": "4", "raw": "4",
"start": 17, "start": 17,
@ -70,6 +78,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 18, "end": 18,
"start": 0 "start": 0
} }

View File

@ -1,19 +1,23 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 0,
"end": 5, "end": 5,
"id": { "id": {
"commentStart": 0,
"end": 1, "end": 1,
"name": "x", "name": "x",
"start": 0, "start": 0,
"type": "Identifier" "type": "Identifier"
}, },
"init": { "init": {
"commentStart": 4,
"end": 5, "end": 5,
"raw": "1", "raw": "1",
"start": 4, "start": 4,
@ -34,11 +38,13 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 34, "end": 34,
"nonCodeMeta": { "nonCodeMeta": {
"nonCodeNodes": { "nonCodeNodes": {
"0": [ "0": [
{ {
"commentStart": 5,
"end": 34, "end": 34,
"start": 5, "start": 5,
"type": "NonCodeNode", "type": "NonCodeNode",

View File

@ -1,13 +1,16 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 3,
"end": 58, "end": 58,
"id": { "id": {
"commentStart": 3,
"end": 4, "end": 4,
"name": "x", "name": "x",
"start": 3, "start": 3,
@ -18,12 +21,14 @@ expression: actual
"body": [ "body": [
{ {
"argument": { "argument": {
"commentStart": 30,
"end": 32, "end": 32,
"name": "sg", "name": "sg",
"start": 30, "start": 30,
"type": "Identifier", "type": "Identifier",
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 23,
"end": 32, "end": 32,
"start": 23, "start": 23,
"type": "ReturnStatement", "type": "ReturnStatement",
@ -31,21 +36,25 @@ expression: actual
}, },
{ {
"argument": { "argument": {
"commentStart": 48,
"end": 50, "end": 50,
"name": "sg", "name": "sg",
"start": 48, "start": 48,
"type": "Identifier", "type": "Identifier",
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 41,
"end": 50, "end": 50,
"start": 41, "start": 41,
"type": "ReturnStatement", "type": "ReturnStatement",
"type": "ReturnStatement" "type": "ReturnStatement"
} }
], ],
"commentStart": 13,
"end": 58, "end": 58,
"start": 13 "start": 13
}, },
"commentStart": 7,
"end": 58, "end": 58,
"params": [], "params": [],
"start": 7, "start": 7,
@ -62,6 +71,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 58, "end": 58,
"start": 0 "start": 0
} }

View File

@ -1,24 +1,30 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 0,
"end": 20, "end": 20,
"id": { "id": {
"commentStart": 0,
"end": 3, "end": 3,
"name": "obj", "name": "obj",
"start": 0, "start": 0,
"type": "Identifier" "type": "Identifier"
}, },
"init": { "init": {
"commentStart": 6,
"end": 20, "end": 20,
"properties": [ "properties": [
{ {
"commentStart": 8,
"end": 12, "end": 12,
"key": { "key": {
"commentStart": 8,
"end": 9, "end": 9,
"name": "a", "name": "a",
"start": 8, "start": 8,
@ -27,6 +33,7 @@ expression: actual
"start": 8, "start": 8,
"type": "ObjectProperty", "type": "ObjectProperty",
"value": { "value": {
"commentStart": 11,
"end": 12, "end": 12,
"raw": "1", "raw": "1",
"start": 11, "start": 11,
@ -39,8 +46,10 @@ expression: actual
} }
}, },
{ {
"commentStart": 14,
"end": 18, "end": 18,
"key": { "key": {
"commentStart": 14,
"end": 15, "end": 15,
"name": "b", "name": "b",
"start": 14, "start": 14,
@ -49,6 +58,7 @@ expression: actual
"start": 14, "start": 14,
"type": "ObjectProperty", "type": "ObjectProperty",
"value": { "value": {
"commentStart": 17,
"end": 18, "end": 18,
"raw": "2", "raw": "2",
"start": 17, "start": 17,
@ -75,17 +85,22 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
}, },
{ {
"commentStart": 25,
"declaration": { "declaration": {
"commentStart": 25,
"end": 43, "end": 43,
"id": { "id": {
"commentStart": 25,
"end": 31, "end": 31,
"name": "height", "name": "height",
"start": 25, "start": 25,
"type": "Identifier" "type": "Identifier"
}, },
"init": { "init": {
"commentStart": 34,
"end": 43, "end": 43,
"left": { "left": {
"commentStart": 34,
"end": 35, "end": 35,
"raw": "1", "raw": "1",
"start": 34, "start": 34,
@ -98,9 +113,11 @@ expression: actual
}, },
"operator": "-", "operator": "-",
"right": { "right": {
"commentStart": 38,
"computed": false, "computed": false,
"end": 43, "end": 43,
"object": { "object": {
"commentStart": 38,
"end": 41, "end": 41,
"name": "obj", "name": "obj",
"start": 38, "start": 38,
@ -108,6 +125,7 @@ expression: actual
"type": "Identifier" "type": "Identifier"
}, },
"property": { "property": {
"commentStart": 42,
"end": 43, "end": 43,
"name": "a", "name": "a",
"start": 42, "start": 42,
@ -132,6 +150,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 43, "end": 43,
"start": 0 "start": 0
} }

View File

@ -1,24 +1,30 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 0,
"end": 20, "end": 20,
"id": { "id": {
"commentStart": 0,
"end": 3, "end": 3,
"name": "obj", "name": "obj",
"start": 0, "start": 0,
"type": "Identifier" "type": "Identifier"
}, },
"init": { "init": {
"commentStart": 6,
"end": 20, "end": 20,
"properties": [ "properties": [
{ {
"commentStart": 8,
"end": 12, "end": 12,
"key": { "key": {
"commentStart": 8,
"end": 9, "end": 9,
"name": "a", "name": "a",
"start": 8, "start": 8,
@ -27,6 +33,7 @@ expression: actual
"start": 8, "start": 8,
"type": "ObjectProperty", "type": "ObjectProperty",
"value": { "value": {
"commentStart": 11,
"end": 12, "end": 12,
"raw": "1", "raw": "1",
"start": 11, "start": 11,
@ -39,8 +46,10 @@ expression: actual
} }
}, },
{ {
"commentStart": 14,
"end": 18, "end": 18,
"key": { "key": {
"commentStart": 14,
"end": 15, "end": 15,
"name": "b", "name": "b",
"start": 14, "start": 14,
@ -49,6 +58,7 @@ expression: actual
"start": 14, "start": 14,
"type": "ObjectProperty", "type": "ObjectProperty",
"value": { "value": {
"commentStart": 17,
"end": 18, "end": 18,
"raw": "2", "raw": "2",
"start": 17, "start": 17,
@ -75,17 +85,22 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
}, },
{ {
"commentStart": 26,
"declaration": { "declaration": {
"commentStart": 26,
"end": 47, "end": 47,
"id": { "id": {
"commentStart": 26,
"end": 32, "end": 32,
"name": "height", "name": "height",
"start": 26, "start": 26,
"type": "Identifier" "type": "Identifier"
}, },
"init": { "init": {
"commentStart": 35,
"end": 47, "end": 47,
"left": { "left": {
"commentStart": 35,
"end": 36, "end": 36,
"raw": "1", "raw": "1",
"start": 35, "start": 35,
@ -98,9 +113,11 @@ expression: actual
}, },
"operator": "-", "operator": "-",
"right": { "right": {
"commentStart": 39,
"computed": false, "computed": false,
"end": 47, "end": 47,
"object": { "object": {
"commentStart": 39,
"end": 42, "end": 42,
"name": "obj", "name": "obj",
"start": 39, "start": 39,
@ -108,6 +125,7 @@ expression: actual
"type": "Identifier" "type": "Identifier"
}, },
"property": { "property": {
"commentStart": 43,
"end": 46, "end": 46,
"raw": "\"a\"", "raw": "\"a\"",
"start": 43, "start": 43,
@ -133,6 +151,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 47, "end": 47,
"start": 0 "start": 0
} }

View File

@ -1,24 +1,30 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 0,
"end": 20, "end": 20,
"id": { "id": {
"commentStart": 0,
"end": 3, "end": 3,
"name": "obj", "name": "obj",
"start": 0, "start": 0,
"type": "Identifier" "type": "Identifier"
}, },
"init": { "init": {
"commentStart": 6,
"end": 20, "end": 20,
"properties": [ "properties": [
{ {
"commentStart": 8,
"end": 12, "end": 12,
"key": { "key": {
"commentStart": 8,
"end": 9, "end": 9,
"name": "a", "name": "a",
"start": 8, "start": 8,
@ -27,6 +33,7 @@ expression: actual
"start": 8, "start": 8,
"type": "ObjectProperty", "type": "ObjectProperty",
"value": { "value": {
"commentStart": 11,
"end": 12, "end": 12,
"raw": "1", "raw": "1",
"start": 11, "start": 11,
@ -39,8 +46,10 @@ expression: actual
} }
}, },
{ {
"commentStart": 14,
"end": 18, "end": 18,
"key": { "key": {
"commentStart": 14,
"end": 15, "end": 15,
"name": "b", "name": "b",
"start": 14, "start": 14,
@ -49,6 +58,7 @@ expression: actual
"start": 14, "start": 14,
"type": "ObjectProperty", "type": "ObjectProperty",
"value": { "value": {
"commentStart": 17,
"end": 18, "end": 18,
"raw": "2", "raw": "2",
"start": 17, "start": 17,
@ -75,20 +85,26 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
}, },
{ {
"commentStart": 25,
"declaration": { "declaration": {
"commentStart": 25,
"end": 46, "end": 46,
"id": { "id": {
"commentStart": 25,
"end": 31, "end": 31,
"name": "height", "name": "height",
"start": 25, "start": 25,
"type": "Identifier" "type": "Identifier"
}, },
"init": { "init": {
"commentStart": 34,
"end": 46, "end": 46,
"left": { "left": {
"commentStart": 34,
"computed": false, "computed": false,
"end": 42, "end": 42,
"object": { "object": {
"commentStart": 34,
"end": 37, "end": 37,
"name": "obj", "name": "obj",
"start": 34, "start": 34,
@ -96,6 +112,7 @@ expression: actual
"type": "Identifier" "type": "Identifier"
}, },
"property": { "property": {
"commentStart": 38,
"end": 41, "end": 41,
"raw": "\"a\"", "raw": "\"a\"",
"start": 38, "start": 38,
@ -109,6 +126,7 @@ expression: actual
}, },
"operator": "-", "operator": "-",
"right": { "right": {
"commentStart": 45,
"end": 46, "end": 46,
"raw": "1", "raw": "1",
"start": 45, "start": 45,
@ -133,6 +151,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 46, "end": 46,
"start": 0 "start": 0
} }

View File

@ -1,24 +1,30 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 0,
"end": 20, "end": 20,
"id": { "id": {
"commentStart": 0,
"end": 3, "end": 3,
"name": "obj", "name": "obj",
"start": 0, "start": 0,
"type": "Identifier" "type": "Identifier"
}, },
"init": { "init": {
"commentStart": 6,
"end": 20, "end": 20,
"properties": [ "properties": [
{ {
"commentStart": 8,
"end": 12, "end": 12,
"key": { "key": {
"commentStart": 8,
"end": 9, "end": 9,
"name": "a", "name": "a",
"start": 8, "start": 8,
@ -27,6 +33,7 @@ expression: actual
"start": 8, "start": 8,
"type": "ObjectProperty", "type": "ObjectProperty",
"value": { "value": {
"commentStart": 11,
"end": 12, "end": 12,
"raw": "1", "raw": "1",
"start": 11, "start": 11,
@ -39,8 +46,10 @@ expression: actual
} }
}, },
{ {
"commentStart": 14,
"end": 18, "end": 18,
"key": { "key": {
"commentStart": 14,
"end": 15, "end": 15,
"name": "b", "name": "b",
"start": 14, "start": 14,
@ -49,6 +58,7 @@ expression: actual
"start": 14, "start": 14,
"type": "ObjectProperty", "type": "ObjectProperty",
"value": { "value": {
"commentStart": 17,
"end": 18, "end": 18,
"raw": "2", "raw": "2",
"start": 17, "start": 17,
@ -75,19 +85,25 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
}, },
{ {
"commentStart": 25,
"declaration": { "declaration": {
"commentStart": 25,
"end": 51, "end": 51,
"id": { "id": {
"commentStart": 25,
"end": 31, "end": 31,
"name": "height", "name": "height",
"start": 25, "start": 25,
"type": "Identifier" "type": "Identifier"
}, },
"init": { "init": {
"commentStart": 34,
"elements": [ "elements": [
{ {
"commentStart": 35,
"end": 47, "end": 47,
"left": { "left": {
"commentStart": 35,
"end": 36, "end": 36,
"raw": "1", "raw": "1",
"start": 35, "start": 35,
@ -100,9 +116,11 @@ expression: actual
}, },
"operator": "-", "operator": "-",
"right": { "right": {
"commentStart": 39,
"computed": false, "computed": false,
"end": 47, "end": 47,
"object": { "object": {
"commentStart": 39,
"end": 42, "end": 42,
"name": "obj", "name": "obj",
"start": 39, "start": 39,
@ -110,6 +128,7 @@ expression: actual
"type": "Identifier" "type": "Identifier"
}, },
"property": { "property": {
"commentStart": 43,
"end": 46, "end": 46,
"raw": "\"a\"", "raw": "\"a\"",
"start": 43, "start": 43,
@ -126,6 +145,7 @@ expression: actual
"type": "BinaryExpression" "type": "BinaryExpression"
}, },
{ {
"commentStart": 49,
"end": 50, "end": 50,
"raw": "0", "raw": "0",
"start": 49, "start": 49,
@ -152,6 +172,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 51, "end": 51,
"start": 0 "start": 0
} }

View File

@ -5,9 +5,12 @@ expression: actual
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 0,
"end": 23, "end": 23,
"id": { "id": {
"commentStart": 0,
"end": 3, "end": 3,
"name": "val", "name": "val",
"start": 0, "start": 0,
@ -18,12 +21,14 @@ expression: actual
{ {
"type": "LabeledArg", "type": "LabeledArg",
"label": { "label": {
"commentStart": 10,
"end": 11, "end": 11,
"name": "x", "name": "x",
"start": 10, "start": 10,
"type": "Identifier" "type": "Identifier"
}, },
"arg": { "arg": {
"commentStart": 14,
"end": 15, "end": 15,
"name": "a", "name": "a",
"start": 14, "start": 14,
@ -34,12 +39,14 @@ expression: actual
{ {
"type": "LabeledArg", "type": "LabeledArg",
"label": { "label": {
"commentStart": 17,
"end": 18, "end": 18,
"name": "y", "name": "y",
"start": 17, "start": 17,
"type": "Identifier" "type": "Identifier"
}, },
"arg": { "arg": {
"commentStart": 21,
"end": 22, "end": 22,
"name": "b", "name": "b",
"start": 21, "start": 21,
@ -49,11 +56,13 @@ expression: actual
} }
], ],
"callee": { "callee": {
"commentStart": 6,
"end": 9, "end": 9,
"name": "foo", "name": "foo",
"start": 6, "start": 6,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 6,
"end": 23, "end": 23,
"start": 6, "start": 6,
"type": "CallExpressionKw", "type": "CallExpressionKw",
@ -70,6 +79,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 23, "end": 23,
"start": 0 "start": 0
} }

View File

@ -5,9 +5,12 @@ expression: actual
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 0,
"end": 21, "end": 21,
"id": { "id": {
"commentStart": 0,
"end": 3, "end": 3,
"name": "val", "name": "val",
"start": 0, "start": 0,
@ -16,6 +19,7 @@ expression: actual
"init": { "init": {
"body": [ "body": [
{ {
"commentStart": 6,
"end": 7, "end": 7,
"raw": "1", "raw": "1",
"start": 6, "start": 6,
@ -31,12 +35,14 @@ expression: actual
{ {
"type": "LabeledArg", "type": "LabeledArg",
"label": { "label": {
"commentStart": 13,
"end": 16, "end": 16,
"name": "arg", "name": "arg",
"start": 13, "start": 13,
"type": "Identifier" "type": "Identifier"
}, },
"arg": { "arg": {
"commentStart": 19,
"end": 20, "end": 20,
"name": "x", "name": "x",
"start": 19, "start": 19,
@ -46,11 +52,13 @@ expression: actual
} }
], ],
"callee": { "callee": {
"commentStart": 11,
"end": 12, "end": 12,
"name": "f", "name": "f",
"start": 11, "start": 11,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 11,
"end": 21, "end": 21,
"start": 11, "start": 11,
"type": "CallExpressionKw", "type": "CallExpressionKw",
@ -58,6 +66,7 @@ expression: actual
"unlabeled": null "unlabeled": null
} }
], ],
"commentStart": 6,
"end": 21, "end": 21,
"start": 6, "start": 6,
"type": "PipeExpression", "type": "PipeExpression",
@ -73,6 +82,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 21, "end": 21,
"start": 0 "start": 0
} }

View File

@ -5,9 +5,12 @@ expression: actual
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 0,
"end": 87, "end": 87,
"id": { "id": {
"commentStart": 0,
"end": 3, "end": 3,
"name": "val", "name": "val",
"start": 0, "start": 0,
@ -18,12 +21,14 @@ expression: actual
{ {
"type": "LabeledArg", "type": "LabeledArg",
"label": { "label": {
"commentStart": 22,
"end": 25, "end": 25,
"name": "arg", "name": "arg",
"start": 22, "start": 22,
"type": "Identifier" "type": "Identifier"
}, },
"arg": { "arg": {
"commentStart": 28,
"end": 29, "end": 29,
"name": "x", "name": "x",
"start": 28, "start": 28,
@ -34,12 +39,14 @@ expression: actual
{ {
"type": "LabeledArg", "type": "LabeledArg",
"label": { "label": {
"commentStart": 44,
"end": 47, "end": 47,
"name": "foo", "name": "foo",
"start": 44, "start": 44,
"type": "Identifier" "type": "Identifier"
}, },
"arg": { "arg": {
"commentStart": 50,
"end": 51, "end": 51,
"name": "x", "name": "x",
"start": 50, "start": 50,
@ -50,12 +57,14 @@ expression: actual
{ {
"type": "LabeledArg", "type": "LabeledArg",
"label": { "label": {
"commentStart": 66,
"end": 69, "end": 69,
"name": "bar", "name": "bar",
"start": 66, "start": 66,
"type": "Identifier" "type": "Identifier"
}, },
"arg": { "arg": {
"commentStart": 72,
"end": 73, "end": 73,
"name": "x", "name": "x",
"start": 72, "start": 72,
@ -65,11 +74,13 @@ expression: actual
} }
], ],
"callee": { "callee": {
"commentStart": 6,
"end": 7, "end": 7,
"name": "f", "name": "f",
"start": 6, "start": 6,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 6,
"end": 87, "end": 87,
"start": 6, "start": 6,
"type": "CallExpressionKw", "type": "CallExpressionKw",
@ -86,6 +97,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 87, "end": 87,
"start": 0 "start": 0
} }

View File

@ -5,9 +5,12 @@ expression: actual
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 0,
"end": 90, "end": 90,
"id": { "id": {
"commentStart": 0,
"end": 3, "end": 3,
"name": "val", "name": "val",
"start": 0, "start": 0,
@ -18,12 +21,14 @@ expression: actual
{ {
"type": "LabeledArg", "type": "LabeledArg",
"label": { "label": {
"commentStart": 22,
"end": 25, "end": 25,
"name": "arg", "name": "arg",
"start": 22, "start": 22,
"type": "Identifier" "type": "Identifier"
}, },
"arg": { "arg": {
"commentStart": 28,
"end": 29, "end": 29,
"name": "x", "name": "x",
"start": 28, "start": 28,
@ -34,12 +39,14 @@ expression: actual
{ {
"type": "LabeledArg", "type": "LabeledArg",
"label": { "label": {
"commentStart": 69,
"end": 72, "end": 72,
"name": "bar", "name": "bar",
"start": 69, "start": 69,
"type": "Identifier" "type": "Identifier"
}, },
"arg": { "arg": {
"commentStart": 75,
"end": 76, "end": 76,
"name": "x", "name": "x",
"start": 75, "start": 75,
@ -49,16 +56,19 @@ expression: actual
} }
], ],
"callee": { "callee": {
"commentStart": 6,
"end": 7, "end": 7,
"name": "f", "name": "f",
"start": 6, "start": 6,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 6,
"end": 90, "end": 90,
"nonCodeMeta": { "nonCodeMeta": {
"nonCodeNodes": { "nonCodeNodes": {
"1": [ "1": [
{ {
"commentStart": 44,
"end": 55, "end": 55,
"start": 44, "start": 44,
"type": "NonCodeNode", "type": "NonCodeNode",
@ -87,6 +97,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 90, "end": 90,
"start": 0 "start": 0
} }

View File

@ -1,13 +1,16 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 3,
"end": 25, "end": 25,
"id": { "id": {
"commentStart": 3,
"end": 6, "end": 6,
"name": "foo", "name": "foo",
"start": 3, "start": 3,
@ -18,6 +21,7 @@ expression: actual
"body": [ "body": [
{ {
"argument": { "argument": {
"commentStart": 22,
"end": 23, "end": 23,
"raw": "1", "raw": "1",
"start": 22, "start": 22,
@ -28,20 +32,24 @@ expression: actual
"suffix": "None" "suffix": "None"
} }
}, },
"commentStart": 15,
"end": 23, "end": 23,
"start": 15, "start": 15,
"type": "ReturnStatement", "type": "ReturnStatement",
"type": "ReturnStatement" "type": "ReturnStatement"
} }
], ],
"commentStart": 13,
"end": 25, "end": 25,
"start": 13 "start": 13
}, },
"commentStart": 6,
"end": 25, "end": 25,
"params": [ "params": [
{ {
"type": "Parameter", "type": "Parameter",
"identifier": { "identifier": {
"commentStart": 7,
"end": 8, "end": 8,
"name": "x", "name": "x",
"start": 7, "start": 7,
@ -51,6 +59,7 @@ expression: actual
{ {
"type": "Parameter", "type": "Parameter",
"identifier": { "identifier": {
"commentStart": 10,
"end": 11, "end": 11,
"name": "y", "name": "y",
"start": 10, "start": 10,
@ -72,6 +81,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 25, "end": 25,
"start": 0 "start": 0
} }

View File

@ -1,13 +1,16 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 3,
"end": 26, "end": 26,
"id": { "id": {
"commentStart": 3,
"end": 6, "end": 6,
"name": "foo", "name": "foo",
"start": 3, "start": 3,
@ -18,6 +21,7 @@ expression: actual
"body": [ "body": [
{ {
"argument": { "argument": {
"commentStart": 23,
"end": 24, "end": 24,
"raw": "1", "raw": "1",
"start": 23, "start": 23,
@ -28,20 +32,24 @@ expression: actual
"suffix": "None" "suffix": "None"
} }
}, },
"commentStart": 16,
"end": 24, "end": 24,
"start": 16, "start": 16,
"type": "ReturnStatement", "type": "ReturnStatement",
"type": "ReturnStatement" "type": "ReturnStatement"
} }
], ],
"commentStart": 14,
"end": 26, "end": 26,
"start": 14 "start": 14
}, },
"commentStart": 6,
"end": 26, "end": 26,
"params": [ "params": [
{ {
"type": "Parameter", "type": "Parameter",
"identifier": { "identifier": {
"commentStart": 8,
"end": 9, "end": 9,
"name": "x", "name": "x",
"start": 8, "start": 8,
@ -52,6 +60,7 @@ expression: actual
{ {
"type": "Parameter", "type": "Parameter",
"identifier": { "identifier": {
"commentStart": 11,
"end": 12, "end": 12,
"name": "y", "name": "y",
"start": 11, "start": 11,
@ -73,6 +82,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 26, "end": 26,
"start": 0 "start": 0
} }

View File

@ -1,13 +1,16 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 3,
"end": 35, "end": 35,
"id": { "id": {
"commentStart": 3,
"end": 6, "end": 6,
"name": "foo", "name": "foo",
"start": 3, "start": 3,
@ -18,6 +21,7 @@ expression: actual
"body": [ "body": [
{ {
"argument": { "argument": {
"commentStart": 32,
"end": 33, "end": 33,
"raw": "1", "raw": "1",
"start": 32, "start": 32,
@ -28,26 +32,31 @@ expression: actual
"suffix": "None" "suffix": "None"
} }
}, },
"commentStart": 25,
"end": 33, "end": 33,
"start": 25, "start": 25,
"type": "ReturnStatement", "type": "ReturnStatement",
"type": "ReturnStatement" "type": "ReturnStatement"
} }
], ],
"commentStart": 23,
"end": 35, "end": 35,
"start": 23 "start": 23
}, },
"commentStart": 6,
"end": 35, "end": 35,
"params": [ "params": [
{ {
"type": "Parameter", "type": "Parameter",
"identifier": { "identifier": {
"commentStart": 7,
"end": 8, "end": 8,
"name": "x", "name": "x",
"start": 7, "start": 7,
"type": "Identifier" "type": "Identifier"
}, },
"default_value": { "default_value": {
"commentStart": 20,
"end": 21, "end": 21,
"raw": "2", "raw": "2",
"start": 20, "start": 20,
@ -74,6 +83,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 35, "end": 35,
"start": 0 "start": 0
} }

View File

@ -1,13 +1,16 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 3,
"end": 27, "end": 27,
"id": { "id": {
"commentStart": 3,
"end": 6, "end": 6,
"name": "foo", "name": "foo",
"start": 3, "start": 3,
@ -18,6 +21,7 @@ expression: actual
"body": [ "body": [
{ {
"argument": { "argument": {
"commentStart": 24,
"end": 25, "end": 25,
"raw": "1", "raw": "1",
"start": 24, "start": 24,
@ -28,26 +32,31 @@ expression: actual
"suffix": "None" "suffix": "None"
} }
}, },
"commentStart": 17,
"end": 25, "end": 25,
"start": 17, "start": 17,
"type": "ReturnStatement", "type": "ReturnStatement",
"type": "ReturnStatement" "type": "ReturnStatement"
} }
], ],
"commentStart": 15,
"end": 27, "end": 27,
"start": 15 "start": 15
}, },
"commentStart": 6,
"end": 27, "end": 27,
"params": [ "params": [
{ {
"type": "Parameter", "type": "Parameter",
"identifier": { "identifier": {
"commentStart": 7,
"end": 8, "end": 8,
"name": "x", "name": "x",
"start": 7, "start": 7,
"type": "Identifier" "type": "Identifier"
}, },
"default_value": { "default_value": {
"commentStart": 12,
"end": 13, "end": 13,
"raw": "2", "raw": "2",
"start": 12, "start": 12,
@ -74,6 +83,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 27, "end": 27,
"start": 0 "start": 0
} }

View File

@ -5,9 +5,12 @@ expression: actual
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 0,
"end": 19, "end": 19,
"id": { "id": {
"commentStart": 0,
"end": 3, "end": 3,
"name": "val", "name": "val",
"start": 0, "start": 0,
@ -18,12 +21,14 @@ expression: actual
{ {
"type": "LabeledArg", "type": "LabeledArg",
"label": { "label": {
"commentStart": 13,
"end": 14, "end": 14,
"name": "y", "name": "y",
"start": 13, "start": 13,
"type": "Identifier" "type": "Identifier"
}, },
"arg": { "arg": {
"commentStart": 17,
"end": 18, "end": 18,
"name": "z", "name": "z",
"start": 17, "start": 17,
@ -33,16 +38,19 @@ expression: actual
} }
], ],
"callee": { "callee": {
"commentStart": 6,
"end": 9, "end": 9,
"name": "foo", "name": "foo",
"start": 6, "start": 6,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 6,
"end": 19, "end": 19,
"start": 6, "start": 6,
"type": "CallExpressionKw", "type": "CallExpressionKw",
"type": "CallExpressionKw", "type": "CallExpressionKw",
"unlabeled": { "unlabeled": {
"commentStart": 10,
"end": 11, "end": 11,
"name": "x", "name": "x",
"start": 10, "start": 10,
@ -60,6 +68,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 19, "end": 19,
"start": 0 "start": 0
} }

View File

@ -1,24 +1,30 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 0,
"end": 20, "end": 20,
"id": { "id": {
"commentStart": 0,
"end": 3, "end": 3,
"name": "obj", "name": "obj",
"start": 0, "start": 0,
"type": "Identifier" "type": "Identifier"
}, },
"init": { "init": {
"commentStart": 6,
"end": 20, "end": 20,
"properties": [ "properties": [
{ {
"commentStart": 8,
"end": 12, "end": 12,
"key": { "key": {
"commentStart": 8,
"end": 9, "end": 9,
"name": "a", "name": "a",
"start": 8, "start": 8,
@ -27,6 +33,7 @@ expression: actual
"start": 8, "start": 8,
"type": "ObjectProperty", "type": "ObjectProperty",
"value": { "value": {
"commentStart": 11,
"end": 12, "end": 12,
"raw": "1", "raw": "1",
"start": 11, "start": 11,
@ -39,8 +46,10 @@ expression: actual
} }
}, },
{ {
"commentStart": 14,
"end": 18, "end": 18,
"key": { "key": {
"commentStart": 14,
"end": 15, "end": 15,
"name": "b", "name": "b",
"start": 14, "start": 14,
@ -49,6 +58,7 @@ expression: actual
"start": 14, "start": 14,
"type": "ObjectProperty", "type": "ObjectProperty",
"value": { "value": {
"commentStart": 17,
"end": 18, "end": 18,
"raw": "2", "raw": "2",
"start": 17, "start": 17,
@ -75,22 +85,29 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
}, },
{ {
"commentStart": 25,
"declaration": { "declaration": {
"commentStart": 25,
"end": 51, "end": 51,
"id": { "id": {
"commentStart": 25,
"end": 31, "end": 31,
"name": "height", "name": "height",
"start": 25, "start": 25,
"type": "Identifier" "type": "Identifier"
}, },
"init": { "init": {
"commentStart": 34,
"elements": [ "elements": [
{ {
"commentStart": 35,
"end": 47, "end": 47,
"left": { "left": {
"commentStart": 35,
"computed": false, "computed": false,
"end": 43, "end": 43,
"object": { "object": {
"commentStart": 35,
"end": 38, "end": 38,
"name": "obj", "name": "obj",
"start": 35, "start": 35,
@ -98,6 +115,7 @@ expression: actual
"type": "Identifier" "type": "Identifier"
}, },
"property": { "property": {
"commentStart": 39,
"end": 42, "end": 42,
"raw": "\"a\"", "raw": "\"a\"",
"start": 39, "start": 39,
@ -111,6 +129,7 @@ expression: actual
}, },
"operator": "-", "operator": "-",
"right": { "right": {
"commentStart": 46,
"end": 47, "end": 47,
"raw": "1", "raw": "1",
"start": 46, "start": 46,
@ -126,6 +145,7 @@ expression: actual
"type": "BinaryExpression" "type": "BinaryExpression"
}, },
{ {
"commentStart": 49,
"end": 50, "end": 50,
"raw": "0", "raw": "0",
"start": 49, "start": 49,
@ -152,6 +172,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 51, "end": 51,
"start": 0 "start": 0
} }

View File

@ -1,24 +1,30 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 0,
"end": 20, "end": 20,
"id": { "id": {
"commentStart": 0,
"end": 3, "end": 3,
"name": "obj", "name": "obj",
"start": 0, "start": 0,
"type": "Identifier" "type": "Identifier"
}, },
"init": { "init": {
"commentStart": 6,
"end": 20, "end": 20,
"properties": [ "properties": [
{ {
"commentStart": 8,
"end": 12, "end": 12,
"key": { "key": {
"commentStart": 8,
"end": 9, "end": 9,
"name": "a", "name": "a",
"start": 8, "start": 8,
@ -27,6 +33,7 @@ expression: actual
"start": 8, "start": 8,
"type": "ObjectProperty", "type": "ObjectProperty",
"value": { "value": {
"commentStart": 11,
"end": 12, "end": 12,
"raw": "1", "raw": "1",
"start": 11, "start": 11,
@ -39,8 +46,10 @@ expression: actual
} }
}, },
{ {
"commentStart": 14,
"end": 18, "end": 18,
"key": { "key": {
"commentStart": 14,
"end": 15, "end": 15,
"name": "b", "name": "b",
"start": 14, "start": 14,
@ -49,6 +58,7 @@ expression: actual
"start": 14, "start": 14,
"type": "ObjectProperty", "type": "ObjectProperty",
"value": { "value": {
"commentStart": 17,
"end": 18, "end": 18,
"raw": "2", "raw": "2",
"start": 17, "start": 17,
@ -75,22 +85,29 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
}, },
{ {
"commentStart": 25,
"declaration": { "declaration": {
"commentStart": 25,
"end": 50, "end": 50,
"id": { "id": {
"commentStart": 25,
"end": 31, "end": 31,
"name": "height", "name": "height",
"start": 25, "start": 25,
"type": "Identifier" "type": "Identifier"
}, },
"init": { "init": {
"commentStart": 34,
"elements": [ "elements": [
{ {
"commentStart": 35,
"end": 46, "end": 46,
"left": { "left": {
"commentStart": 35,
"computed": false, "computed": false,
"end": 43, "end": 43,
"object": { "object": {
"commentStart": 35,
"end": 38, "end": 38,
"name": "obj", "name": "obj",
"start": 35, "start": 35,
@ -98,6 +115,7 @@ expression: actual
"type": "Identifier" "type": "Identifier"
}, },
"property": { "property": {
"commentStart": 39,
"end": 42, "end": 42,
"raw": "\"a\"", "raw": "\"a\"",
"start": 39, "start": 39,
@ -111,6 +129,7 @@ expression: actual
}, },
"operator": "-", "operator": "-",
"right": { "right": {
"commentStart": 45,
"end": 46, "end": 46,
"raw": "1", "raw": "1",
"start": 45, "start": 45,
@ -126,6 +145,7 @@ expression: actual
"type": "BinaryExpression" "type": "BinaryExpression"
}, },
{ {
"commentStart": 48,
"end": 49, "end": 49,
"raw": "0", "raw": "0",
"start": 48, "start": 48,
@ -152,6 +172,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 50, "end": 50,
"start": 0 "start": 0
} }

View File

@ -1,21 +1,26 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 0,
"end": 18, "end": 18,
"id": { "id": {
"commentStart": 0,
"end": 6, "end": 6,
"name": "height", "name": "height",
"start": 0, "start": 0,
"type": "Identifier" "type": "Identifier"
}, },
"init": { "init": {
"commentStart": 9,
"end": 18, "end": 18,
"left": { "left": {
"commentStart": 9,
"end": 10, "end": 10,
"raw": "1", "raw": "1",
"start": 9, "start": 9,
@ -28,9 +33,11 @@ expression: actual
}, },
"operator": "-", "operator": "-",
"right": { "right": {
"commentStart": 13,
"computed": false, "computed": false,
"end": 18, "end": 18,
"object": { "object": {
"commentStart": 13,
"end": 16, "end": 16,
"name": "obj", "name": "obj",
"start": 13, "start": 13,
@ -38,6 +45,7 @@ expression: actual
"type": "Identifier" "type": "Identifier"
}, },
"property": { "property": {
"commentStart": 17,
"end": 18, "end": 18,
"name": "a", "name": "a",
"start": 17, "start": 17,
@ -62,6 +70,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 18, "end": 18,
"start": 0 "start": 0
} }

View File

@ -1,23 +1,29 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 0,
"end": 15, "end": 15,
"id": { "id": {
"commentStart": 0,
"end": 3, "end": 3,
"name": "six", "name": "six",
"start": 0, "start": 0,
"type": "Identifier" "type": "Identifier"
}, },
"init": { "init": {
"commentStart": 6,
"end": 15, "end": 15,
"left": { "left": {
"commentStart": 6,
"end": 11, "end": 11,
"left": { "left": {
"commentStart": 6,
"end": 7, "end": 7,
"raw": "1", "raw": "1",
"start": 6, "start": 6,
@ -30,6 +36,7 @@ expression: actual
}, },
"operator": "+", "operator": "+",
"right": { "right": {
"commentStart": 10,
"end": 11, "end": 11,
"raw": "2", "raw": "2",
"start": 10, "start": 10,
@ -46,6 +53,7 @@ expression: actual
}, },
"operator": "+", "operator": "+",
"right": { "right": {
"commentStart": 14,
"end": 15, "end": 15,
"raw": "3", "raw": "3",
"start": 14, "start": 14,
@ -70,6 +78,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 15, "end": 15,
"start": 0 "start": 0
} }

View File

@ -1,23 +1,29 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 0,
"end": 16, "end": 16,
"id": { "id": {
"commentStart": 0,
"end": 4, "end": 4,
"name": "five", "name": "five",
"start": 0, "start": 0,
"type": "Identifier" "type": "Identifier"
}, },
"init": { "init": {
"commentStart": 7,
"end": 16, "end": 16,
"left": { "left": {
"commentStart": 7,
"end": 12, "end": 12,
"left": { "left": {
"commentStart": 7,
"end": 8, "end": 8,
"raw": "3", "raw": "3",
"start": 7, "start": 7,
@ -30,6 +36,7 @@ expression: actual
}, },
"operator": "*", "operator": "*",
"right": { "right": {
"commentStart": 11,
"end": 12, "end": 12,
"raw": "1", "raw": "1",
"start": 11, "start": 11,
@ -46,6 +53,7 @@ expression: actual
}, },
"operator": "+", "operator": "+",
"right": { "right": {
"commentStart": 15,
"end": 16, "end": 16,
"raw": "2", "raw": "2",
"start": 15, "start": 15,
@ -70,6 +78,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 16, "end": 16,
"start": 0 "start": 0
} }

View File

@ -1,24 +1,30 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 0,
"end": 24, "end": 24,
"id": { "id": {
"commentStart": 0,
"end": 6, "end": 6,
"name": "height", "name": "height",
"start": 0, "start": 0,
"type": "Identifier" "type": "Identifier"
}, },
"init": { "init": {
"commentStart": 9,
"elements": [ "elements": [
{ {
"commentStart": 11,
"computed": false, "computed": false,
"end": 19, "end": 19,
"object": { "object": {
"commentStart": 11,
"end": 14, "end": 14,
"name": "obj", "name": "obj",
"start": 11, "start": 11,
@ -26,6 +32,7 @@ expression: actual
"type": "Identifier" "type": "Identifier"
}, },
"property": { "property": {
"commentStart": 15,
"end": 18, "end": 18,
"raw": "\"a\"", "raw": "\"a\"",
"start": 15, "start": 15,
@ -38,6 +45,7 @@ expression: actual
"type": "MemberExpression" "type": "MemberExpression"
}, },
{ {
"commentStart": 21,
"end": 22, "end": 22,
"raw": "0", "raw": "0",
"start": 21, "start": 21,
@ -64,6 +72,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 24, "end": 24,
"start": 0 "start": 0
} }

View File

@ -1,24 +1,30 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 0,
"end": 20, "end": 20,
"id": { "id": {
"commentStart": 0,
"end": 3, "end": 3,
"name": "obj", "name": "obj",
"start": 0, "start": 0,
"type": "Identifier" "type": "Identifier"
}, },
"init": { "init": {
"commentStart": 6,
"end": 20, "end": 20,
"properties": [ "properties": [
{ {
"commentStart": 8,
"end": 12, "end": 12,
"key": { "key": {
"commentStart": 8,
"end": 9, "end": 9,
"name": "a", "name": "a",
"start": 8, "start": 8,
@ -27,6 +33,7 @@ expression: actual
"start": 8, "start": 8,
"type": "ObjectProperty", "type": "ObjectProperty",
"value": { "value": {
"commentStart": 11,
"end": 12, "end": 12,
"raw": "1", "raw": "1",
"start": 11, "start": 11,
@ -39,8 +46,10 @@ expression: actual
} }
}, },
{ {
"commentStart": 14,
"end": 18, "end": 18,
"key": { "key": {
"commentStart": 14,
"end": 15, "end": 15,
"name": "b", "name": "b",
"start": 14, "start": 14,
@ -49,6 +58,7 @@ expression: actual
"start": 14, "start": 14,
"type": "ObjectProperty", "type": "ObjectProperty",
"value": { "value": {
"commentStart": 17,
"end": 18, "end": 18,
"raw": "2", "raw": "2",
"start": 17, "start": 17,
@ -75,18 +85,23 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
}, },
{ {
"commentStart": 25,
"declaration": { "declaration": {
"commentStart": 25,
"end": 42, "end": 42,
"id": { "id": {
"commentStart": 25,
"end": 31, "end": 31,
"name": "height", "name": "height",
"start": 25, "start": 25,
"type": "Identifier" "type": "Identifier"
}, },
"init": { "init": {
"commentStart": 34,
"computed": false, "computed": false,
"end": 42, "end": 42,
"object": { "object": {
"commentStart": 34,
"end": 37, "end": 37,
"name": "obj", "name": "obj",
"start": 34, "start": 34,
@ -94,6 +109,7 @@ expression: actual
"type": "Identifier" "type": "Identifier"
}, },
"property": { "property": {
"commentStart": 38,
"end": 41, "end": 41,
"raw": "\"a\"", "raw": "\"a\"",
"start": 38, "start": 38,
@ -115,6 +131,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 42, "end": 42,
"start": 0 "start": 0
} }

View File

@ -1,25 +1,31 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 0,
"end": 21, "end": 21,
"id": { "id": {
"commentStart": 0,
"end": 4, "end": 4,
"name": "prop", "name": "prop",
"start": 0, "start": 0,
"type": "Identifier" "type": "Identifier"
}, },
"init": { "init": {
"commentStart": 7,
"computed": true, "computed": true,
"end": 21, "end": 21,
"object": { "object": {
"commentStart": 7,
"computed": false, "computed": false,
"end": 16, "end": 16,
"object": { "object": {
"commentStart": 7,
"end": 9, "end": 9,
"name": "yo", "name": "yo",
"start": 7, "start": 7,
@ -27,6 +33,7 @@ expression: actual
"type": "Identifier" "type": "Identifier"
}, },
"property": { "property": {
"commentStart": 10,
"end": 15, "end": 15,
"raw": "\"one\"", "raw": "\"one\"",
"start": 10, "start": 10,
@ -39,6 +46,7 @@ expression: actual
"type": "MemberExpression" "type": "MemberExpression"
}, },
"property": { "property": {
"commentStart": 17,
"end": 20, "end": 20,
"name": "two", "name": "two",
"start": 17, "start": 17,
@ -59,6 +67,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 21, "end": 21,
"start": 0 "start": 0
} }

View File

@ -1,22 +1,27 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 0,
"end": 11, "end": 11,
"id": { "id": {
"commentStart": 0,
"end": 3, "end": 3,
"name": "pt1", "name": "pt1",
"start": 0, "start": 0,
"type": "Identifier" "type": "Identifier"
}, },
"init": { "init": {
"commentStart": 6,
"computed": true, "computed": true,
"end": 11, "end": 11,
"object": { "object": {
"commentStart": 6,
"end": 8, "end": 8,
"name": "b1", "name": "b1",
"start": 6, "start": 6,
@ -24,6 +29,7 @@ expression: actual
"type": "Identifier" "type": "Identifier"
}, },
"property": { "property": {
"commentStart": 9,
"end": 10, "end": 10,
"name": "x", "name": "x",
"start": 9, "start": 9,
@ -44,6 +50,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 11, "end": 11,
"start": 0 "start": 0
} }

View File

@ -1,31 +1,39 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 0,
"end": 28, "end": 28,
"id": { "id": {
"commentStart": 0,
"end": 4, "end": 4,
"name": "prop", "name": "prop",
"start": 0, "start": 0,
"type": "Identifier" "type": "Identifier"
}, },
"init": { "init": {
"commentStart": 7,
"computed": false, "computed": false,
"end": 28, "end": 28,
"object": { "object": {
"commentStart": 7,
"computed": false, "computed": false,
"end": 23, "end": 23,
"object": { "object": {
"commentStart": 7,
"computed": false, "computed": false,
"end": 17, "end": 17,
"object": { "object": {
"commentStart": 7,
"computed": false, "computed": false,
"end": 13, "end": 13,
"object": { "object": {
"commentStart": 7,
"end": 9, "end": 9,
"name": "yo", "name": "yo",
"start": 7, "start": 7,
@ -33,6 +41,7 @@ expression: actual
"type": "Identifier" "type": "Identifier"
}, },
"property": { "property": {
"commentStart": 10,
"end": 13, "end": 13,
"name": "one", "name": "one",
"start": 10, "start": 10,
@ -44,6 +53,7 @@ expression: actual
"type": "MemberExpression" "type": "MemberExpression"
}, },
"property": { "property": {
"commentStart": 14,
"end": 17, "end": 17,
"name": "two", "name": "two",
"start": 14, "start": 14,
@ -55,6 +65,7 @@ expression: actual
"type": "MemberExpression" "type": "MemberExpression"
}, },
"property": { "property": {
"commentStart": 18,
"end": 23, "end": 23,
"name": "three", "name": "three",
"start": 18, "start": 18,
@ -66,6 +77,7 @@ expression: actual
"type": "MemberExpression" "type": "MemberExpression"
}, },
"property": { "property": {
"commentStart": 24,
"end": 28, "end": 28,
"name": "four", "name": "four",
"start": 24, "start": 24,
@ -86,6 +98,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 28, "end": 28,
"start": 0 "start": 0
} }

View File

@ -1,22 +1,27 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 0,
"end": 11, "end": 11,
"id": { "id": {
"commentStart": 0,
"end": 3, "end": 3,
"name": "pt1", "name": "pt1",
"start": 0, "start": 0,
"type": "Identifier" "type": "Identifier"
}, },
"init": { "init": {
"commentStart": 6,
"computed": false, "computed": false,
"end": 11, "end": 11,
"object": { "object": {
"commentStart": 6,
"end": 8, "end": 8,
"name": "b1", "name": "b1",
"start": 6, "start": 6,
@ -24,6 +29,7 @@ expression: actual
"type": "Identifier" "type": "Identifier"
}, },
"property": { "property": {
"commentStart": 9,
"end": 10, "end": 10,
"raw": "0", "raw": "0",
"start": 9, "start": 9,
@ -48,6 +54,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 11, "end": 11,
"start": 0 "start": 0
} }

View File

@ -1,22 +1,27 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 0,
"end": 16, "end": 16,
"id": { "id": {
"commentStart": 0,
"end": 3, "end": 3,
"name": "pt1", "name": "pt1",
"start": 0, "start": 0,
"type": "Identifier" "type": "Identifier"
}, },
"init": { "init": {
"commentStart": 6,
"computed": false, "computed": false,
"end": 16, "end": 16,
"object": { "object": {
"commentStart": 6,
"end": 8, "end": 8,
"name": "b1", "name": "b1",
"start": 6, "start": 6,
@ -24,6 +29,7 @@ expression: actual
"type": "Identifier" "type": "Identifier"
}, },
"property": { "property": {
"commentStart": 9,
"end": 15, "end": 15,
"raw": "'zero'", "raw": "'zero'",
"start": 9, "start": 9,
@ -45,6 +51,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 16, "end": 16,
"start": 0 "start": 0
} }

View File

@ -1,22 +1,27 @@
--- ---
source: kcl/src/parsing/parser.rs source: kcl-lib/src/parsing/parser.rs
expression: actual expression: actual
--- ---
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 0,
"end": 13, "end": 13,
"id": { "id": {
"commentStart": 0,
"end": 3, "end": 3,
"name": "pt1", "name": "pt1",
"start": 0, "start": 0,
"type": "Identifier" "type": "Identifier"
}, },
"init": { "init": {
"commentStart": 6,
"computed": false, "computed": false,
"end": 13, "end": 13,
"object": { "object": {
"commentStart": 6,
"end": 8, "end": 8,
"name": "b1", "name": "b1",
"start": 6, "start": 6,
@ -24,6 +29,7 @@ expression: actual
"type": "Identifier" "type": "Identifier"
}, },
"property": { "property": {
"commentStart": 9,
"end": 13, "end": 13,
"name": "zero", "name": "zero",
"start": 9, "start": 9,
@ -44,6 +50,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 13, "end": 13,
"start": 0 "start": 0
} }

View File

@ -5,9 +5,12 @@ expression: actual
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 0,
"end": 48, "end": 48,
"id": { "id": {
"commentStart": 0,
"end": 2, "end": 2,
"name": "sg", "name": "sg",
"start": 0, "start": 0,
@ -18,6 +21,7 @@ expression: actual
{ {
"arguments": [ "arguments": [
{ {
"commentStart": 19,
"end": 21, "end": 21,
"name": "XY", "name": "XY",
"start": 19, "start": 19,
@ -26,11 +30,13 @@ expression: actual
} }
], ],
"callee": { "callee": {
"commentStart": 5,
"end": 18, "end": 18,
"name": "startSketchOn", "name": "startSketchOn",
"start": 5, "start": 5,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 5,
"end": 22, "end": 22,
"start": 5, "start": 5,
"type": "CallExpression", "type": "CallExpression",
@ -39,6 +45,7 @@ expression: actual
{ {
"arguments": [ "arguments": [
{ {
"commentStart": 41,
"end": 44, "end": 44,
"name": "pos", "name": "pos",
"start": 41, "start": 41,
@ -46,6 +53,7 @@ expression: actual
"type": "Identifier" "type": "Identifier"
}, },
{ {
"commentStart": 46,
"end": 47, "end": 47,
"start": 46, "start": 46,
"type": "PipeSubstitution", "type": "PipeSubstitution",
@ -53,17 +61,20 @@ expression: actual
} }
], ],
"callee": { "callee": {
"commentStart": 26,
"end": 40, "end": 40,
"name": "startProfileAt", "name": "startProfileAt",
"start": 26, "start": 26,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 26,
"end": 48, "end": 48,
"start": 26, "start": 26,
"type": "CallExpression", "type": "CallExpression",
"type": "CallExpression" "type": "CallExpression"
} }
], ],
"commentStart": 5,
"end": 48, "end": 48,
"start": 5, "start": 5,
"type": "PipeExpression", "type": "PipeExpression",
@ -79,6 +90,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 48, "end": 48,
"start": 0 "start": 0
} }

View File

@ -5,9 +5,12 @@ expression: actual
{ {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 0,
"end": 73, "end": 73,
"id": { "id": {
"commentStart": 0,
"end": 2, "end": 2,
"name": "sg", "name": "sg",
"start": 0, "start": 0,
@ -18,6 +21,7 @@ expression: actual
{ {
"arguments": [ "arguments": [
{ {
"commentStart": 19,
"end": 21, "end": 21,
"name": "XY", "name": "XY",
"start": 19, "start": 19,
@ -26,11 +30,13 @@ expression: actual
} }
], ],
"callee": { "callee": {
"commentStart": 5,
"end": 18, "end": 18,
"name": "startSketchOn", "name": "startSketchOn",
"start": 5, "start": 5,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 5,
"end": 22, "end": 22,
"start": 5, "start": 5,
"type": "CallExpression", "type": "CallExpression",
@ -39,6 +45,7 @@ expression: actual
{ {
"arguments": [ "arguments": [
{ {
"commentStart": 45,
"end": 48, "end": 48,
"name": "pos", "name": "pos",
"start": 45, "start": 45,
@ -47,11 +54,13 @@ expression: actual
} }
], ],
"callee": { "callee": {
"commentStart": 30,
"end": 44, "end": 44,
"name": "startProfileAt", "name": "startProfileAt",
"start": 30, "start": 30,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 30,
"end": 49, "end": 49,
"start": 30, "start": 30,
"type": "CallExpression", "type": "CallExpression",
@ -60,8 +69,10 @@ expression: actual
{ {
"arguments": [ "arguments": [
{ {
"commentStart": 58,
"elements": [ "elements": [
{ {
"commentStart": 59,
"end": 60, "end": 60,
"raw": "0", "raw": "0",
"start": 59, "start": 59,
@ -74,12 +85,14 @@ expression: actual
}, },
{ {
"argument": { "argument": {
"commentStart": 63,
"end": 68, "end": 68,
"name": "scale", "name": "scale",
"start": 63, "start": 63,
"type": "Identifier", "type": "Identifier",
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 62,
"end": 68, "end": 68,
"operator": "-", "operator": "-",
"start": 62, "start": 62,
@ -93,6 +106,7 @@ expression: actual
"type": "ArrayExpression" "type": "ArrayExpression"
}, },
{ {
"commentStart": 71,
"end": 72, "end": 72,
"start": 71, "start": 71,
"type": "PipeSubstitution", "type": "PipeSubstitution",
@ -100,17 +114,20 @@ expression: actual
} }
], ],
"callee": { "callee": {
"commentStart": 53,
"end": 57, "end": 57,
"name": "line", "name": "line",
"start": 53, "start": 53,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 53,
"end": 73, "end": 73,
"start": 53, "start": 53,
"type": "CallExpression", "type": "CallExpression",
"type": "CallExpression" "type": "CallExpression"
} }
], ],
"commentStart": 5,
"end": 73, "end": 73,
"start": 5, "start": 5,
"type": "PipeExpression", "type": "PipeExpression",
@ -126,6 +143,7 @@ expression: actual
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 73, "end": 73,
"start": 0 "start": 0
} }

View File

@ -23,19 +23,31 @@ impl Program {
.map(|sh| format!("{}\n\n", sh.inner.content)) .map(|sh| format!("{}\n\n", sh.inner.content))
.unwrap_or_default(); .unwrap_or_default();
for attr in &self.inner_attrs {
result.push_str(&attr.recast(options, indentation_level));
}
for start in &self.non_code_meta.start_nodes { for start in &self.non_code_meta.start_nodes {
result.push_str(&start.recast(options, indentation_level)); result.push_str(&start.recast(options, indentation_level));
} }
let result = result; // Remove mutation. for attr in &self.inner_attrs {
result.push_str(&attr.recast(options, indentation_level));
}
if !self.inner_attrs.is_empty() {
result.push('\n');
}
let result = result; // Remove mutation.
let result = self let result = self
.body .body
.iter() .iter()
.map(|body_item| { .map(|body_item| {
let mut result = String::new(); let mut result = String::new();
for comment in body_item.get_comments() {
if !comment.is_empty() {
result.push_str(&indentation);
result.push_str(comment);
}
if !result.ends_with("\n\n") && result != "\n" {
result.push('\n');
}
}
for attr in body_item.get_attrs() { for attr in body_item.get_attrs() {
result.push_str(&attr.recast(options, indentation_level)); result.push_str(&attr.recast(options, indentation_level));
} }
@ -173,7 +185,18 @@ impl Node<NonCodeNode> {
impl Node<Annotation> { impl Node<Annotation> {
fn recast(&self, options: &FormatOptions, indentation_level: usize) -> String { fn recast(&self, options: &FormatOptions, indentation_level: usize) -> String {
let mut result = "@".to_owned(); let indentation = options.get_indentation(indentation_level);
let mut result = String::new();
for comment in &self.pre_comments {
if !comment.is_empty() {
result.push_str(&indentation);
result.push_str(comment);
}
if !comment.ends_with("*/") && !result.ends_with("\n\n") && result != "\n" {
result.push('\n');
}
}
result.push('@');
if let Some(name) = &self.name { if let Some(name) = &self.name {
result.push_str(&name.name); result.push_str(&name.name);
} }
@ -956,6 +979,7 @@ mod tests {
fn test_recast_annotations_in_function_body() { fn test_recast_annotations_in_function_body() {
let input = r#"fn myFunc() { let input = r#"fn myFunc() {
@meta(yes = true) @meta(yes = true)
x = 2 x = 2
} }
"#; "#;
@ -975,6 +999,25 @@ mod tests {
assert_eq!(output, input); assert_eq!(output, input);
} }
#[test]
fn recast_annotations_with_comments() {
let input = r#"// Start comment
// Comment on attr
@settings(defaultLengthUnit = in)
// Comment on item
foo = 42
// Comment on another item
@(impl = kcl)
bar = 0
"#;
let program = crate::parsing::top_level_parse(input).unwrap();
let output = program.recast(&Default::default(), 0);
assert_eq!(output, input);
}
#[test] #[test]
fn test_recast_if_else_if_same() { fn test_recast_if_else_if_same() {
let input = r#"b = if false { let input = r#"b = if false {
@ -1241,7 +1284,6 @@ outsideRevolve = startSketchOn('XZ')
r#"// Ball Bearing r#"// Ball Bearing
// A ball bearing is a type of rolling-element bearing that uses balls to maintain the separation between the bearing races. The primary purpose of a ball bearing is to reduce rotational friction and support radial and axial loads. // A ball bearing is a type of rolling-element bearing that uses balls to maintain the separation between the bearing races. The primary purpose of a ball bearing is to reduce rotational friction and support radial and axial loads.
// Define constants like ball diameter, inside diameter, overhange length, and thickness // Define constants like ball diameter, inside diameter, overhange length, and thickness
sphereDia = 0.5 sphereDia = 0.5
insideDia = 1 insideDia = 1
@ -1643,6 +1685,7 @@ tabs_l = startSketchOn({
assert_eq!( assert_eq!(
recasted, recasted,
r#"@settings(units = mm) r#"@settings(units = mm)
// define nts // define nts
radius = 6.0 radius = 6.0
width = 144.0 width = 144.0
@ -2633,4 +2676,35 @@ sketch002 = startSketchOn({
); );
} }
} }
#[test]
fn code_with_comment_and_extra_lines() {
let code = r#"yo = 'c'
/* this is
a
comment */
yo = 'bing'
"#;
let ast = crate::parsing::top_level_parse(code).unwrap();
let recasted = ast.recast(&FormatOptions::new(), 0);
assert_eq!(recasted, code);
}
#[test]
fn comments_in_a_fn_block() {
let code = r#"fn myFn() {
// this is a comment
yo = { a = { b = { c = '123' } } }
/* block
comment */
key = 'c'
// this is also a comment
}
"#;
let ast = crate::parsing::top_level_parse(code).unwrap();
let recasted = ast.recast(&FormatOptions::new(), 0);
assert_eq!(recasted, code);
}
} }

File diff suppressed because it is too large Load Diff

View File

@ -6,9 +6,12 @@ description: Result of parsing angled_line.kcl
"Ok": { "Ok": {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 0,
"end": 0, "end": 0,
"id": { "id": {
"commentStart": 0,
"end": 0, "end": 0,
"name": "part001", "name": "part001",
"start": 0, "start": 0,
@ -19,6 +22,7 @@ description: Result of parsing angled_line.kcl
{ {
"arguments": [ "arguments": [
{ {
"commentStart": 24,
"end": 0, "end": 0,
"raw": "'XY'", "raw": "'XY'",
"start": 0, "start": 0,
@ -28,11 +32,13 @@ description: Result of parsing angled_line.kcl
} }
], ],
"callee": { "callee": {
"commentStart": 10,
"end": 0, "end": 0,
"name": "startSketchOn", "name": "startSketchOn",
"start": 0, "start": 0,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 10,
"end": 0, "end": 0,
"start": 0, "start": 0,
"type": "CallExpression", "type": "CallExpression",
@ -41,8 +47,10 @@ description: Result of parsing angled_line.kcl
{ {
"arguments": [ "arguments": [
{ {
"commentStart": 50,
"elements": [ "elements": [
{ {
"commentStart": 51,
"end": 0, "end": 0,
"raw": "4.83", "raw": "4.83",
"start": 0, "start": 0,
@ -54,6 +62,7 @@ description: Result of parsing angled_line.kcl
} }
}, },
{ {
"commentStart": 57,
"end": 0, "end": 0,
"raw": "12.56", "raw": "12.56",
"start": 0, "start": 0,
@ -71,6 +80,7 @@ description: Result of parsing angled_line.kcl
"type": "ArrayExpression" "type": "ArrayExpression"
}, },
{ {
"commentStart": 65,
"end": 0, "end": 0,
"start": 0, "start": 0,
"type": "PipeSubstitution", "type": "PipeSubstitution",
@ -78,11 +88,13 @@ description: Result of parsing angled_line.kcl
} }
], ],
"callee": { "callee": {
"commentStart": 35,
"end": 0, "end": 0,
"name": "startProfileAt", "name": "startProfileAt",
"start": 0, "start": 0,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 35,
"end": 0, "end": 0,
"start": 0, "start": 0,
"type": "CallExpression", "type": "CallExpression",
@ -93,14 +105,17 @@ description: Result of parsing angled_line.kcl
{ {
"type": "LabeledArg", "type": "LabeledArg",
"label": { "label": {
"commentStart": 78,
"end": 0, "end": 0,
"name": "end", "name": "end",
"start": 0, "start": 0,
"type": "Identifier" "type": "Identifier"
}, },
"arg": { "arg": {
"commentStart": 84,
"elements": [ "elements": [
{ {
"commentStart": 85,
"end": 0, "end": 0,
"raw": "15.1", "raw": "15.1",
"start": 0, "start": 0,
@ -112,6 +127,7 @@ description: Result of parsing angled_line.kcl
} }
}, },
{ {
"commentStart": 91,
"end": 0, "end": 0,
"raw": "2.48", "raw": "2.48",
"start": 0, "start": 0,
@ -131,11 +147,13 @@ description: Result of parsing angled_line.kcl
} }
], ],
"callee": { "callee": {
"commentStart": 73,
"end": 0, "end": 0,
"name": "line", "name": "line",
"start": 0, "start": 0,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 73,
"end": 0, "end": 0,
"start": 0, "start": 0,
"type": "CallExpressionKw", "type": "CallExpressionKw",
@ -147,14 +165,17 @@ description: Result of parsing angled_line.kcl
{ {
"type": "LabeledArg", "type": "LabeledArg",
"label": { "label": {
"commentStart": 108,
"end": 0, "end": 0,
"name": "end", "name": "end",
"start": 0, "start": 0,
"type": "Identifier" "type": "Identifier"
}, },
"arg": { "arg": {
"commentStart": 114,
"elements": [ "elements": [
{ {
"commentStart": 115,
"end": 0, "end": 0,
"raw": "3.15", "raw": "3.15",
"start": 0, "start": 0,
@ -167,6 +188,7 @@ description: Result of parsing angled_line.kcl
}, },
{ {
"argument": { "argument": {
"commentStart": 122,
"end": 0, "end": 0,
"raw": "9.85", "raw": "9.85",
"start": 0, "start": 0,
@ -177,6 +199,7 @@ description: Result of parsing angled_line.kcl
"suffix": "None" "suffix": "None"
} }
}, },
"commentStart": 121,
"end": 0, "end": 0,
"operator": "-", "operator": "-",
"start": 0, "start": 0,
@ -193,12 +216,14 @@ description: Result of parsing angled_line.kcl
{ {
"type": "LabeledArg", "type": "LabeledArg",
"label": { "label": {
"commentStart": 129,
"end": 0, "end": 0,
"name": "tag", "name": "tag",
"start": 0, "start": 0,
"type": "Identifier" "type": "Identifier"
}, },
"arg": { "arg": {
"commentStart": 135,
"end": 0, "end": 0,
"start": 0, "start": 0,
"type": "TagDeclarator", "type": "TagDeclarator",
@ -208,11 +233,13 @@ description: Result of parsing angled_line.kcl
} }
], ],
"callee": { "callee": {
"commentStart": 103,
"end": 0, "end": 0,
"name": "line", "name": "line",
"start": 0, "start": 0,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 103,
"end": 0, "end": 0,
"start": 0, "start": 0,
"type": "CallExpressionKw", "type": "CallExpressionKw",
@ -224,15 +251,18 @@ description: Result of parsing angled_line.kcl
{ {
"type": "LabeledArg", "type": "LabeledArg",
"label": { "label": {
"commentStart": 153,
"end": 0, "end": 0,
"name": "end", "name": "end",
"start": 0, "start": 0,
"type": "Identifier" "type": "Identifier"
}, },
"arg": { "arg": {
"commentStart": 159,
"elements": [ "elements": [
{ {
"argument": { "argument": {
"commentStart": 161,
"end": 0, "end": 0,
"raw": "15.17", "raw": "15.17",
"start": 0, "start": 0,
@ -243,6 +273,7 @@ description: Result of parsing angled_line.kcl
"suffix": "None" "suffix": "None"
} }
}, },
"commentStart": 160,
"end": 0, "end": 0,
"operator": "-", "operator": "-",
"start": 0, "start": 0,
@ -251,6 +282,7 @@ description: Result of parsing angled_line.kcl
}, },
{ {
"argument": { "argument": {
"commentStart": 169,
"end": 0, "end": 0,
"raw": "4.1", "raw": "4.1",
"start": 0, "start": 0,
@ -261,6 +293,7 @@ description: Result of parsing angled_line.kcl
"suffix": "None" "suffix": "None"
} }
}, },
"commentStart": 168,
"end": 0, "end": 0,
"operator": "-", "operator": "-",
"start": 0, "start": 0,
@ -276,11 +309,13 @@ description: Result of parsing angled_line.kcl
} }
], ],
"callee": { "callee": {
"commentStart": 148,
"end": 0, "end": 0,
"name": "line", "name": "line",
"start": 0, "start": 0,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 148,
"end": 0, "end": 0,
"start": 0, "start": 0,
"type": "CallExpressionKw", "type": "CallExpressionKw",
@ -290,10 +325,12 @@ description: Result of parsing angled_line.kcl
{ {
"arguments": [ "arguments": [
{ {
"commentStart": 191,
"elements": [ "elements": [
{ {
"arguments": [ "arguments": [
{ {
"commentStart": 199,
"end": 0, "end": 0,
"name": "seg01", "name": "seg01",
"start": 0, "start": 0,
@ -302,17 +339,20 @@ description: Result of parsing angled_line.kcl
} }
], ],
"callee": { "callee": {
"commentStart": 192,
"end": 0, "end": 0,
"name": "segAng", "name": "segAng",
"start": 0, "start": 0,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 192,
"end": 0, "end": 0,
"start": 0, "start": 0,
"type": "CallExpression", "type": "CallExpression",
"type": "CallExpression" "type": "CallExpression"
}, },
{ {
"commentStart": 207,
"end": 0, "end": 0,
"raw": "12.35", "raw": "12.35",
"start": 0, "start": 0,
@ -330,6 +370,7 @@ description: Result of parsing angled_line.kcl
"type": "ArrayExpression" "type": "ArrayExpression"
}, },
{ {
"commentStart": 215,
"end": 0, "end": 0,
"start": 0, "start": 0,
"type": "PipeSubstitution", "type": "PipeSubstitution",
@ -337,11 +378,13 @@ description: Result of parsing angled_line.kcl
} }
], ],
"callee": { "callee": {
"commentStart": 180,
"end": 0, "end": 0,
"name": "angledLine", "name": "angledLine",
"start": 0, "start": 0,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 180,
"end": 0, "end": 0,
"start": 0, "start": 0,
"type": "CallExpression", "type": "CallExpression",
@ -352,15 +395,18 @@ description: Result of parsing angled_line.kcl
{ {
"type": "LabeledArg", "type": "LabeledArg",
"label": { "label": {
"commentStart": 228,
"end": 0, "end": 0,
"name": "end", "name": "end",
"start": 0, "start": 0,
"type": "Identifier" "type": "Identifier"
}, },
"arg": { "arg": {
"commentStart": 234,
"elements": [ "elements": [
{ {
"argument": { "argument": {
"commentStart": 236,
"end": 0, "end": 0,
"raw": "13.02", "raw": "13.02",
"start": 0, "start": 0,
@ -371,6 +417,7 @@ description: Result of parsing angled_line.kcl
"suffix": "None" "suffix": "None"
} }
}, },
"commentStart": 235,
"end": 0, "end": 0,
"operator": "-", "operator": "-",
"start": 0, "start": 0,
@ -378,6 +425,7 @@ description: Result of parsing angled_line.kcl
"type": "UnaryExpression" "type": "UnaryExpression"
}, },
{ {
"commentStart": 243,
"end": 0, "end": 0,
"raw": "10.03", "raw": "10.03",
"start": 0, "start": 0,
@ -397,11 +445,13 @@ description: Result of parsing angled_line.kcl
} }
], ],
"callee": { "callee": {
"commentStart": 223,
"end": 0, "end": 0,
"name": "line", "name": "line",
"start": 0, "start": 0,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 223,
"end": 0, "end": 0,
"start": 0, "start": 0,
"type": "CallExpressionKw", "type": "CallExpressionKw",
@ -411,6 +461,7 @@ description: Result of parsing angled_line.kcl
{ {
"arguments": [ "arguments": [
{ {
"commentStart": 262,
"end": 0, "end": 0,
"start": 0, "start": 0,
"type": "PipeSubstitution", "type": "PipeSubstitution",
@ -418,11 +469,13 @@ description: Result of parsing angled_line.kcl
} }
], ],
"callee": { "callee": {
"commentStart": 256,
"end": 0, "end": 0,
"name": "close", "name": "close",
"start": 0, "start": 0,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 256,
"end": 0, "end": 0,
"start": 0, "start": 0,
"type": "CallExpression", "type": "CallExpression",
@ -433,12 +486,14 @@ description: Result of parsing angled_line.kcl
{ {
"type": "LabeledArg", "type": "LabeledArg",
"label": { "label": {
"commentStart": 278,
"end": 0, "end": 0,
"name": "length", "name": "length",
"start": 0, "start": 0,
"type": "Identifier" "type": "Identifier"
}, },
"arg": { "arg": {
"commentStart": 287,
"end": 0, "end": 0,
"raw": "4", "raw": "4",
"start": 0, "start": 0,
@ -452,11 +507,13 @@ description: Result of parsing angled_line.kcl
} }
], ],
"callee": { "callee": {
"commentStart": 270,
"end": 0, "end": 0,
"name": "extrude", "name": "extrude",
"start": 0, "start": 0,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 270,
"end": 0, "end": 0,
"start": 0, "start": 0,
"type": "CallExpressionKw", "type": "CallExpressionKw",
@ -464,6 +521,7 @@ description: Result of parsing angled_line.kcl
"unlabeled": null "unlabeled": null
} }
], ],
"commentStart": 10,
"end": 0, "end": 0,
"start": 0, "start": 0,
"type": "PipeExpression", "type": "PipeExpression",
@ -479,6 +537,7 @@ description: Result of parsing angled_line.kcl
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 0, "end": 0,
"start": 0 "start": 0
} }

View File

@ -22,6 +22,7 @@ description: Variables in memory after executing angled_line.kcl
"id": "[uuid]", "id": "[uuid]",
"sourceRange": [], "sourceRange": [],
"tag": { "tag": {
"commentStart": 135,
"end": 141, "end": 141,
"start": 135, "start": 135,
"type": "TagDeclarator", "type": "TagDeclarator",
@ -91,6 +92,7 @@ description: Variables in memory after executing angled_line.kcl
15.04 15.04
], ],
"tag": { "tag": {
"commentStart": 135,
"end": 141, "end": 141,
"start": 135, "start": 135,
"type": "TagDeclarator", "type": "TagDeclarator",

View File

@ -6,9 +6,12 @@ description: Result of parsing argument_error.kcl
"Ok": { "Ok": {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 3,
"end": 0, "end": 0,
"id": { "id": {
"commentStart": 3,
"end": 0, "end": 0,
"name": "f", "name": "f",
"start": 0, "start": 0,
@ -19,6 +22,7 @@ description: Result of parsing argument_error.kcl
"body": [ "body": [
{ {
"argument": { "argument": {
"commentStart": 19,
"end": 0, "end": 0,
"raw": "5", "raw": "5",
"start": 0, "start": 0,
@ -29,20 +33,24 @@ description: Result of parsing argument_error.kcl
"suffix": "None" "suffix": "None"
} }
}, },
"commentStart": 12,
"end": 0, "end": 0,
"start": 0, "start": 0,
"type": "ReturnStatement", "type": "ReturnStatement",
"type": "ReturnStatement" "type": "ReturnStatement"
} }
], ],
"commentStart": 8,
"end": 0, "end": 0,
"start": 0 "start": 0
}, },
"commentStart": 4,
"end": 0, "end": 0,
"params": [ "params": [
{ {
"type": "Parameter", "type": "Parameter",
"identifier": { "identifier": {
"commentStart": 5,
"end": 0, "end": 0,
"name": "i", "name": "i",
"start": 0, "start": 0,
@ -64,10 +72,12 @@ description: Result of parsing argument_error.kcl
"type": "VariableDeclaration" "type": "VariableDeclaration"
}, },
{ {
"commentStart": 22,
"end": 0, "end": 0,
"expression": { "expression": {
"arguments": [ "arguments": [
{ {
"commentStart": 28,
"end": 0, "end": 0,
"name": "f", "name": "f",
"start": 0, "start": 0,
@ -75,8 +85,10 @@ description: Result of parsing argument_error.kcl
"type": "Identifier" "type": "Identifier"
}, },
{ {
"commentStart": 31,
"elements": [ "elements": [
{ {
"commentStart": 32,
"end": 0, "end": 0,
"raw": "0", "raw": "0",
"start": 0, "start": 0,
@ -88,6 +100,7 @@ description: Result of parsing argument_error.kcl
} }
}, },
{ {
"commentStart": 35,
"end": 0, "end": 0,
"raw": "1", "raw": "1",
"start": 0, "start": 0,
@ -106,11 +119,13 @@ description: Result of parsing argument_error.kcl
} }
], ],
"callee": { "callee": {
"commentStart": 24,
"end": 0, "end": 0,
"name": "map", "name": "map",
"start": 0, "start": 0,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 24,
"end": 0, "end": 0,
"start": 0, "start": 0,
"type": "CallExpression", "type": "CallExpression",
@ -121,11 +136,13 @@ description: Result of parsing argument_error.kcl
"type": "ExpressionStatement" "type": "ExpressionStatement"
} }
], ],
"commentStart": 0,
"end": 0, "end": 0,
"nonCodeMeta": { "nonCodeMeta": {
"nonCodeNodes": { "nonCodeNodes": {
"0": [ "0": [
{ {
"commentStart": 22,
"end": 0, "end": 0,
"start": 0, "start": 0,
"type": "NonCodeNode", "type": "NonCodeNode",

View File

@ -6,17 +6,22 @@ description: Result of parsing array_elem_pop.kcl
"Ok": { "Ok": {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 0,
"end": 0, "end": 0,
"id": { "id": {
"commentStart": 0,
"end": 0, "end": 0,
"name": "arr", "name": "arr",
"start": 0, "start": 0,
"type": "Identifier" "type": "Identifier"
}, },
"init": { "init": {
"commentStart": 6,
"elements": [ "elements": [
{ {
"commentStart": 7,
"end": 0, "end": 0,
"raw": "1", "raw": "1",
"start": 0, "start": 0,
@ -28,6 +33,7 @@ description: Result of parsing array_elem_pop.kcl
} }
}, },
{ {
"commentStart": 10,
"end": 0, "end": 0,
"raw": "2", "raw": "2",
"start": 0, "start": 0,
@ -39,6 +45,7 @@ description: Result of parsing array_elem_pop.kcl
} }
}, },
{ {
"commentStart": 13,
"end": 0, "end": 0,
"raw": "3", "raw": "3",
"start": 0, "start": 0,
@ -65,9 +72,12 @@ description: Result of parsing array_elem_pop.kcl
"type": "VariableDeclaration" "type": "VariableDeclaration"
}, },
{ {
"commentStart": 16,
"declaration": { "declaration": {
"commentStart": 16,
"end": 0, "end": 0,
"id": { "id": {
"commentStart": 16,
"end": 0, "end": 0,
"name": "new_arr1", "name": "new_arr1",
"start": 0, "start": 0,
@ -76,6 +86,7 @@ description: Result of parsing array_elem_pop.kcl
"init": { "init": {
"arguments": [ "arguments": [
{ {
"commentStart": 31,
"end": 0, "end": 0,
"name": "arr", "name": "arr",
"start": 0, "start": 0,
@ -84,11 +95,13 @@ description: Result of parsing array_elem_pop.kcl
} }
], ],
"callee": { "callee": {
"commentStart": 27,
"end": 0, "end": 0,
"name": "pop", "name": "pop",
"start": 0, "start": 0,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 27,
"end": 0, "end": 0,
"start": 0, "start": 0,
"type": "CallExpression", "type": "CallExpression",
@ -104,9 +117,12 @@ description: Result of parsing array_elem_pop.kcl
"type": "VariableDeclaration" "type": "VariableDeclaration"
}, },
{ {
"commentStart": 36,
"declaration": { "declaration": {
"commentStart": 36,
"end": 0, "end": 0,
"id": { "id": {
"commentStart": 36,
"end": 0, "end": 0,
"name": "new_arr2", "name": "new_arr2",
"start": 0, "start": 0,
@ -115,6 +131,7 @@ description: Result of parsing array_elem_pop.kcl
"init": { "init": {
"arguments": [ "arguments": [
{ {
"commentStart": 51,
"end": 0, "end": 0,
"name": "new_arr1", "name": "new_arr1",
"start": 0, "start": 0,
@ -123,11 +140,13 @@ description: Result of parsing array_elem_pop.kcl
} }
], ],
"callee": { "callee": {
"commentStart": 47,
"end": 0, "end": 0,
"name": "pop", "name": "pop",
"start": 0, "start": 0,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 47,
"end": 0, "end": 0,
"start": 0, "start": 0,
"type": "CallExpression", "type": "CallExpression",
@ -143,9 +162,12 @@ description: Result of parsing array_elem_pop.kcl
"type": "VariableDeclaration" "type": "VariableDeclaration"
}, },
{ {
"commentStart": 61,
"declaration": { "declaration": {
"commentStart": 61,
"end": 0, "end": 0,
"id": { "id": {
"commentStart": 61,
"end": 0, "end": 0,
"name": "new_arr3", "name": "new_arr3",
"start": 0, "start": 0,
@ -154,6 +176,7 @@ description: Result of parsing array_elem_pop.kcl
"init": { "init": {
"arguments": [ "arguments": [
{ {
"commentStart": 76,
"end": 0, "end": 0,
"name": "new_arr2", "name": "new_arr2",
"start": 0, "start": 0,
@ -162,11 +185,13 @@ description: Result of parsing array_elem_pop.kcl
} }
], ],
"callee": { "callee": {
"commentStart": 72,
"end": 0, "end": 0,
"name": "pop", "name": "pop",
"start": 0, "start": 0,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 72,
"end": 0, "end": 0,
"start": 0, "start": 0,
"type": "CallExpression", "type": "CallExpression",
@ -182,13 +207,16 @@ description: Result of parsing array_elem_pop.kcl
"type": "VariableDeclaration" "type": "VariableDeclaration"
}, },
{ {
"commentStart": 86,
"end": 0, "end": 0,
"expression": { "expression": {
"arguments": [ "arguments": [
{ {
"commentStart": 98,
"computed": false, "computed": false,
"end": 0, "end": 0,
"object": { "object": {
"commentStart": 98,
"end": 0, "end": 0,
"name": "new_arr1", "name": "new_arr1",
"start": 0, "start": 0,
@ -196,6 +224,7 @@ description: Result of parsing array_elem_pop.kcl
"type": "Identifier" "type": "Identifier"
}, },
"property": { "property": {
"commentStart": 107,
"end": 0, "end": 0,
"raw": "0", "raw": "0",
"start": 0, "start": 0,
@ -211,6 +240,7 @@ description: Result of parsing array_elem_pop.kcl
"type": "MemberExpression" "type": "MemberExpression"
}, },
{ {
"commentStart": 111,
"end": 0, "end": 0,
"raw": "1", "raw": "1",
"start": 0, "start": 0,
@ -222,6 +252,7 @@ description: Result of parsing array_elem_pop.kcl
} }
}, },
{ {
"commentStart": 114,
"end": 0, "end": 0,
"raw": "0.00001", "raw": "0.00001",
"start": 0, "start": 0,
@ -233,6 +264,7 @@ description: Result of parsing array_elem_pop.kcl
} }
}, },
{ {
"commentStart": 123,
"end": 0, "end": 0,
"raw": "\"element 0 should not have changed\"", "raw": "\"element 0 should not have changed\"",
"start": 0, "start": 0,
@ -242,11 +274,13 @@ description: Result of parsing array_elem_pop.kcl
} }
], ],
"callee": { "callee": {
"commentStart": 86,
"end": 0, "end": 0,
"name": "assertEqual", "name": "assertEqual",
"start": 0, "start": 0,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 86,
"end": 0, "end": 0,
"start": 0, "start": 0,
"type": "CallExpression", "type": "CallExpression",
@ -257,13 +291,16 @@ description: Result of parsing array_elem_pop.kcl
"type": "ExpressionStatement" "type": "ExpressionStatement"
}, },
{ {
"commentStart": 160,
"end": 0, "end": 0,
"expression": { "expression": {
"arguments": [ "arguments": [
{ {
"commentStart": 172,
"computed": false, "computed": false,
"end": 0, "end": 0,
"object": { "object": {
"commentStart": 172,
"end": 0, "end": 0,
"name": "new_arr1", "name": "new_arr1",
"start": 0, "start": 0,
@ -271,6 +308,7 @@ description: Result of parsing array_elem_pop.kcl
"type": "Identifier" "type": "Identifier"
}, },
"property": { "property": {
"commentStart": 181,
"end": 0, "end": 0,
"raw": "1", "raw": "1",
"start": 0, "start": 0,
@ -286,6 +324,7 @@ description: Result of parsing array_elem_pop.kcl
"type": "MemberExpression" "type": "MemberExpression"
}, },
{ {
"commentStart": 185,
"end": 0, "end": 0,
"raw": "2", "raw": "2",
"start": 0, "start": 0,
@ -297,6 +336,7 @@ description: Result of parsing array_elem_pop.kcl
} }
}, },
{ {
"commentStart": 188,
"end": 0, "end": 0,
"raw": "0.00001", "raw": "0.00001",
"start": 0, "start": 0,
@ -308,6 +348,7 @@ description: Result of parsing array_elem_pop.kcl
} }
}, },
{ {
"commentStart": 197,
"end": 0, "end": 0,
"raw": "\"element 1 should not have changed\"", "raw": "\"element 1 should not have changed\"",
"start": 0, "start": 0,
@ -317,11 +358,13 @@ description: Result of parsing array_elem_pop.kcl
} }
], ],
"callee": { "callee": {
"commentStart": 160,
"end": 0, "end": 0,
"name": "assertEqual", "name": "assertEqual",
"start": 0, "start": 0,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 160,
"end": 0, "end": 0,
"start": 0, "start": 0,
"type": "CallExpression", "type": "CallExpression",
@ -332,13 +375,16 @@ description: Result of parsing array_elem_pop.kcl
"type": "ExpressionStatement" "type": "ExpressionStatement"
}, },
{ {
"commentStart": 234,
"end": 0, "end": 0,
"expression": { "expression": {
"arguments": [ "arguments": [
{ {
"commentStart": 246,
"computed": false, "computed": false,
"end": 0, "end": 0,
"object": { "object": {
"commentStart": 246,
"end": 0, "end": 0,
"name": "new_arr2", "name": "new_arr2",
"start": 0, "start": 0,
@ -346,6 +392,7 @@ description: Result of parsing array_elem_pop.kcl
"type": "Identifier" "type": "Identifier"
}, },
"property": { "property": {
"commentStart": 255,
"end": 0, "end": 0,
"raw": "0", "raw": "0",
"start": 0, "start": 0,
@ -361,6 +408,7 @@ description: Result of parsing array_elem_pop.kcl
"type": "MemberExpression" "type": "MemberExpression"
}, },
{ {
"commentStart": 259,
"end": 0, "end": 0,
"raw": "1", "raw": "1",
"start": 0, "start": 0,
@ -372,6 +420,7 @@ description: Result of parsing array_elem_pop.kcl
} }
}, },
{ {
"commentStart": 262,
"end": 0, "end": 0,
"raw": "0.00001", "raw": "0.00001",
"start": 0, "start": 0,
@ -383,6 +432,7 @@ description: Result of parsing array_elem_pop.kcl
} }
}, },
{ {
"commentStart": 271,
"end": 0, "end": 0,
"raw": "\"element 0 should not have changed\"", "raw": "\"element 0 should not have changed\"",
"start": 0, "start": 0,
@ -392,11 +442,13 @@ description: Result of parsing array_elem_pop.kcl
} }
], ],
"callee": { "callee": {
"commentStart": 234,
"end": 0, "end": 0,
"name": "assertEqual", "name": "assertEqual",
"start": 0, "start": 0,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 234,
"end": 0, "end": 0,
"start": 0, "start": 0,
"type": "CallExpression", "type": "CallExpression",
@ -407,6 +459,7 @@ description: Result of parsing array_elem_pop.kcl
"type": "ExpressionStatement" "type": "ExpressionStatement"
} }
], ],
"commentStart": 0,
"end": 0, "end": 0,
"start": 0 "start": 0
} }

View File

@ -6,15 +6,19 @@ description: Result of parsing array_elem_pop_empty_fail.kcl
"Ok": { "Ok": {
"body": [ "body": [
{ {
"commentStart": 0,
"declaration": { "declaration": {
"commentStart": 0,
"end": 0, "end": 0,
"id": { "id": {
"commentStart": 0,
"end": 0, "end": 0,
"name": "arr", "name": "arr",
"start": 0, "start": 0,
"type": "Identifier" "type": "Identifier"
}, },
"init": { "init": {
"commentStart": 6,
"elements": [], "elements": [],
"end": 0, "end": 0,
"start": 0, "start": 0,
@ -31,9 +35,12 @@ description: Result of parsing array_elem_pop_empty_fail.kcl
"type": "VariableDeclaration" "type": "VariableDeclaration"
}, },
{ {
"commentStart": 9,
"declaration": { "declaration": {
"commentStart": 9,
"end": 0, "end": 0,
"id": { "id": {
"commentStart": 9,
"end": 0, "end": 0,
"name": "fail", "name": "fail",
"start": 0, "start": 0,
@ -42,6 +49,7 @@ description: Result of parsing array_elem_pop_empty_fail.kcl
"init": { "init": {
"arguments": [ "arguments": [
{ {
"commentStart": 20,
"end": 0, "end": 0,
"name": "arr", "name": "arr",
"start": 0, "start": 0,
@ -50,11 +58,13 @@ description: Result of parsing array_elem_pop_empty_fail.kcl
} }
], ],
"callee": { "callee": {
"commentStart": 16,
"end": 0, "end": 0,
"name": "pop", "name": "pop",
"start": 0, "start": 0,
"type": "Identifier" "type": "Identifier"
}, },
"commentStart": 16,
"end": 0, "end": 0,
"start": 0, "start": 0,
"type": "CallExpression", "type": "CallExpression",
@ -70,6 +80,7 @@ description: Result of parsing array_elem_pop_empty_fail.kcl
"type": "VariableDeclaration" "type": "VariableDeclaration"
} }
], ],
"commentStart": 0,
"end": 0, "end": 0,
"start": 0 "start": 0
} }

Some files were not shown because too many files have changed in this diff Show More