KCL: No 'let' or 'const' required when declaring vars (#4063)
Previously variable declaration required a keyword, e.g. ```kcl let x = 4 const x = 4 var x = 4 ``` These were all valid, and did the exact same thing. As of this PR, they're all still valid, but the KCL formatter will change them all to just: ```kcl x = 4 ``` which is the new preferred way to declare a constant. But the formatter will remove the var/let/const keywords. Closes https://github.com/KittyCAD/modeling-app/issues/3985
This commit is contained in:
		@ -29,7 +29,7 @@ loft(sketches: [Sketch], data?: LoftData) -> Solid
 | 
			
		||||
 | 
			
		||||
```js
 | 
			
		||||
// Loft a square and a triangle.
 | 
			
		||||
const squareSketch = startSketchOn('XY')
 | 
			
		||||
squareSketch = startSketchOn('XY')
 | 
			
		||||
  |> startProfileAt([-100, 200], %)
 | 
			
		||||
  |> line([200, 0], %)
 | 
			
		||||
  |> line([0, -200], %)
 | 
			
		||||
@ -37,7 +37,7 @@ const squareSketch = startSketchOn('XY')
 | 
			
		||||
  |> lineTo([profileStartX(%), profileStartY(%)], %)
 | 
			
		||||
  |> close(%)
 | 
			
		||||
 | 
			
		||||
const triangleSketch = startSketchOn(offsetPlane('XY', 75))
 | 
			
		||||
triangleSketch = startSketchOn(offsetPlane('XY', 75))
 | 
			
		||||
  |> startProfileAt([0, 125], %)
 | 
			
		||||
  |> line([-15, -30], %)
 | 
			
		||||
  |> line([30, 0], %)
 | 
			
		||||
@ -51,7 +51,7 @@ loft([squareSketch, triangleSketch])
 | 
			
		||||
 | 
			
		||||
```js
 | 
			
		||||
// Loft a square, a circle, and another circle.
 | 
			
		||||
const squareSketch = startSketchOn('XY')
 | 
			
		||||
squareSketch = startSketchOn('XY')
 | 
			
		||||
  |> startProfileAt([-100, 200], %)
 | 
			
		||||
  |> line([200, 0], %)
 | 
			
		||||
  |> line([0, -200], %)
 | 
			
		||||
@ -59,10 +59,10 @@ const squareSketch = startSketchOn('XY')
 | 
			
		||||
  |> lineTo([profileStartX(%), profileStartY(%)], %)
 | 
			
		||||
  |> close(%)
 | 
			
		||||
 | 
			
		||||
const circleSketch0 = startSketchOn(offsetPlane('XY', 75))
 | 
			
		||||
circleSketch0 = startSketchOn(offsetPlane('XY', 75))
 | 
			
		||||
  |> circle({ center: [0, 100], radius: 50 }, %)
 | 
			
		||||
 | 
			
		||||
const circleSketch1 = startSketchOn(offsetPlane('XY', 150))
 | 
			
		||||
circleSketch1 = startSketchOn(offsetPlane('XY', 150))
 | 
			
		||||
  |> circle({ center: [0, 100], radius: 20 }, %)
 | 
			
		||||
 | 
			
		||||
loft([
 | 
			
		||||
@ -76,7 +76,7 @@ loft([
 | 
			
		||||
 | 
			
		||||
```js
 | 
			
		||||
// Loft a square, a circle, and another circle with options.
 | 
			
		||||
const squareSketch = startSketchOn('XY')
 | 
			
		||||
squareSketch = startSketchOn('XY')
 | 
			
		||||
  |> startProfileAt([-100, 200], %)
 | 
			
		||||
  |> line([200, 0], %)
 | 
			
		||||
  |> line([0, -200], %)
 | 
			
		||||
@ -84,10 +84,10 @@ const squareSketch = startSketchOn('XY')
 | 
			
		||||
  |> lineTo([profileStartX(%), profileStartY(%)], %)
 | 
			
		||||
  |> close(%)
 | 
			
		||||
 | 
			
		||||
const circleSketch0 = startSketchOn(offsetPlane('XY', 75))
 | 
			
		||||
circleSketch0 = startSketchOn(offsetPlane('XY', 75))
 | 
			
		||||
  |> circle({ center: [0, 100], radius: 50 }, %)
 | 
			
		||||
 | 
			
		||||
const circleSketch1 = startSketchOn(offsetPlane('XY', 150))
 | 
			
		||||
circleSketch1 = startSketchOn(offsetPlane('XY', 150))
 | 
			
		||||
  |> circle({ center: [0, 100], radius: 20 }, %)
 | 
			
		||||
 | 
			
		||||
loft([
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user