Compare commits
	
		
			9 Commits
		
	
	
		
			nightly-v2
			...
			nrc-refact
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 7fd9eb3322 | |||
| 5aef2b72cb | |||
| 8ccdf2286d | |||
| 054e235362 | |||
| 3eebd36a41 | |||
| 412417411b | |||
| a1c9dd99cf | |||
| 3ed873b6e9 | |||
| a172e606b4 | 
| @ -9,7 +9,7 @@ Draw a line segment relative to the current origin using the polar | ||||
| measure of some angle and distance. | ||||
|  | ||||
| ```js | ||||
| angledLine(data: AngledLineData, sketch: Sketch, tag?: TagDeclarator) -> Sketch | ||||
| angledLine(data: AngledLineData, sketch: Sketch, tag?: TagNode) -> Sketch | ||||
| ``` | ||||
|  | ||||
|  | ||||
| @ -19,7 +19,7 @@ angledLine(data: AngledLineData, sketch: Sketch, tag?: TagDeclarator) -> Sketch | ||||
| |----------|------|-------------|----------| | ||||
| | `data` | [`AngledLineData`](/docs/kcl/types/AngledLineData) | Data to draw an angled line. | Yes | | ||||
| | `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | A sketch is a collection of paths. | Yes | | ||||
| | `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) |  | No | | ||||
| | `tag` | [`TagNode`](/docs/kcl/types/TagNode) |  | No | | ||||
|  | ||||
| ### Returns | ||||
|  | ||||
|  | ||||
| @ -9,7 +9,7 @@ Create a line segment from the current 2-dimensional sketch origin | ||||
| along some angle (in degrees) for some relative length in the 'x' dimension. | ||||
|  | ||||
| ```js | ||||
| angledLineOfXLength(data: AngledLineData, sketch: Sketch, tag?: TagDeclarator) -> Sketch | ||||
| angledLineOfXLength(data: AngledLineData, sketch: Sketch, tag?: TagNode) -> Sketch | ||||
| ``` | ||||
|  | ||||
|  | ||||
| @ -19,7 +19,7 @@ angledLineOfXLength(data: AngledLineData, sketch: Sketch, tag?: TagDeclarator) - | ||||
| |----------|------|-------------|----------| | ||||
| | `data` | [`AngledLineData`](/docs/kcl/types/AngledLineData) | Data to draw an angled line. | Yes | | ||||
| | `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | A sketch is a collection of paths. | Yes | | ||||
| | `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) |  | No | | ||||
| | `tag` | [`TagNode`](/docs/kcl/types/TagNode) |  | No | | ||||
|  | ||||
| ### Returns | ||||
|  | ||||
|  | ||||
| @ -9,7 +9,7 @@ Create a line segment from the current 2-dimensional sketch origin | ||||
| along some angle (in degrees) for some relative length in the 'y' dimension. | ||||
|  | ||||
| ```js | ||||
| angledLineOfYLength(data: AngledLineData, sketch: Sketch, tag?: TagDeclarator) -> Sketch | ||||
| angledLineOfYLength(data: AngledLineData, sketch: Sketch, tag?: TagNode) -> Sketch | ||||
| ``` | ||||
|  | ||||
|  | ||||
| @ -19,7 +19,7 @@ angledLineOfYLength(data: AngledLineData, sketch: Sketch, tag?: TagDeclarator) - | ||||
| |----------|------|-------------|----------| | ||||
| | `data` | [`AngledLineData`](/docs/kcl/types/AngledLineData) | Data to draw an angled line. | Yes | | ||||
| | `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | A sketch is a collection of paths. | Yes | | ||||
| | `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) |  | No | | ||||
| | `tag` | [`TagNode`](/docs/kcl/types/TagNode) |  | No | | ||||
|  | ||||
| ### Returns | ||||
|  | ||||
|  | ||||
| @ -9,7 +9,7 @@ Draw an angled line from the current origin, constructing a line segment | ||||
| such that the newly created line intersects the desired target line segment. | ||||
|  | ||||
| ```js | ||||
| angledLineThatIntersects(data: AngledLineThatIntersectsData, sketch: Sketch, tag?: TagDeclarator) -> Sketch | ||||
| angledLineThatIntersects(data: AngledLineThatIntersectsData, sketch: Sketch, tag?: TagNode) -> Sketch | ||||
| ``` | ||||
|  | ||||
|  | ||||
| @ -19,7 +19,7 @@ angledLineThatIntersects(data: AngledLineThatIntersectsData, sketch: Sketch, tag | ||||
| |----------|------|-------------|----------| | ||||
| | `data` | [`AngledLineThatIntersectsData`](/docs/kcl/types/AngledLineThatIntersectsData) | Data for drawing an angled line that intersects with a given line. | Yes | | ||||
| | `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | A sketch is a collection of paths. | Yes | | ||||
| | `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) |  | No | | ||||
| | `tag` | [`TagNode`](/docs/kcl/types/TagNode) |  | No | | ||||
|  | ||||
| ### Returns | ||||
|  | ||||
|  | ||||
| @ -9,7 +9,7 @@ Create a line segment from the current 2-dimensional sketch origin | ||||
| along some angle (in degrees) for some length, ending at the provided value in the 'x' dimension. | ||||
|  | ||||
| ```js | ||||
| angledLineToX(data: AngledLineToData, sketch: Sketch, tag?: TagDeclarator) -> Sketch | ||||
| angledLineToX(data: AngledLineToData, sketch: Sketch, tag?: TagNode) -> Sketch | ||||
| ``` | ||||
|  | ||||
|  | ||||
| @ -19,7 +19,7 @@ angledLineToX(data: AngledLineToData, sketch: Sketch, tag?: TagDeclarator) -> Sk | ||||
| |----------|------|-------------|----------| | ||||
| | `data` | [`AngledLineToData`](/docs/kcl/types/AngledLineToData) | Data to draw an angled line to a point. | Yes | | ||||
| | `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | A sketch is a collection of paths. | Yes | | ||||
| | `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) |  | No | | ||||
| | `tag` | [`TagNode`](/docs/kcl/types/TagNode) |  | No | | ||||
|  | ||||
| ### Returns | ||||
|  | ||||
|  | ||||
| @ -9,7 +9,7 @@ Create a line segment from the current 2-dimensional sketch origin | ||||
| along some angle (in degrees) for some length, ending at the provided value in the 'y' dimension. | ||||
|  | ||||
| ```js | ||||
| angledLineToY(data: AngledLineToData, sketch: Sketch, tag?: TagDeclarator) -> Sketch | ||||
| angledLineToY(data: AngledLineToData, sketch: Sketch, tag?: TagNode) -> Sketch | ||||
| ``` | ||||
|  | ||||
|  | ||||
| @ -19,7 +19,7 @@ angledLineToY(data: AngledLineToData, sketch: Sketch, tag?: TagDeclarator) -> Sk | ||||
| |----------|------|-------------|----------| | ||||
| | `data` | [`AngledLineToData`](/docs/kcl/types/AngledLineToData) | Data to draw an angled line to a point. | Yes | | ||||
| | `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | A sketch is a collection of paths. | Yes | | ||||
| | `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) |  | No | | ||||
| | `tag` | [`TagNode`](/docs/kcl/types/TagNode) |  | No | | ||||
|  | ||||
| ### Returns | ||||
|  | ||||
|  | ||||
| @ -11,7 +11,7 @@ The arc is constructed such that the current position of the sketch is placed al | ||||
| Unless this makes a lot of sense and feels like what you're looking for to construct your shape, you're likely looking for tangentialArc. | ||||
|  | ||||
| ```js | ||||
| arc(data: ArcData, sketch: Sketch, tag?: TagDeclarator) -> Sketch | ||||
| arc(data: ArcData, sketch: Sketch, tag?: TagNode) -> Sketch | ||||
| ``` | ||||
|  | ||||
|  | ||||
| @ -21,7 +21,7 @@ arc(data: ArcData, sketch: Sketch, tag?: TagDeclarator) -> Sketch | ||||
| |----------|------|-------------|----------| | ||||
| | `data` | [`ArcData`](/docs/kcl/types/ArcData) | Data to draw an arc. | Yes | | ||||
| | `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | A sketch is a collection of paths. | Yes | | ||||
| | `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) |  | No | | ||||
| | `tag` | [`TagNode`](/docs/kcl/types/TagNode) |  | No | | ||||
|  | ||||
| ### Returns | ||||
|  | ||||
|  | ||||
| @ -9,7 +9,7 @@ Draw a smooth, continuous, curved line segment from the current origin to | ||||
| the desired (x, y), using a number of control points to shape the curve's shape. | ||||
|  | ||||
| ```js | ||||
| bezierCurve(data: BezierData, sketch: Sketch, tag?: TagDeclarator) -> Sketch | ||||
| bezierCurve(data: BezierData, sketch: Sketch, tag?: TagNode) -> Sketch | ||||
| ``` | ||||
|  | ||||
|  | ||||
| @ -19,7 +19,7 @@ bezierCurve(data: BezierData, sketch: Sketch, tag?: TagDeclarator) -> Sketch | ||||
| |----------|------|-------------|----------| | ||||
| | `data` | [`BezierData`](/docs/kcl/types/BezierData) | Data to draw a bezier curve. | Yes | | ||||
| | `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | A sketch is a collection of paths. | Yes | | ||||
| | `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) |  | No | | ||||
| | `tag` | [`TagNode`](/docs/kcl/types/TagNode) |  | No | | ||||
|  | ||||
| ### Returns | ||||
|  | ||||
|  | ||||
| @ -9,7 +9,7 @@ Cut a straight transitional edge along a tagged path. | ||||
| Chamfer is similar in function and use to a fillet, except a fillet will blend the transition along an edge, rather than cut a sharp, straight transitional edge. | ||||
|  | ||||
| ```js | ||||
| chamfer(data: ChamferData, solid: Solid, tag?: TagDeclarator) -> Solid | ||||
| chamfer(data: ChamferData, solid: Solid, tag?: TagNode) -> Solid | ||||
| ``` | ||||
|  | ||||
|  | ||||
| @ -19,7 +19,7 @@ chamfer(data: ChamferData, solid: Solid, tag?: TagDeclarator) -> Solid | ||||
| |----------|------|-------------|----------| | ||||
| | `data` | [`ChamferData`](/docs/kcl/types/ChamferData) | Data for chamfers. | Yes | | ||||
| | `solid` | [`Solid`](/docs/kcl/types/Solid) | An solid is a collection of extrude surfaces. | Yes | | ||||
| | `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) |  | No | | ||||
| | `tag` | [`TagNode`](/docs/kcl/types/TagNode) |  | No | | ||||
|  | ||||
| ### Returns | ||||
|  | ||||
|  | ||||
| @ -9,7 +9,7 @@ Construct a 2-dimensional circle, of the specified radius, centered at | ||||
| the provided (x, y) origin point. | ||||
|  | ||||
| ```js | ||||
| circle(data: CircleData, sketch_surface_or_group: SketchOrSurface, tag?: TagDeclarator) -> Sketch | ||||
| circle(data: CircleData, sketch_surface_or_group: SketchOrSurface, tag?: TagNode) -> Sketch | ||||
| ``` | ||||
|  | ||||
|  | ||||
| @ -19,7 +19,7 @@ circle(data: CircleData, sketch_surface_or_group: SketchOrSurface, tag?: TagDecl | ||||
| |----------|------|-------------|----------| | ||||
| | `data` | [`CircleData`](/docs/kcl/types/CircleData) | Data for drawing an circle | Yes | | ||||
| | `sketch_surface_or_group` | [`SketchOrSurface`](/docs/kcl/types/SketchOrSurface) | A sketch surface or a sketch. | Yes | | ||||
| | `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) |  | No | | ||||
| | `tag` | [`TagNode`](/docs/kcl/types/TagNode) |  | No | | ||||
|  | ||||
| ### Returns | ||||
|  | ||||
|  | ||||
| @ -9,7 +9,7 @@ Construct a line segment from the current origin back to the profile's | ||||
| origin, ensuring the resulting 2-dimensional sketch is not open-ended. | ||||
|  | ||||
| ```js | ||||
| close(sketch: Sketch, tag?: TagDeclarator) -> Sketch | ||||
| close(sketch: Sketch, tag?: TagNode) -> Sketch | ||||
| ``` | ||||
|  | ||||
|  | ||||
| @ -18,7 +18,7 @@ close(sketch: Sketch, tag?: TagDeclarator) -> Sketch | ||||
| | Name | Type | Description | Required | | ||||
| |----------|------|-------------|----------| | ||||
| | `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | A sketch is a collection of paths. | Yes | | ||||
| | `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) |  | No | | ||||
| | `tag` | [`TagNode`](/docs/kcl/types/TagNode) |  | No | | ||||
|  | ||||
| ### Returns | ||||
|  | ||||
|  | ||||
| @ -9,7 +9,7 @@ Blend a transitional edge along a tagged path, smoothing the sharp edge. | ||||
| Fillet is similar in function and use to a chamfer, except a chamfer will cut a sharp transition along an edge while fillet will smoothly blend the transition. | ||||
|  | ||||
| ```js | ||||
| fillet(data: FilletData, solid: Solid, tag?: TagDeclarator) -> Solid | ||||
| fillet(data: FilletData, solid: Solid, tag?: TagNode) -> Solid | ||||
| ``` | ||||
|  | ||||
|  | ||||
| @ -19,7 +19,7 @@ fillet(data: FilletData, solid: Solid, tag?: TagDeclarator) -> Solid | ||||
| |----------|------|-------------|----------| | ||||
| | `data` | [`FilletData`](/docs/kcl/types/FilletData) | Data for fillets. | Yes | | ||||
| | `solid` | [`Solid`](/docs/kcl/types/Solid) | An solid is a collection of extrude surfaces. | Yes | | ||||
| | `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) |  | No | | ||||
| | `tag` | [`TagNode`](/docs/kcl/types/TagNode) |  | No | | ||||
|  | ||||
| ### Returns | ||||
|  | ||||
|  | ||||
| @ -9,7 +9,7 @@ Draw a line relative to the current origin to a specified (x, y) away | ||||
| from the current position. | ||||
|  | ||||
| ```js | ||||
| line(delta: [number], sketch: Sketch, tag?: TagDeclarator) -> Sketch | ||||
| line(delta: [number], sketch: Sketch, tag?: TagNode) -> Sketch | ||||
| ``` | ||||
|  | ||||
|  | ||||
| @ -19,7 +19,7 @@ line(delta: [number], sketch: Sketch, tag?: TagDeclarator) -> Sketch | ||||
| |----------|------|-------------|----------| | ||||
| | `delta` | `[number]` |  | Yes | | ||||
| | `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | A sketch is a collection of paths. | Yes | | ||||
| | `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) |  | No | | ||||
| | `tag` | [`TagNode`](/docs/kcl/types/TagNode) |  | No | | ||||
|  | ||||
| ### Returns | ||||
|  | ||||
|  | ||||
| @ -9,7 +9,7 @@ Draw a line from the current origin to some absolute (x, y) point. | ||||
|  | ||||
|  | ||||
| ```js | ||||
| lineTo(to: [number], sketch: Sketch, tag?: TagDeclarator) -> Sketch | ||||
| lineTo(to: [number], sketch: Sketch, tag?: TagNode) -> Sketch | ||||
| ``` | ||||
|  | ||||
|  | ||||
| @ -19,7 +19,7 @@ lineTo(to: [number], sketch: Sketch, tag?: TagDeclarator) -> Sketch | ||||
| |----------|------|-------------|----------| | ||||
| | `to` | `[number]` |  | Yes | | ||||
| | `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | A sketch is a collection of paths. | Yes | | ||||
| | `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) |  | No | | ||||
| | `tag` | [`TagNode`](/docs/kcl/types/TagNode) |  | No | | ||||
|  | ||||
| ### Returns | ||||
|  | ||||
|  | ||||
| @ -9,7 +9,7 @@ Start a new profile at a given point. | ||||
|  | ||||
|  | ||||
| ```js | ||||
| startProfileAt(to: [number], sketch_surface: SketchSurface, tag?: TagDeclarator) -> Sketch | ||||
| startProfileAt(to: [number], sketch_surface: SketchSurface, tag?: TagNode) -> Sketch | ||||
| ``` | ||||
|  | ||||
|  | ||||
| @ -19,7 +19,7 @@ startProfileAt(to: [number], sketch_surface: SketchSurface, tag?: TagDeclarator) | ||||
| |----------|------|-------------|----------| | ||||
| | `to` | `[number]` |  | Yes | | ||||
| | `sketch_surface` | [`SketchSurface`](/docs/kcl/types/SketchSurface) | A sketch type. | Yes | | ||||
| | `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) |  | No | | ||||
| | `tag` | [`TagNode`](/docs/kcl/types/TagNode) |  | No | | ||||
|  | ||||
| ### Returns | ||||
|  | ||||
|  | ||||
							
								
								
									
										16275
									
								
								docs/kcl/std.json
									
									
									
									
									
								
							
							
						
						
									
										16275
									
								
								docs/kcl/std.json
									
									
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @ -9,7 +9,7 @@ Draw a curved line segment along part of an imaginary circle. | ||||
| The arc is constructed such that the last line segment is placed tangent to the imaginary circle of the specified radius. The resulting arc is the segment of the imaginary circle from that tangent point for 'offset' degrees along the imaginary circle. | ||||
|  | ||||
| ```js | ||||
| tangentialArc(data: TangentialArcData, sketch: Sketch, tag?: TagDeclarator) -> Sketch | ||||
| tangentialArc(data: TangentialArcData, sketch: Sketch, tag?: TagNode) -> Sketch | ||||
| ``` | ||||
|  | ||||
|  | ||||
| @ -19,7 +19,7 @@ tangentialArc(data: TangentialArcData, sketch: Sketch, tag?: TagDeclarator) -> S | ||||
| |----------|------|-------------|----------| | ||||
| | `data` | [`TangentialArcData`](/docs/kcl/types/TangentialArcData) | Data to draw a tangential arc. | Yes | | ||||
| | `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | A sketch is a collection of paths. | Yes | | ||||
| | `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) |  | No | | ||||
| | `tag` | [`TagNode`](/docs/kcl/types/TagNode) |  | No | | ||||
|  | ||||
| ### Returns | ||||
|  | ||||
|  | ||||
| @ -9,7 +9,7 @@ Starting at the current sketch's origin, draw a curved line segment along | ||||
| some part of an imaginary circle until it reaches the desired (x, y) coordinates. | ||||
|  | ||||
| ```js | ||||
| tangentialArcTo(to: [number], sketch: Sketch, tag?: TagDeclarator) -> Sketch | ||||
| tangentialArcTo(to: [number], sketch: Sketch, tag?: TagNode) -> Sketch | ||||
| ``` | ||||
|  | ||||
|  | ||||
| @ -19,7 +19,7 @@ tangentialArcTo(to: [number], sketch: Sketch, tag?: TagDeclarator) -> Sketch | ||||
| |----------|------|-------------|----------| | ||||
| | `to` | `[number]` |  | Yes | | ||||
| | `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | A sketch is a collection of paths. | Yes | | ||||
| | `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) |  | No | | ||||
| | `tag` | [`TagNode`](/docs/kcl/types/TagNode) |  | No | | ||||
|  | ||||
| ### Returns | ||||
|  | ||||
|  | ||||
| @ -9,7 +9,7 @@ Starting at the current sketch's origin, draw a curved line segment along | ||||
| some part of an imaginary circle until it reaches a point the given (x, y) distance away. | ||||
|  | ||||
| ```js | ||||
| tangentialArcToRelative(delta: [number], sketch: Sketch, tag?: TagDeclarator) -> Sketch | ||||
| tangentialArcToRelative(delta: [number], sketch: Sketch, tag?: TagNode) -> Sketch | ||||
| ``` | ||||
|  | ||||
|  | ||||
| @ -19,7 +19,7 @@ tangentialArcToRelative(delta: [number], sketch: Sketch, tag?: TagDeclarator) -> | ||||
| |----------|------|-------------|----------| | ||||
| | `delta` | `[number]` |  | Yes | | ||||
| | `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | A sketch is a collection of paths. | Yes | | ||||
| | `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) |  | No | | ||||
| | `tag` | [`TagNode`](/docs/kcl/types/TagNode) |  | No | | ||||
|  | ||||
| ### Returns | ||||
|  | ||||
|  | ||||
| @ -18,7 +18,7 @@ A base path. | ||||
| |----------|------|-------------|----------| | ||||
| | `from` |`[number, number]`| The from point. | No | | ||||
| | `to` |`[number, number]`| The to point. | No | | ||||
| | `tag` |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| The tag of the path. | No | | ||||
| | `tag` |[`TagNode`](/docs/kcl/types/TagNode)| The tag of the path. | No | | ||||
| | `__geoMeta` |[`GeoMeta`](/docs/kcl/types/GeoMeta)| Metadata. | No | | ||||
|  | ||||
|  | ||||
|  | ||||
| @ -22,12 +22,10 @@ layout: manual | ||||
|  | ||||
| | Property | Type | Description | Required | | ||||
| |----------|------|-------------|----------| | ||||
| | `type` |enum: `Literal`|  | No | | ||||
| | `type` |enum: [`Literal`](/docs/kcl/types/Literal)|  | No | | ||||
| | `kind` |[`Literal`](/docs/kcl/types/Literal)|  | No | | ||||
| | `start` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `end` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `value` |[`LiteralValue`](/docs/kcl/types/LiteralValue)|  | No | | ||||
| | `raw` |`string`|  | No | | ||||
| | `digest` |`[, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`]`|  | No | | ||||
|  | ||||
|  | ||||
| ---- | ||||
| @ -43,10 +41,9 @@ layout: manual | ||||
| | Property | Type | Description | Required | | ||||
| |----------|------|-------------|----------| | ||||
| | `type` |enum: [`Identifier`](/docs/kcl/types/Identifier)|  | No | | ||||
| | `kind` |[`Identifier`](/docs/kcl/types/Identifier)|  | No | | ||||
| | `start` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `end` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `name` |`string`|  | No | | ||||
| | `digest` |`[, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`]`|  | No | | ||||
|  | ||||
|  | ||||
| ---- | ||||
| @ -61,13 +58,10 @@ layout: manual | ||||
|  | ||||
| | Property | Type | Description | Required | | ||||
| |----------|------|-------------|----------| | ||||
| | `type` |enum: `BinaryExpression`|  | No | | ||||
| | `type` |enum: [`BinaryExpression`](/docs/kcl/types/BinaryExpression)|  | No | | ||||
| | `kind` |[`BinaryExpression`](/docs/kcl/types/BinaryExpression)|  | No | | ||||
| | `start` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `end` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `operator` |[`BinaryOperator`](/docs/kcl/types/BinaryOperator)|  | No | | ||||
| | `left` |[`BinaryPart`](/docs/kcl/types/BinaryPart)|  | No | | ||||
| | `right` |[`BinaryPart`](/docs/kcl/types/BinaryPart)|  | No | | ||||
| | `digest` |`[, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`]`|  | No | | ||||
|  | ||||
|  | ||||
| ---- | ||||
| @ -82,13 +76,10 @@ layout: manual | ||||
|  | ||||
| | Property | Type | Description | Required | | ||||
| |----------|------|-------------|----------| | ||||
| | `type` |enum: `CallExpression`|  | No | | ||||
| | `type` |enum: [`CallExpression`](/docs/kcl/types/CallExpression)|  | No | | ||||
| | `kind` |[`CallExpression`](/docs/kcl/types/CallExpression)|  | No | | ||||
| | `start` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `end` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `callee` |[`Identifier`](/docs/kcl/types/Identifier)|  | No | | ||||
| | `arguments` |`[` [`Expr`](/docs/kcl/types/Expr) `]`|  | No | | ||||
| | `optional` |`boolean`|  | No | | ||||
| | `digest` |`[, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`]`|  | No | | ||||
|  | ||||
|  | ||||
| ---- | ||||
| @ -103,12 +94,10 @@ layout: manual | ||||
|  | ||||
| | Property | Type | Description | Required | | ||||
| |----------|------|-------------|----------| | ||||
| | `type` |enum: `UnaryExpression`|  | No | | ||||
| | `type` |enum: [`UnaryExpression`](/docs/kcl/types/UnaryExpression)|  | No | | ||||
| | `kind` |[`UnaryExpression`](/docs/kcl/types/UnaryExpression)|  | No | | ||||
| | `start` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `end` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `operator` |[`UnaryOperator`](/docs/kcl/types/UnaryOperator)|  | No | | ||||
| | `argument` |[`BinaryPart`](/docs/kcl/types/BinaryPart)|  | No | | ||||
| | `digest` |`[, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`]`|  | No | | ||||
|  | ||||
|  | ||||
| ---- | ||||
| @ -123,13 +112,10 @@ layout: manual | ||||
|  | ||||
| | Property | Type | Description | Required | | ||||
| |----------|------|-------------|----------| | ||||
| | `type` |enum: `MemberExpression`|  | No | | ||||
| | `type` |enum: [`MemberExpression`](/docs/kcl/types/MemberExpression)|  | No | | ||||
| | `kind` |[`MemberExpression`](/docs/kcl/types/MemberExpression)|  | No | | ||||
| | `start` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `end` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `object` |[`MemberObject`](/docs/kcl/types/MemberObject)|  | No | | ||||
| | `property` |[`LiteralIdentifier`](/docs/kcl/types/LiteralIdentifier)|  | No | | ||||
| | `computed` |`boolean`|  | No | | ||||
| | `digest` |`[, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`]`|  | No | | ||||
|  | ||||
|  | ||||
| ---- | ||||
| @ -144,14 +130,10 @@ layout: manual | ||||
|  | ||||
| | Property | Type | Description | Required | | ||||
| |----------|------|-------------|----------| | ||||
| | `type` |enum: `IfExpression`|  | No | | ||||
| | `type` |enum: [`IfExpression`](/docs/kcl/types/IfExpression)|  | No | | ||||
| | `kind` |[`IfExpression`](/docs/kcl/types/IfExpression)|  | No | | ||||
| | `start` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `end` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `cond` |[`Expr`](/docs/kcl/types/Expr)|  | No | | ||||
| | `then_val` |[`Program`](/docs/kcl/types/Program)|  | No | | ||||
| | `else_ifs` |`[` [`ElseIf`](/docs/kcl/types/ElseIf) `]`|  | No | | ||||
| | `final_else` |[`Program`](/docs/kcl/types/Program)|  | No | | ||||
| | `digest` |`[, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`]`|  | No | | ||||
|  | ||||
|  | ||||
| ---- | ||||
|  | ||||
| @ -22,13 +22,10 @@ layout: manual | ||||
|  | ||||
| | Property | Type | Description | Required | | ||||
| |----------|------|-------------|----------| | ||||
| | `type` |enum: `ImportStatement`|  | No | | ||||
| | `type` |enum: [`ImportStatement`](/docs/kcl/types/ImportStatement)|  | No | | ||||
| | `kind` |[`ImportStatement`](/docs/kcl/types/ImportStatement)|  | No | | ||||
| | `start` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `end` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `items` |`[` [`ImportItem`](/docs/kcl/types/ImportItem) `]`|  | No | | ||||
| | `path` |`string`|  | No | | ||||
| | `raw_path` |`string`|  | No | | ||||
| | `digest` |`[, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`]`|  | No | | ||||
|  | ||||
|  | ||||
| ---- | ||||
| @ -43,11 +40,10 @@ layout: manual | ||||
|  | ||||
| | Property | Type | Description | Required | | ||||
| |----------|------|-------------|----------| | ||||
| | `type` |enum: `ExpressionStatement`|  | No | | ||||
| | `type` |enum: [`ExpressionStatement`](/docs/kcl/types/ExpressionStatement)|  | No | | ||||
| | `kind` |[`ExpressionStatement`](/docs/kcl/types/ExpressionStatement)|  | No | | ||||
| | `start` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `end` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `expression` |[`Expr`](/docs/kcl/types/Expr)|  | No | | ||||
| | `digest` |`[, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`]`|  | No | | ||||
|  | ||||
|  | ||||
| ---- | ||||
| @ -62,13 +58,10 @@ layout: manual | ||||
|  | ||||
| | Property | Type | Description | Required | | ||||
| |----------|------|-------------|----------| | ||||
| | `type` |enum: `VariableDeclaration`|  | No | | ||||
| | `type` |enum: [`VariableDeclaration`](/docs/kcl/types/VariableDeclaration)|  | No | | ||||
| | `kind` |[`VariableDeclaration`](/docs/kcl/types/VariableDeclaration)|  | No | | ||||
| | `start` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `end` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `declarations` |`[` [`VariableDeclarator`](/docs/kcl/types/VariableDeclarator) `]`|  | No | | ||||
| | `visibility` |[`ItemVisibility`](/docs/kcl/types/ItemVisibility)|  | No | | ||||
| | `kind` |[`VariableKind`](/docs/kcl/types/VariableKind)|  | No | | ||||
| | `digest` |`[, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`]`|  | No | | ||||
|  | ||||
|  | ||||
| ---- | ||||
| @ -83,11 +76,10 @@ layout: manual | ||||
|  | ||||
| | Property | Type | Description | Required | | ||||
| |----------|------|-------------|----------| | ||||
| | `type` |enum: `ReturnStatement`|  | No | | ||||
| | `type` |enum: [`ReturnStatement`](/docs/kcl/types/ReturnStatement)|  | No | | ||||
| | `kind` |[`ReturnStatement`](/docs/kcl/types/ReturnStatement)|  | No | | ||||
| | `start` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `end` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `argument` |[`Expr`](/docs/kcl/types/Expr)|  | No | | ||||
| | `digest` |`[, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`]`|  | No | | ||||
|  | ||||
|  | ||||
| ---- | ||||
|  | ||||
| @ -28,7 +28,7 @@ A fillet. | ||||
| | `id` |`string`| The id of the engine command that called this fillet. | No | | ||||
| | `radius` |`number`|  | No | | ||||
| | `edgeId` |`string`| The engine id of the edge to fillet. | No | | ||||
| | `tag` |[`TagDeclarator`](/docs/kcl/types#tag-declaration)|  | No | | ||||
| | `tag` |[`TagNode`](/docs/kcl/types/TagNode)|  | No | | ||||
|  | ||||
|  | ||||
| ---- | ||||
| @ -48,7 +48,7 @@ A chamfer. | ||||
| | `id` |`string`| The id of the engine command that called this chamfer. | No | | ||||
| | `length` |`number`|  | No | | ||||
| | `edgeId` |`string`| The engine id of the edge to chamfer. | No | | ||||
| | `tag` |[`TagDeclarator`](/docs/kcl/types#tag-declaration)|  | No | | ||||
| | `tag` |[`TagNode`](/docs/kcl/types/TagNode)|  | No | | ||||
|  | ||||
|  | ||||
| ---- | ||||
|  | ||||
| @ -15,10 +15,8 @@ layout: manual | ||||
|  | ||||
| | Property | Type | Description | Required | | ||||
| |----------|------|-------------|----------| | ||||
| | `start` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `end` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `cond` |[`Expr`](/docs/kcl/types/Expr)|  | No | | ||||
| | `then_val` |[`Program`](/docs/kcl/types/Program)|  | No | | ||||
| | `then_val` |[`UnboxedNode_for_Program`](/docs/kcl/types/UnboxedNode_for_Program)|  | No | | ||||
| | `digest` |`[, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`]`|  | No | | ||||
|  | ||||
|  | ||||
|  | ||||
| @ -23,12 +23,10 @@ An expression can be evaluated to yield a single KCL value. | ||||
|  | ||||
| | Property | Type | Description | Required | | ||||
| |----------|------|-------------|----------| | ||||
| | `type` |enum: `Literal`|  | No | | ||||
| | `type` |enum: [`Literal`](/docs/kcl/types/Literal)|  | No | | ||||
| | `kind` |[`Literal`](/docs/kcl/types/Literal)| An expression can be evaluated to yield a single KCL value. | No | | ||||
| | `start` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `end` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `value` |[`LiteralValue`](/docs/kcl/types/LiteralValue)| An expression can be evaluated to yield a single KCL value. | No | | ||||
| | `raw` |`string`|  | No | | ||||
| | `digest` |`[, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`]`|  | No | | ||||
|  | ||||
|  | ||||
| ---- | ||||
| @ -44,10 +42,9 @@ An expression can be evaluated to yield a single KCL value. | ||||
| | Property | Type | Description | Required | | ||||
| |----------|------|-------------|----------| | ||||
| | `type` |enum: [`Identifier`](/docs/kcl/types/Identifier)|  | No | | ||||
| | `kind` |[`Identifier`](/docs/kcl/types/Identifier)| An expression can be evaluated to yield a single KCL value. | No | | ||||
| | `start` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `end` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `name` |`string`|  | No | | ||||
| | `digest` |`[, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`]`|  | No | | ||||
|  | ||||
|  | ||||
| ---- | ||||
| @ -63,10 +60,9 @@ An expression can be evaluated to yield a single KCL value. | ||||
| | Property | Type | Description | Required | | ||||
| |----------|------|-------------|----------| | ||||
| | `type` |enum: [`TagDeclarator`](/docs/kcl/types#tag-declaration)|  | No | | ||||
| | `kind` |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| An expression can be evaluated to yield a single KCL value. | No | | ||||
| | `start` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `end` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `value` |`string`|  | No | | ||||
| | `digest` |`[, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`]`|  | No | | ||||
|  | ||||
|  | ||||
| ---- | ||||
| @ -81,13 +77,10 @@ An expression can be evaluated to yield a single KCL value. | ||||
|  | ||||
| | Property | Type | Description | Required | | ||||
| |----------|------|-------------|----------| | ||||
| | `type` |enum: `BinaryExpression`|  | No | | ||||
| | `type` |enum: [`BinaryExpression`](/docs/kcl/types/BinaryExpression)|  | No | | ||||
| | `kind` |[`BinaryExpression`](/docs/kcl/types/BinaryExpression)| An expression can be evaluated to yield a single KCL value. | No | | ||||
| | `start` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `end` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `operator` |[`BinaryOperator`](/docs/kcl/types/BinaryOperator)| An expression can be evaluated to yield a single KCL value. | No | | ||||
| | `left` |[`BinaryPart`](/docs/kcl/types/BinaryPart)| An expression can be evaluated to yield a single KCL value. | No | | ||||
| | `right` |[`BinaryPart`](/docs/kcl/types/BinaryPart)| An expression can be evaluated to yield a single KCL value. | No | | ||||
| | `digest` |`[, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`]`|  | No | | ||||
|  | ||||
|  | ||||
| ---- | ||||
| @ -103,11 +96,9 @@ An expression can be evaluated to yield a single KCL value. | ||||
| | Property | Type | Description | Required | | ||||
| |----------|------|-------------|----------| | ||||
| | `type` |enum: [`FunctionExpression`](/docs/kcl/types/FunctionExpression)|  | No | | ||||
| | `kind` |[`FunctionExpression`](/docs/kcl/types/FunctionExpression)| An expression can be evaluated to yield a single KCL value. | No | | ||||
| | `start` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `end` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `params` |`[` [`Parameter`](/docs/kcl/types/Parameter) `]`|  | No | | ||||
| | `body` |[`Program`](/docs/kcl/types/Program)| An expression can be evaluated to yield a single KCL value. | No | | ||||
| | `digest` |`[, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`]`|  | No | | ||||
|  | ||||
|  | ||||
| ---- | ||||
| @ -122,13 +113,10 @@ An expression can be evaluated to yield a single KCL value. | ||||
|  | ||||
| | Property | Type | Description | Required | | ||||
| |----------|------|-------------|----------| | ||||
| | `type` |enum: `CallExpression`|  | No | | ||||
| | `type` |enum: [`CallExpression`](/docs/kcl/types/CallExpression)|  | No | | ||||
| | `kind` |[`CallExpression`](/docs/kcl/types/CallExpression)| An expression can be evaluated to yield a single KCL value. | No | | ||||
| | `start` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `end` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `callee` |[`Identifier`](/docs/kcl/types/Identifier)| An expression can be evaluated to yield a single KCL value. | No | | ||||
| | `arguments` |`[` [`Expr`](/docs/kcl/types/Expr) `]`|  | No | | ||||
| | `optional` |`boolean`|  | No | | ||||
| | `digest` |`[, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`]`|  | No | | ||||
|  | ||||
|  | ||||
| ---- | ||||
| @ -143,12 +131,10 @@ An expression can be evaluated to yield a single KCL value. | ||||
|  | ||||
| | Property | Type | Description | Required | | ||||
| |----------|------|-------------|----------| | ||||
| | `type` |enum: `PipeExpression`|  | No | | ||||
| | `type` |enum: [`PipeExpression`](/docs/kcl/types/PipeExpression)|  | No | | ||||
| | `kind` |[`PipeExpression`](/docs/kcl/types/PipeExpression)| An expression can be evaluated to yield a single KCL value. | No | | ||||
| | `start` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `end` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `body` |`[` [`Expr`](/docs/kcl/types/Expr) `]`|  | No | | ||||
| | `nonCodeMeta` |[`NonCodeMeta`](/docs/kcl/types/NonCodeMeta)| An expression can be evaluated to yield a single KCL value. | No | | ||||
| | `digest` |`[, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`]`|  | No | | ||||
|  | ||||
|  | ||||
| ---- | ||||
| @ -163,10 +149,10 @@ An expression can be evaluated to yield a single KCL value. | ||||
|  | ||||
| | Property | Type | Description | Required | | ||||
| |----------|------|-------------|----------| | ||||
| | `type` |enum: `PipeSubstitution`|  | No | | ||||
| | `type` |enum: [`PipeSubstitution`](/docs/kcl/types/PipeSubstitution)|  | No | | ||||
| | `kind` |[`PipeSubstitution`](/docs/kcl/types/PipeSubstitution)| An expression can be evaluated to yield a single KCL value. | No | | ||||
| | `start` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `end` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `digest` |`[, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`]`|  | No | | ||||
|  | ||||
|  | ||||
| ---- | ||||
| @ -181,12 +167,10 @@ An expression can be evaluated to yield a single KCL value. | ||||
|  | ||||
| | Property | Type | Description | Required | | ||||
| |----------|------|-------------|----------| | ||||
| | `type` |enum: `ArrayExpression`|  | No | | ||||
| | `type` |enum: [`ArrayExpression`](/docs/kcl/types/ArrayExpression)|  | No | | ||||
| | `kind` |[`ArrayExpression`](/docs/kcl/types/ArrayExpression)| An expression can be evaluated to yield a single KCL value. | No | | ||||
| | `start` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `end` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `elements` |`[` [`Expr`](/docs/kcl/types/Expr) `]`|  | No | | ||||
| | `nonCodeMeta` |[`NonCodeMeta`](/docs/kcl/types/NonCodeMeta)| An expression can be evaluated to yield a single KCL value. | No | | ||||
| | `digest` |`[, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`]`|  | No | | ||||
|  | ||||
|  | ||||
| ---- | ||||
| @ -201,13 +185,10 @@ An expression can be evaluated to yield a single KCL value. | ||||
|  | ||||
| | Property | Type | Description | Required | | ||||
| |----------|------|-------------|----------| | ||||
| | `type` |enum: `ArrayRangeExpression`|  | No | | ||||
| | `type` |enum: [`ArrayRangeExpression`](/docs/kcl/types/ArrayRangeExpression)|  | No | | ||||
| | `kind` |[`ArrayRangeExpression`](/docs/kcl/types/ArrayRangeExpression)| An expression can be evaluated to yield a single KCL value. | No | | ||||
| | `start` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `end` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `startElement` |[`Expr`](/docs/kcl/types/Expr)| An expression can be evaluated to yield a single KCL value. | No | | ||||
| | `endElement` |[`Expr`](/docs/kcl/types/Expr)| An expression can be evaluated to yield a single KCL value. | No | | ||||
| | `endInclusive` |`boolean`| Is the `end_element` included in the range? | No | | ||||
| | `digest` |`[, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`]`|  | No | | ||||
|  | ||||
|  | ||||
| ---- | ||||
| @ -222,12 +203,10 @@ An expression can be evaluated to yield a single KCL value. | ||||
|  | ||||
| | Property | Type | Description | Required | | ||||
| |----------|------|-------------|----------| | ||||
| | `type` |enum: `ObjectExpression`|  | No | | ||||
| | `type` |enum: [`ObjectExpression`](/docs/kcl/types/ObjectExpression)|  | No | | ||||
| | `kind` |[`ObjectExpression`](/docs/kcl/types/ObjectExpression)| An expression can be evaluated to yield a single KCL value. | No | | ||||
| | `start` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `end` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `properties` |`[` [`ObjectProperty`](/docs/kcl/types/ObjectProperty) `]`|  | No | | ||||
| | `nonCodeMeta` |[`NonCodeMeta`](/docs/kcl/types/NonCodeMeta)| An expression can be evaluated to yield a single KCL value. | No | | ||||
| | `digest` |`[, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`]`|  | No | | ||||
|  | ||||
|  | ||||
| ---- | ||||
| @ -242,13 +221,10 @@ An expression can be evaluated to yield a single KCL value. | ||||
|  | ||||
| | Property | Type | Description | Required | | ||||
| |----------|------|-------------|----------| | ||||
| | `type` |enum: `MemberExpression`|  | No | | ||||
| | `type` |enum: [`MemberExpression`](/docs/kcl/types/MemberExpression)|  | No | | ||||
| | `kind` |[`MemberExpression`](/docs/kcl/types/MemberExpression)| An expression can be evaluated to yield a single KCL value. | No | | ||||
| | `start` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `end` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `object` |[`MemberObject`](/docs/kcl/types/MemberObject)| An expression can be evaluated to yield a single KCL value. | No | | ||||
| | `property` |[`LiteralIdentifier`](/docs/kcl/types/LiteralIdentifier)| An expression can be evaluated to yield a single KCL value. | No | | ||||
| | `computed` |`boolean`|  | No | | ||||
| | `digest` |`[, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`]`|  | No | | ||||
|  | ||||
|  | ||||
| ---- | ||||
| @ -263,12 +239,10 @@ An expression can be evaluated to yield a single KCL value. | ||||
|  | ||||
| | Property | Type | Description | Required | | ||||
| |----------|------|-------------|----------| | ||||
| | `type` |enum: `UnaryExpression`|  | No | | ||||
| | `type` |enum: [`UnaryExpression`](/docs/kcl/types/UnaryExpression)|  | No | | ||||
| | `kind` |[`UnaryExpression`](/docs/kcl/types/UnaryExpression)| An expression can be evaluated to yield a single KCL value. | No | | ||||
| | `start` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `end` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `operator` |[`UnaryOperator`](/docs/kcl/types/UnaryOperator)| An expression can be evaluated to yield a single KCL value. | No | | ||||
| | `argument` |[`BinaryPart`](/docs/kcl/types/BinaryPart)| An expression can be evaluated to yield a single KCL value. | No | | ||||
| | `digest` |`[, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`]`|  | No | | ||||
|  | ||||
|  | ||||
| ---- | ||||
| @ -283,14 +257,10 @@ An expression can be evaluated to yield a single KCL value. | ||||
|  | ||||
| | Property | Type | Description | Required | | ||||
| |----------|------|-------------|----------| | ||||
| | `type` |enum: `IfExpression`|  | No | | ||||
| | `type` |enum: [`IfExpression`](/docs/kcl/types/IfExpression)|  | No | | ||||
| | `kind` |[`IfExpression`](/docs/kcl/types/IfExpression)| An expression can be evaluated to yield a single KCL value. | No | | ||||
| | `start` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `end` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `cond` |[`Expr`](/docs/kcl/types/Expr)| An expression can be evaluated to yield a single KCL value. | No | | ||||
| | `then_val` |[`Program`](/docs/kcl/types/Program)| An expression can be evaluated to yield a single KCL value. | No | | ||||
| | `else_ifs` |`[` [`ElseIf`](/docs/kcl/types/ElseIf) `]`|  | No | | ||||
| | `final_else` |[`Program`](/docs/kcl/types/Program)| An expression can be evaluated to yield a single KCL value. | No | | ||||
| | `digest` |`[, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`]`|  | No | | ||||
|  | ||||
|  | ||||
| ---- | ||||
|  | ||||
| @ -26,7 +26,7 @@ An extrude plane. | ||||
| |----------|------|-------------|----------| | ||||
| | `type` |enum: `extrudePlane`|  | No | | ||||
| | `faceId` |`string`| The face id for the extrude plane. | No | | ||||
| | `tag` |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| The tag. | No | | ||||
| | `tag` |[`TagNode`](/docs/kcl/types/TagNode)| The tag. | No | | ||||
| | `id` |`string`| The id of the geometry. | No | | ||||
| | `sourceRange` |`SourceRange`| The source range. | No | | ||||
|  | ||||
| @ -46,7 +46,7 @@ An extruded arc. | ||||
| |----------|------|-------------|----------| | ||||
| | `type` |enum: `extrudeArc`|  | No | | ||||
| | `faceId` |`string`| The face id for the extrude plane. | No | | ||||
| | `tag` |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| The tag. | No | | ||||
| | `tag` |[`TagNode`](/docs/kcl/types/TagNode)| The tag. | No | | ||||
| | `id` |`string`| The id of the geometry. | No | | ||||
| | `sourceRange` |`SourceRange`| The source range. | No | | ||||
|  | ||||
| @ -66,7 +66,7 @@ Geometry metadata. | ||||
| |----------|------|-------------|----------| | ||||
| | `type` |enum: `chamfer`|  | No | | ||||
| | `faceId` |`string`| The id for the chamfer surface. | No | | ||||
| | `tag` |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| The tag. | No | | ||||
| | `tag` |[`TagNode`](/docs/kcl/types/TagNode)| The tag. | No | | ||||
| | `id` |`string`| The id of the geometry. | No | | ||||
| | `sourceRange` |`SourceRange`| The source range. | No | | ||||
|  | ||||
| @ -86,7 +86,7 @@ Geometry metadata. | ||||
| |----------|------|-------------|----------| | ||||
| | `type` |enum: `fillet`|  | No | | ||||
| | `faceId` |`string`| The id for the fillet surface. | No | | ||||
| | `tag` |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| The tag. | No | | ||||
| | `tag` |[`TagNode`](/docs/kcl/types/TagNode)| The tag. | No | | ||||
| | `id` |`string`| The id of the geometry. | No | | ||||
| | `sourceRange` |`SourceRange`| The source range. | No | | ||||
|  | ||||
|  | ||||
| @ -15,10 +15,8 @@ layout: manual | ||||
|  | ||||
| | Property | Type | Description | Required | | ||||
| |----------|------|-------------|----------| | ||||
| | `start` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `end` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `params` |`[` [`Parameter`](/docs/kcl/types/Parameter) `]`|  | No | | ||||
| | `body` |[`Program`](/docs/kcl/types/Program)|  | No | | ||||
| | `body` |[`UnboxedNode_for_Program`](/docs/kcl/types/UnboxedNode_for_Program)|  | No | | ||||
| | `digest` |`[, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`]`|  | No | | ||||
|  | ||||
|  | ||||
|  | ||||
| @ -15,8 +15,6 @@ layout: manual | ||||
|  | ||||
| | Property | Type | Description | Required | | ||||
| |----------|------|-------------|----------| | ||||
| | `start` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `end` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `name` |`string`|  | No | | ||||
| | `digest` |`[, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`]`|  | No | | ||||
|  | ||||
|  | ||||
| @ -15,10 +15,8 @@ layout: manual | ||||
|  | ||||
| | Property | Type | Description | Required | | ||||
| |----------|------|-------------|----------| | ||||
| | `name` |[`Identifier`](/docs/kcl/types/Identifier)| Name of the item to import. | No | | ||||
| | `alias` |[`Identifier`](/docs/kcl/types/Identifier)| Rename the item using an identifier after "as". | No | | ||||
| | `start` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `end` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `name` |[`UnboxedNode_for_Identifier`](/docs/kcl/types/UnboxedNode_for_Identifier)| Name of the item to import. | No | | ||||
| | `alias` |[`UnboxedNode_for_Identifier`](/docs/kcl/types/UnboxedNode_for_Identifier)| Rename the item using an identifier after "as". | No | | ||||
| | `digest` |`[, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`]`|  | No | | ||||
|  | ||||
|  | ||||
|  | ||||
| @ -59,10 +59,9 @@ Any KCL value. | ||||
| | Property | Type | Description | Required | | ||||
| |----------|------|-------------|----------| | ||||
| | `type` |enum: [`TagDeclarator`](/docs/kcl/types#tag-declaration)|  | No | | ||||
| | `kind` |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| Any KCL value. | No | | ||||
| | `start` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `end` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `value` |`string`|  | No | | ||||
| | `digest` |`[, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`]`|  | No | | ||||
|  | ||||
|  | ||||
| ---- | ||||
| @ -183,7 +182,7 @@ Data for an imported geometry. | ||||
| | Property | Type | Description | Required | | ||||
| |----------|------|-------------|----------| | ||||
| | `type` |enum: `Function`|  | No | | ||||
| | `expression` |[`FunctionExpression`](/docs/kcl/types/FunctionExpression)| Any KCL value. | No | | ||||
| | `expression` |[`UnboxedNode_for_FunctionExpression`](/docs/kcl/types/UnboxedNode_for_FunctionExpression)| Any KCL value. | No | | ||||
| | `memory` |[`ProgramMemory`](/docs/kcl/types/ProgramMemory)| Any KCL value. | No | | ||||
| | `__meta` |`[` [`Metadata`](/docs/kcl/types/Metadata) `]`|  | No | | ||||
|  | ||||
|  | ||||
| @ -23,10 +23,9 @@ layout: manual | ||||
| | Property | Type | Description | Required | | ||||
| |----------|------|-------------|----------| | ||||
| | `type` |enum: [`Identifier`](/docs/kcl/types/Identifier)|  | No | | ||||
| | `kind` |[`Identifier`](/docs/kcl/types/Identifier)|  | No | | ||||
| | `start` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `end` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `name` |`string`|  | No | | ||||
| | `digest` |`[, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`]`|  | No | | ||||
|  | ||||
|  | ||||
| ---- | ||||
| @ -41,12 +40,10 @@ layout: manual | ||||
|  | ||||
| | Property | Type | Description | Required | | ||||
| |----------|------|-------------|----------| | ||||
| | `type` |enum: `Literal`|  | No | | ||||
| | `type` |enum: [`Literal`](/docs/kcl/types/Literal)|  | No | | ||||
| | `kind` |[`Literal`](/docs/kcl/types/Literal)|  | No | | ||||
| | `start` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `end` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `value` |[`LiteralValue`](/docs/kcl/types/LiteralValue)|  | No | | ||||
| | `raw` |`string`|  | No | | ||||
| | `digest` |`[, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`]`|  | No | | ||||
|  | ||||
|  | ||||
| ---- | ||||
|  | ||||
| @ -22,13 +22,10 @@ layout: manual | ||||
|  | ||||
| | Property | Type | Description | Required | | ||||
| |----------|------|-------------|----------| | ||||
| | `type` |enum: `MemberExpression`|  | No | | ||||
| | `type` |enum: [`MemberExpression`](/docs/kcl/types/MemberExpression)|  | No | | ||||
| | `kind` |[`MemberExpression`](/docs/kcl/types/MemberExpression)|  | No | | ||||
| | `start` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `end` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `object` |[`MemberObject`](/docs/kcl/types/MemberObject)|  | No | | ||||
| | `property` |[`LiteralIdentifier`](/docs/kcl/types/LiteralIdentifier)|  | No | | ||||
| | `computed` |`boolean`|  | No | | ||||
| | `digest` |`[, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`]`|  | No | | ||||
|  | ||||
|  | ||||
| ---- | ||||
| @ -44,10 +41,9 @@ layout: manual | ||||
| | Property | Type | Description | Required | | ||||
| |----------|------|-------------|----------| | ||||
| | `type` |enum: [`Identifier`](/docs/kcl/types/Identifier)|  | No | | ||||
| | `kind` |[`Identifier`](/docs/kcl/types/Identifier)|  | No | | ||||
| | `start` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `end` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `name` |`string`|  | No | | ||||
| | `digest` |`[, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`]`|  | No | | ||||
|  | ||||
|  | ||||
| ---- | ||||
|  | ||||
| @ -16,7 +16,7 @@ layout: manual | ||||
| | Property | Type | Description | Required | | ||||
| |----------|------|-------------|----------| | ||||
| | `nonCodeNodes` |`object`|  | No | | ||||
| | `start` |`[` [`NonCodeNode`](/docs/kcl/types/NonCodeNode) `]`|  | No | | ||||
| | `start` |`[` [`UnboxedNode_for_NonCodeNode`](/docs/kcl/types/UnboxedNode_for_NonCodeNode) `]`|  | No | | ||||
| | `digest` |`[, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`]`|  | No | | ||||
|  | ||||
|  | ||||
|  | ||||
| @ -15,8 +15,6 @@ layout: manual | ||||
|  | ||||
| | Property | Type | Description | Required | | ||||
| |----------|------|-------------|----------| | ||||
| | `start` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `end` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `value` |[`NonCodeValue`](/docs/kcl/types/NonCodeValue)|  | No | | ||||
| | `digest` |`[, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`]`|  | No | | ||||
|  | ||||
|  | ||||
| @ -15,9 +15,7 @@ layout: manual | ||||
|  | ||||
| | Property | Type | Description | Required | | ||||
| |----------|------|-------------|----------| | ||||
| | `start` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `end` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `key` |[`Identifier`](/docs/kcl/types/Identifier)|  | No | | ||||
| | `key` |[`UnboxedNode_for_Identifier`](/docs/kcl/types/UnboxedNode_for_Identifier)|  | No | | ||||
| | `value` |[`Expr`](/docs/kcl/types/Expr)|  | No | | ||||
| | `digest` |`[, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`]`|  | No | | ||||
|  | ||||
|  | ||||
| @ -16,7 +16,7 @@ Parameter of a KCL function. | ||||
|  | ||||
| | Property | Type | Description | Required | | ||||
| |----------|------|-------------|----------| | ||||
| | `identifier` |[`Identifier`](/docs/kcl/types/Identifier)| The parameter's label or name. | No | | ||||
| | `identifier` |[`UnboxedNode_for_Identifier`](/docs/kcl/types/UnboxedNode_for_Identifier)| The parameter's label or name. | No | | ||||
| | `optional` |`boolean`| Is the parameter optional? | No | | ||||
| | `digest` |`[, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`]`|  | No | | ||||
|  | ||||
|  | ||||
| @ -27,7 +27,7 @@ A path that goes to a point. | ||||
| | `type` |enum: `ToPoint`|  | No | | ||||
| | `from` |`[number, number]`| The from point. | No | | ||||
| | `to` |`[number, number]`| The to point. | No | | ||||
| | `tag` |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| The tag of the path. | No | | ||||
| | `tag` |[`TagNode`](/docs/kcl/types/TagNode)| The tag of the path. | No | | ||||
| | `__geoMeta` |[`GeoMeta`](/docs/kcl/types/GeoMeta)| Metadata. | No | | ||||
|  | ||||
|  | ||||
| @ -49,7 +49,7 @@ A arc that is tangential to the last path segment that goes to a point | ||||
| | `ccw` |`boolean`| arc's direction | No | | ||||
| | `from` |`[number, number]`| The from point. | No | | ||||
| | `to` |`[number, number]`| The to point. | No | | ||||
| | `tag` |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| The tag of the path. | No | | ||||
| | `tag` |[`TagNode`](/docs/kcl/types/TagNode)| The tag of the path. | No | | ||||
| | `__geoMeta` |[`GeoMeta`](/docs/kcl/types/GeoMeta)| Metadata. | No | | ||||
|  | ||||
|  | ||||
| @ -71,7 +71,7 @@ A arc that is tangential to the last path segment | ||||
| | `ccw` |`boolean`| arc's direction | No | | ||||
| | `from` |`[number, number]`| The from point. | No | | ||||
| | `to` |`[number, number]`| The to point. | No | | ||||
| | `tag` |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| The tag of the path. | No | | ||||
| | `tag` |[`TagNode`](/docs/kcl/types/TagNode)| The tag of the path. | No | | ||||
| | `__geoMeta` |[`GeoMeta`](/docs/kcl/types/GeoMeta)| Metadata. | No | | ||||
|  | ||||
|  | ||||
| @ -94,7 +94,7 @@ a complete arc | ||||
| | `ccw` |`boolean`| arc's direction | No | | ||||
| | `from` |`[number, number]`| The from point. | No | | ||||
| | `to` |`[number, number]`| The to point. | No | | ||||
| | `tag` |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| The tag of the path. | No | | ||||
| | `tag` |[`TagNode`](/docs/kcl/types/TagNode)| The tag of the path. | No | | ||||
| | `__geoMeta` |[`GeoMeta`](/docs/kcl/types/GeoMeta)| Metadata. | No | | ||||
|  | ||||
|  | ||||
| @ -115,7 +115,7 @@ A path that is horizontal. | ||||
| | `x` |`number`| The x coordinate. | No | | ||||
| | `from` |`[number, number]`| The from point. | No | | ||||
| | `to` |`[number, number]`| The to point. | No | | ||||
| | `tag` |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| The tag of the path. | No | | ||||
| | `tag` |[`TagNode`](/docs/kcl/types/TagNode)| The tag of the path. | No | | ||||
| | `__geoMeta` |[`GeoMeta`](/docs/kcl/types/GeoMeta)| Metadata. | No | | ||||
|  | ||||
|  | ||||
| @ -137,7 +137,7 @@ An angled line to. | ||||
| | `y` |`number`| The y coordinate. | No | | ||||
| | `from` |`[number, number]`| The from point. | No | | ||||
| | `to` |`[number, number]`| The to point. | No | | ||||
| | `tag` |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| The tag of the path. | No | | ||||
| | `tag` |[`TagNode`](/docs/kcl/types/TagNode)| The tag of the path. | No | | ||||
| | `__geoMeta` |[`GeoMeta`](/docs/kcl/types/GeoMeta)| Metadata. | No | | ||||
|  | ||||
|  | ||||
| @ -157,7 +157,7 @@ A base path. | ||||
| | `type` |enum: `Base`|  | No | | ||||
| | `from` |`[number, number]`| The from point. | No | | ||||
| | `to` |`[number, number]`| The to point. | No | | ||||
| | `tag` |[`TagDeclarator`](/docs/kcl/types#tag-declaration)| The tag of the path. | No | | ||||
| | `tag` |[`TagNode`](/docs/kcl/types/TagNode)| The tag of the path. | No | | ||||
| | `__geoMeta` |[`GeoMeta`](/docs/kcl/types/GeoMeta)| Metadata. | No | | ||||
|  | ||||
|  | ||||
|  | ||||
| @ -16,10 +16,8 @@ A KCL program top level, or function body. | ||||
|  | ||||
| | Property | Type | Description | Required | | ||||
| |----------|------|-------------|----------| | ||||
| | `start` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `end` |[`EnvironmentRef`](/docs/kcl/types/EnvironmentRef)|  | No | | ||||
| | `body` |`[` [`BodyItem`](/docs/kcl/types/BodyItem) `]`|  | No | | ||||
| | `nonCodeMeta` |[`NonCodeMeta`](/docs/kcl/types/NonCodeMeta)| A KCL program top level, or function body. | No | | ||||
| | `nonCodeMeta` |[`UnboxedNode_for_NonCodeMeta`](/docs/kcl/types/UnboxedNode_for_NonCodeMeta)| A KCL program top level, or function body. | No | | ||||
| | `digest` |`[, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`, `integer`]`|  | No | | ||||
|  | ||||
|  | ||||
|  | ||||
| @ -9,7 +9,7 @@ Draw a line relative to the current origin to a specified distance away | ||||
| from the current position along the 'x' axis. | ||||
|  | ||||
| ```js | ||||
| xLine(length: number, sketch: Sketch, tag?: TagDeclarator) -> Sketch | ||||
| xLine(length: number, sketch: Sketch, tag?: TagNode) -> Sketch | ||||
| ``` | ||||
|  | ||||
|  | ||||
| @ -19,7 +19,7 @@ xLine(length: number, sketch: Sketch, tag?: TagDeclarator) -> Sketch | ||||
| |----------|------|-------------|----------| | ||||
| | `length` | `number` |  | Yes | | ||||
| | `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | A sketch is a collection of paths. | Yes | | ||||
| | `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) |  | No | | ||||
| | `tag` | [`TagNode`](/docs/kcl/types/TagNode) |  | No | | ||||
|  | ||||
| ### Returns | ||||
|  | ||||
|  | ||||
| @ -9,7 +9,7 @@ Draw a line parallel to the X axis, that ends at the given X. | ||||
| E.g. if the previous line ended at (1, 1), then xLineTo(4) draws a line from (1, 1) to (4, 1) | ||||
|  | ||||
| ```js | ||||
| xLineTo(to: number, sketch: Sketch, tag?: TagDeclarator) -> Sketch | ||||
| xLineTo(to: number, sketch: Sketch, tag?: TagNode) -> Sketch | ||||
| ``` | ||||
|  | ||||
|  | ||||
| @ -19,7 +19,7 @@ xLineTo(to: number, sketch: Sketch, tag?: TagDeclarator) -> Sketch | ||||
| |----------|------|-------------|----------| | ||||
| | `to` | `number` |  | Yes | | ||||
| | `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | A sketch is a collection of paths. | Yes | | ||||
| | `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) |  | No | | ||||
| | `tag` | [`TagNode`](/docs/kcl/types/TagNode) |  | No | | ||||
|  | ||||
| ### Returns | ||||
|  | ||||
|  | ||||
| @ -9,7 +9,7 @@ Draw a line relative to the current origin to a specified distance away | ||||
| from the current position along the 'y' axis. | ||||
|  | ||||
| ```js | ||||
| yLine(length: number, sketch: Sketch, tag?: TagDeclarator) -> Sketch | ||||
| yLine(length: number, sketch: Sketch, tag?: TagNode) -> Sketch | ||||
| ``` | ||||
|  | ||||
|  | ||||
| @ -19,7 +19,7 @@ yLine(length: number, sketch: Sketch, tag?: TagDeclarator) -> Sketch | ||||
| |----------|------|-------------|----------| | ||||
| | `length` | `number` |  | Yes | | ||||
| | `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | A sketch is a collection of paths. | Yes | | ||||
| | `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) |  | No | | ||||
| | `tag` | [`TagNode`](/docs/kcl/types/TagNode) |  | No | | ||||
|  | ||||
| ### Returns | ||||
|  | ||||
|  | ||||
| @ -9,7 +9,7 @@ Draw a line parallel to the Y axis, that ends at the given Y. | ||||
| E.g. if the previous line ended at (1, 1), then yLineTo(4) draws a line from (1, 1) to (1, 4) | ||||
|  | ||||
| ```js | ||||
| yLineTo(to: number, sketch: Sketch, tag?: TagDeclarator) -> Sketch | ||||
| yLineTo(to: number, sketch: Sketch, tag?: TagNode) -> Sketch | ||||
| ``` | ||||
|  | ||||
|  | ||||
| @ -19,7 +19,7 @@ yLineTo(to: number, sketch: Sketch, tag?: TagDeclarator) -> Sketch | ||||
| |----------|------|-------------|----------| | ||||
| | `to` | `number` |  | Yes | | ||||
| | `sketch` | [`Sketch`](/docs/kcl/types/Sketch) | A sketch is a collection of paths. | Yes | | ||||
| | `tag` | [`TagDeclarator`](/docs/kcl/types#tag-declaration) |  | No | | ||||
| | `tag` | [`TagNode`](/docs/kcl/types/TagNode) |  | No | | ||||
|  | ||||
| ### Returns | ||||
|  | ||||
|  | ||||
| @ -44,6 +44,7 @@ import { | ||||
| import { ActionButton } from 'components/ActionButton' | ||||
| import { err, reportRejection, trap } from 'lib/trap' | ||||
| import { useCommandsContext } from 'hooks/useCommandsContext' | ||||
| import { UnboxedNode } from 'wasm-lib/kcl/bindings/UnboxedNode' | ||||
|  | ||||
| function useShouldHideScene(): { hideClient: boolean; hideServer: boolean } { | ||||
|   const [isCamMoving, setIsCamMoving] = useState(false) | ||||
| @ -201,7 +202,7 @@ const Overlay = ({ | ||||
|   let xAlignment = overlay.angle < 0 ? '0%' : '-100%' | ||||
|   let yAlignment = overlay.angle < -90 || overlay.angle >= 90 ? '0%' : '-100%' | ||||
|  | ||||
|   const _node1 = getNodeFromPath<CallExpression>( | ||||
|   const _node1 = getNodeFromPath<UnboxedNode<CallExpression>>( | ||||
|     kclManager.ast, | ||||
|     overlay.pathToNode, | ||||
|     'CallExpression' | ||||
| @ -381,7 +382,7 @@ export async function deleteSegment({ | ||||
|   pathToNode: PathToNode | ||||
|   sketchDetails: SketchDetails | null | ||||
| }) { | ||||
|   let modifiedAst: Program | Error = kclManager.ast | ||||
|   let modifiedAst: UnboxedNode<Program> | Error = kclManager.ast | ||||
|   const dependentRanges = findUsesOfTagInPipe(modifiedAst, pathToNode) | ||||
|  | ||||
|   const shouldContinueSegDelete = dependentRanges.length | ||||
|  | ||||
| @ -92,6 +92,7 @@ import { err, reportRejection, trap } from 'lib/trap' | ||||
| import { CSS2DObject } from 'three/examples/jsm/renderers/CSS2DRenderer' | ||||
| import { Point3d } from 'wasm-lib/kcl/bindings/Point3d' | ||||
| import { SegmentInputs } from 'lang/std/stdTypes' | ||||
| import { UnboxedNode } from 'wasm-lib/kcl/bindings/UnboxedNode' | ||||
|  | ||||
| type DraftSegment = 'line' | 'tangentialArcTo' | ||||
|  | ||||
| @ -369,14 +370,14 @@ export class SceneEntities { | ||||
|     selectionRanges, | ||||
|   }: { | ||||
|     sketchPathToNode: PathToNode | ||||
|     maybeModdedAst: Program | ||||
|     maybeModdedAst: UnboxedNode<Program> | ||||
|     draftExpressionsIndices?: { start: number; end: number } | ||||
|     forward: [number, number, number] | ||||
|     up: [number, number, number] | ||||
|     position?: [number, number, number] | ||||
|     selectionRanges?: Selections | ||||
|   }): Promise<{ | ||||
|     truncatedAst: Program | ||||
|     truncatedAst: UnboxedNode<Program> | ||||
|     programMemoryOverride: ProgramMemory | ||||
|     sketch: Sketch | ||||
|     variableDeclarationName: string | ||||
| @ -561,7 +562,7 @@ export class SceneEntities { | ||||
|   } | ||||
|   updateAstAndRejigSketch = async ( | ||||
|     sketchPathToNode: PathToNode, | ||||
|     modifiedAst: Program | Error, | ||||
|     modifiedAst: UnboxedNode<Program> | Error, | ||||
|     forward: [number, number, number], | ||||
|     up: [number, number, number], | ||||
|     origin: [number, number, number] | ||||
| @ -1177,7 +1178,7 @@ export class SceneEntities { | ||||
|   } | ||||
|   prepareTruncatedMemoryAndAst = ( | ||||
|     sketchPathToNode: PathToNode, | ||||
|     ast?: Program, | ||||
|     ast?: UnboxedNode<Program>, | ||||
|     draftSegment?: DraftSegment | ||||
|   ) => | ||||
|     prepareTruncatedMemoryAndAst( | ||||
| @ -1198,7 +1199,7 @@ export class SceneEntities { | ||||
|     sketchPathToNode: PathToNode | ||||
|     intersects: Intersection<Object3D<Object3DEventMap>>[] | ||||
|     draftInfo?: { | ||||
|       truncatedAst: Program | ||||
|       truncatedAst: UnboxedNode<Program> | ||||
|       programMemoryOverride: ProgramMemory | ||||
|       variableDeclarationName: string | ||||
|     } | ||||
| @ -1234,7 +1235,7 @@ export class SceneEntities { | ||||
|     const dragTo: [number, number] = [intersection2d.x, intersection2d.y] | ||||
|     let modifiedAst = draftInfo ? draftInfo.truncatedAst : { ...kclManager.ast } | ||||
|  | ||||
|     const _node = getNodeFromPath<CallExpression>( | ||||
|     const _node = getNodeFromPath<UnboxedNode<CallExpression>>( | ||||
|       modifiedAst, | ||||
|       pathToNode, | ||||
|       'CallExpression' | ||||
| @ -1246,7 +1247,7 @@ export class SceneEntities { | ||||
|  | ||||
|     let modded: | ||||
|       | { | ||||
|           modifiedAst: Program | ||||
|           modifiedAst: UnboxedNode<Program> | ||||
|           pathToNode: PathToNode | ||||
|         } | ||||
|       | Error | ||||
| @ -1541,7 +1542,7 @@ export class SceneEntities { | ||||
|         if (parent?.userData?.pathToNode) { | ||||
|           const updatedAst = parse(recast(kclManager.ast)) | ||||
|           if (trap(updatedAst)) return | ||||
|           const _node = getNodeFromPath<CallExpression>( | ||||
|           const _node = getNodeFromPath<UnboxedNode<CallExpression>>( | ||||
|             updatedAst, | ||||
|             parent.userData.pathToNode, | ||||
|             'CallExpression' | ||||
| @ -1676,12 +1677,12 @@ export type DefaultPlaneStr = 'XY' | 'XZ' | 'YZ' | '-XY' | '-XZ' | '-YZ' | ||||
|  | ||||
| function prepareTruncatedMemoryAndAst( | ||||
|   sketchPathToNode: PathToNode, | ||||
|   ast: Program, | ||||
|   ast: UnboxedNode<Program>, | ||||
|   programMemory: ProgramMemory, | ||||
|   draftSegment?: DraftSegment | ||||
| ): | ||||
|   | { | ||||
|       truncatedAst: Program | ||||
|       truncatedAst: UnboxedNode<Program> | ||||
|       programMemoryOverride: ProgramMemory | ||||
|       variableDeclarationName: string | ||||
|     } | ||||
| @ -1689,7 +1690,7 @@ function prepareTruncatedMemoryAndAst( | ||||
|   const bodyIndex = Number(sketchPathToNode?.[1]?.[0]) || 0 | ||||
|   const _ast = structuredClone(ast) | ||||
|  | ||||
|   const _node = getNodeFromPath<VariableDeclaration>( | ||||
|   const _node = getNodeFromPath<UnboxedNode<VariableDeclaration>>( | ||||
|     _ast, | ||||
|     sketchPathToNode || [], | ||||
|     'VariableDeclaration' | ||||
| @ -1739,15 +1740,15 @@ function prepareTruncatedMemoryAndAst( | ||||
|     ).body.slice(-1)[0].start = lastPipeItem.start | ||||
|  | ||||
|     _ast.end = lastPipeItem.end | ||||
|     const varDec = _ast.body[bodyIndex] as VariableDeclaration | ||||
|     const varDec = _ast.body[bodyIndex] as UnboxedNode<VariableDeclaration> | ||||
|     varDec.end = lastPipeItem.end | ||||
|     const declarator = varDec.declarations[0] | ||||
|     declarator.end = lastPipeItem.end | ||||
|     const init = declarator.init as PipeExpression | ||||
|     const init = declarator.init as UnboxedNode<PipeExpression> | ||||
|     init.end = lastPipeItem.end | ||||
|     init.body.slice(-1)[0].end = lastPipeItem.end | ||||
|   } | ||||
|   const truncatedAst: Program = { | ||||
|   const truncatedAst: UnboxedNode<Program> = { | ||||
|     ..._ast, | ||||
|     body: [structuredClone(_ast.body[bodyIndex])], | ||||
|   } | ||||
|  | ||||
| @ -84,6 +84,7 @@ import { | ||||
| import { submitAndAwaitTextToKcl } from 'lib/textToCad' | ||||
| import { useFileContext } from 'hooks/useFileContext' | ||||
| import { uuidv4 } from 'lib/utils' | ||||
| import { UnboxedNode } from 'wasm-lib/kcl/bindings/UnboxedNode' | ||||
|  | ||||
| type MachineContext<T extends AnyStateMachine> = { | ||||
|   state: StateFrom<T> | ||||
| @ -939,7 +940,7 @@ export const ModelingMachineProvider = ({ | ||||
|             }) | ||||
|             let parsed = parse(recast(kclManager.ast)) | ||||
|             if (trap(parsed)) return Promise.reject(parsed) | ||||
|             parsed = parsed as Program | ||||
|             parsed = parsed as UnboxedNode<Program> | ||||
|  | ||||
|             const { modifiedAst: _modifiedAst, pathToReplacedNode } = | ||||
|               moveValueIntoNewVariablePath( | ||||
| @ -950,7 +951,7 @@ export const ModelingMachineProvider = ({ | ||||
|               ) | ||||
|             parsed = parse(recast(_modifiedAst)) | ||||
|             if (trap(parsed)) return Promise.reject(parsed) | ||||
|             parsed = parsed as Program | ||||
|             parsed = parsed as UnboxedNode<Program> | ||||
|             if (!pathToReplacedNode) | ||||
|               return Promise.reject(new Error('No path to replaced node')) | ||||
|  | ||||
|  | ||||
| @ -14,6 +14,7 @@ import { | ||||
| import { TransformInfo } from 'lang/std/stdTypes' | ||||
| import { kclManager } from 'lib/singletons' | ||||
| import { err } from 'lib/trap' | ||||
| import { UnboxedNode } from 'wasm-lib/kcl/bindings/UnboxedNode' | ||||
|  | ||||
| export function setEqualLengthInfo({ | ||||
|   selectionRanges, | ||||
| @ -86,7 +87,7 @@ export function applyConstraintEqualLength({ | ||||
|   selectionRanges: Selections | ||||
| }): | ||||
|   | { | ||||
|       modifiedAst: Program | ||||
|       modifiedAst: UnboxedNode<Program> | ||||
|       pathToNodeMap: PathToNodeMap | ||||
|     } | ||||
|   | Error { | ||||
|  | ||||
| @ -13,6 +13,7 @@ import { | ||||
| import { TransformInfo } from 'lang/std/stdTypes' | ||||
| import { kclManager } from 'lib/singletons' | ||||
| import { err } from 'lib/trap' | ||||
| import { UnboxedNode } from 'wasm-lib/kcl/bindings/UnboxedNode' | ||||
|  | ||||
| export function horzVertInfo( | ||||
|   selectionRanges: Selections, | ||||
| @ -55,11 +56,11 @@ export function horzVertInfo( | ||||
| export function applyConstraintHorzVert( | ||||
|   selectionRanges: Selections, | ||||
|   horOrVert: 'vertical' | 'horizontal', | ||||
|   ast: Program, | ||||
|   ast: UnboxedNode<Program>, | ||||
|   programMemory: ProgramMemory | ||||
| ): | ||||
|   | { | ||||
|       modifiedAst: Program | ||||
|       modifiedAst: UnboxedNode<Program> | ||||
|       pathToNodeMap: PathToNodeMap | ||||
|     } | ||||
|   | Error { | ||||
|  | ||||
| @ -19,6 +19,7 @@ import { createVariableDeclaration } from '../../lang/modifyAst' | ||||
| import { removeDoubleNegatives } from '../AvailableVarsHelpers' | ||||
| import { kclManager } from 'lib/singletons' | ||||
| import { err } from 'lib/trap' | ||||
| import { UnboxedNode } from 'wasm-lib/kcl/bindings/UnboxedNode' | ||||
|  | ||||
| const getModalInfo = createInfoModal(GetInfoModal) | ||||
|  | ||||
| @ -136,7 +137,7 @@ export async function applyConstraintIntersect({ | ||||
| }: { | ||||
|   selectionRanges: Selections | ||||
| }): Promise<{ | ||||
|   modifiedAst: Program | ||||
|   modifiedAst: UnboxedNode<Program> | ||||
|   pathToNodeMap: PathToNodeMap | ||||
| }> { | ||||
|   const info = intersectInfo({ | ||||
|  | ||||
| @ -13,6 +13,7 @@ import { | ||||
| import { TransformInfo } from 'lang/std/stdTypes' | ||||
| import { kclManager } from 'lib/singletons' | ||||
| import { err } from 'lib/trap' | ||||
| import { UnboxedNode } from 'wasm-lib/kcl/bindings/UnboxedNode' | ||||
|  | ||||
| export function removeConstrainingValuesInfo({ | ||||
|   selectionRanges, | ||||
| @ -77,7 +78,7 @@ export function applyRemoveConstrainingValues({ | ||||
|   pathToNodes?: Array<PathToNode> | ||||
| }): | ||||
|   | { | ||||
|       modifiedAst: Program | ||||
|       modifiedAst: UnboxedNode<Program> | ||||
|       pathToNodeMap: PathToNodeMap | ||||
|     } | ||||
|   | Error { | ||||
|  | ||||
| @ -23,6 +23,7 @@ import { | ||||
| import { removeDoubleNegatives } from '../AvailableVarsHelpers' | ||||
| import { kclManager } from 'lib/singletons' | ||||
| import { err } from 'lib/trap' | ||||
| import { UnboxedNode } from 'wasm-lib/kcl/bindings/UnboxedNode' | ||||
|  | ||||
| const getModalInfo = createSetAngleLengthModal(SetAngleLengthModal) | ||||
|  | ||||
| @ -161,7 +162,7 @@ export function applyConstraintAxisAlign({ | ||||
|   constraint: 'snapToYAxis' | 'snapToXAxis' | ||||
| }): | ||||
|   | { | ||||
|       modifiedAst: Program | ||||
|       modifiedAst: UnboxedNode<Program> | ||||
|       pathToNodeMap: PathToNodeMap | ||||
|     } | ||||
|   | Error { | ||||
|  | ||||
| @ -18,6 +18,7 @@ import { removeDoubleNegatives } from '../AvailableVarsHelpers' | ||||
| import { kclManager } from 'lib/singletons' | ||||
| import { Selections } from 'lib/selections' | ||||
| import { cleanErrs, err } from 'lib/trap' | ||||
| import { UnboxedNode } from 'wasm-lib/kcl/bindings/UnboxedNode' | ||||
|  | ||||
| const getModalInfo = createInfoModal(GetInfoModal) | ||||
|  | ||||
| @ -185,7 +186,7 @@ export function applyConstraintHorzVertAlign({ | ||||
|   constraint: 'setHorzDistance' | 'setVertDistance' | ||||
| }): | ||||
|   | { | ||||
|       modifiedAst: Program | ||||
|       modifiedAst: UnboxedNode<Program> | ||||
|       pathToNodeMap: PathToNodeMap | ||||
|     } | ||||
|   | Error { | ||||
|  | ||||
| @ -21,9 +21,10 @@ import { | ||||
| import { getNodeFromPath } from './queryAst' | ||||
| import { codeManager, editorManager, sceneInfra } from 'lib/singletons' | ||||
| import { Diagnostic } from '@codemirror/lint' | ||||
| import { UnboxedNode } from 'wasm-lib/kcl/bindings/UnboxedNode' | ||||
|  | ||||
| interface ExecuteArgs { | ||||
|   ast?: Program | ||||
|   ast?: UnboxedNode<Program> | ||||
|   zoomToFit?: boolean | ||||
|   executionId?: number | ||||
|   zoomOnRangeAndType?: { | ||||
| @ -33,13 +34,13 @@ interface ExecuteArgs { | ||||
| } | ||||
|  | ||||
| export class KclManager { | ||||
|   private _ast: Program = { | ||||
|   private _ast: UnboxedNode<Program> = { | ||||
|     body: [], | ||||
|     start: 0, | ||||
|     end: 0, | ||||
|     nonCodeMeta: { | ||||
|       nonCodeNodes: {}, | ||||
|       start: [], | ||||
|       startNodes: [], | ||||
|     }, | ||||
|   } | ||||
|   private _execState: ExecState = emptyExecState() | ||||
| @ -55,7 +56,7 @@ export class KclManager { | ||||
|   engineCommandManager: EngineCommandManager | ||||
|  | ||||
|   private _isExecutingCallback: (arg: boolean) => void = () => {} | ||||
|   private _astCallBack: (arg: Program) => void = () => {} | ||||
|   private _astCallBack: (arg: UnboxedNode<Program>) => void = () => {} | ||||
|   private _programMemoryCallBack: (arg: ProgramMemory) => void = () => {} | ||||
|   private _logsCallBack: (arg: string[]) => void = () => {} | ||||
|   private _kclErrorsCallBack: (arg: KCLError[]) => void = () => {} | ||||
| @ -181,7 +182,7 @@ export class KclManager { | ||||
|     setWasmInitFailed, | ||||
|   }: { | ||||
|     setProgramMemory: (arg: ProgramMemory) => void | ||||
|     setAst: (arg: Program) => void | ||||
|     setAst: (arg: UnboxedNode<Program>) => void | ||||
|     setLogs: (arg: string[]) => void | ||||
|     setKclErrors: (arg: KCLError[]) => void | ||||
|     setIsExecuting: (arg: boolean) => void | ||||
| @ -205,12 +206,12 @@ export class KclManager { | ||||
|       end: 0, | ||||
|       nonCodeMeta: { | ||||
|         nonCodeNodes: {}, | ||||
|         start: [], | ||||
|         startNodes: [], | ||||
|       }, | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   safeParse(code: string): Program | null { | ||||
|   safeParse(code: string): UnboxedNode<Program> | null { | ||||
|     const ast = parse(code) | ||||
|     this.lints = [] | ||||
|     this.kclErrors = [] | ||||
| @ -377,7 +378,7 @@ export class KclManager { | ||||
|     Array.from(this.engineCommandManager.artifactGraph).forEach( | ||||
|       ([commandId, artifact]) => { | ||||
|         if (!('codeRef' in artifact)) return | ||||
|         const _node1 = getNodeFromPath<CallExpression>( | ||||
|         const _node1 = getNodeFromPath<UnboxedNode<CallExpression>>( | ||||
|           this.ast, | ||||
|           artifact.codeRef.pathToNode, | ||||
|           'CallExpression' | ||||
| @ -441,7 +442,7 @@ export class KclManager { | ||||
|   // but should probably have think about which of the function to keep | ||||
|   // This always updates the code state and editor and writes to the file system. | ||||
|   async updateAst( | ||||
|     ast: Program, | ||||
|     ast: UnboxedNode<Program>, | ||||
|     execute: boolean, | ||||
|     optionalParams?: { | ||||
|       focusPath?: Array<PathToNode> | ||||
| @ -452,7 +453,7 @@ export class KclManager { | ||||
|       } | ||||
|     } | ||||
|   ): Promise<{ | ||||
|     newAst: Program | ||||
|     newAst: UnboxedNode<Program> | ||||
|     selections?: Selections | ||||
|   }> { | ||||
|     const newCode = recast(ast) | ||||
| @ -588,7 +589,7 @@ export class KclManager { | ||||
|   } | ||||
|  | ||||
|   // Determines if there is no KCL code which means it is executing a blank KCL file | ||||
|   _isAstEmpty(ast: Program) { | ||||
|   _isAstEmpty(ast: UnboxedNode<Program>) { | ||||
|     return ast.start === 0 && ast.end === 0 && ast.body.length === 0 | ||||
|   } | ||||
| } | ||||
|  | ||||
| @ -12,6 +12,7 @@ import { EngineCommandManager } from 'lang/std/engineConnection' | ||||
| import { KCLError } from 'lang/errors' | ||||
| import { Diagnostic } from '@codemirror/lint' | ||||
| import { IdGenerator } from 'wasm-lib/kcl/bindings/IdGenerator' | ||||
| import { UnboxedNode } from 'wasm-lib/kcl/bindings/UnboxedNode' | ||||
|  | ||||
| export type ToolTip = | ||||
|   | 'lineTo' | ||||
| @ -52,7 +53,7 @@ export async function executeAst({ | ||||
|   programMemoryOverride, | ||||
|   idGenerator, | ||||
| }: { | ||||
|   ast: Program | ||||
|   ast: UnboxedNode<Program> | ||||
|   engineCommandManager: EngineCommandManager | ||||
|   useFakeExecutor?: boolean | ||||
|   programMemoryOverride?: ProgramMemory | ||||
|  | ||||
| @ -21,6 +21,7 @@ import { enginelessExecutor } from '../lib/testHelpers' | ||||
| import { findUsesOfTagInPipe, getNodePathFromSourceRange } from './queryAst' | ||||
| import { err } from 'lib/trap' | ||||
| import { SimplifiedArgDetails } from './std/stdTypes' | ||||
| import { UnboxedNode } from 'wasm-lib/kcl/bindings/UnboxedNode' | ||||
|  | ||||
| beforeAll(async () => { | ||||
|   await initPromise | ||||
| @ -109,7 +110,7 @@ describe('Testing findUniqueName', () => { | ||||
|         { type: 'Identifier', name: 'yo07', start: 0, end: 0 }, | ||||
|         { type: 'Identifier', name: 'yo08', start: 0, end: 0 }, | ||||
|         { type: 'Identifier', name: 'yo09', start: 0, end: 0 }, | ||||
|       ] satisfies Identifier[]), | ||||
|       ] satisfies UnboxedNode<Identifier>[]), | ||||
|       'yo', | ||||
|       2 | ||||
|     ) | ||||
| @ -123,7 +124,7 @@ describe('Testing addSketchTo', () => { | ||||
|         body: [], | ||||
|         start: 0, | ||||
|         end: 0, | ||||
|         nonCodeMeta: { nonCodeNodes: {}, start: [] }, | ||||
|         nonCodeMeta: { nonCodeNodes: {}, startNodes: [] }, | ||||
|       }, | ||||
|       'yz' | ||||
|     ) | ||||
|  | ||||
| @ -42,12 +42,13 @@ import { SimplifiedArgDetails } from './std/stdTypes' | ||||
| import { TagDeclarator } from 'wasm-lib/kcl/bindings/TagDeclarator' | ||||
| import { Models } from '@kittycad/lib' | ||||
| import { ExtrudeFacePlane } from 'machines/modelingMachine' | ||||
| import { UnboxedNode } from 'wasm-lib/kcl/bindings/UnboxedNode' | ||||
|  | ||||
| export function startSketchOnDefault( | ||||
|   node: Program, | ||||
|   node: UnboxedNode<Program>, | ||||
|   axis: DefaultPlaneStr, | ||||
|   name = '' | ||||
| ): { modifiedAst: Program; id: string; pathToNode: PathToNode } { | ||||
| ): { modifiedAst: UnboxedNode<Program>; id: string; pathToNode: PathToNode } { | ||||
|   const _node = { ...node } | ||||
|   const _name = | ||||
|     name || findUniqueName(node, KCL_DEFAULT_CONSTANT_PREFIXES.SKETCH) | ||||
| @ -76,10 +77,10 @@ export function startSketchOnDefault( | ||||
| } | ||||
|  | ||||
| export function addStartProfileAt( | ||||
|   node: Program, | ||||
|   node: UnboxedNode<Program>, | ||||
|   pathToNode: PathToNode, | ||||
|   at: [number, number] | ||||
| ): { modifiedAst: Program; pathToNode: PathToNode } | Error { | ||||
| ): { modifiedAst: UnboxedNode<Program>; pathToNode: PathToNode } | Error { | ||||
|   const _node1 = getNodeFromPath<VariableDeclaration>( | ||||
|     node, | ||||
|     pathToNode, | ||||
| @ -114,7 +115,7 @@ export function addStartProfileAt( | ||||
| } | ||||
|  | ||||
| export function addSketchTo( | ||||
|   node: Program, | ||||
|   node: UnboxedNode<Program>, | ||||
|   axis: 'xy' | 'xz' | 'yz', | ||||
|   name = '' | ||||
| ): { modifiedAst: Program; id: string; pathToNode: PathToNode } { | ||||
| @ -210,7 +211,7 @@ export function mutateArrExp(node: Expr, updateWith: ArrayExpression): boolean { | ||||
|  | ||||
| export function mutateObjExpProp( | ||||
|   node: Expr, | ||||
|   updateWith: Literal | ArrayExpression, | ||||
|   updateWith: UnboxedNode<Literal> | UnboxedNode<ArrayExpression>, | ||||
|   key: string | ||||
| ): boolean { | ||||
|   if (node.type === 'ObjectExpression') { | ||||
| @ -248,13 +249,13 @@ export function mutateObjExpProp( | ||||
| } | ||||
|  | ||||
| export function extrudeSketch( | ||||
|   node: Program, | ||||
|   node: UnboxedNode<Program>, | ||||
|   pathToNode: PathToNode, | ||||
|   shouldPipe = false, | ||||
|   distance: Expr = createLiteral(4) | ||||
| ): | ||||
|   | { | ||||
|       modifiedAst: Program | ||||
|       modifiedAst: UnboxedNode<Program> | ||||
|       pathToNode: PathToNode | ||||
|       pathToExtrudeArg: PathToNode | ||||
|     } | ||||
| @ -343,13 +344,13 @@ export function extrudeSketch( | ||||
| } | ||||
|  | ||||
| export function revolveSketch( | ||||
|   node: Program, | ||||
|   node: UnboxedNode<Program>, | ||||
|   pathToNode: PathToNode, | ||||
|   shouldPipe = false, | ||||
|   angle: Expr = createLiteral(4) | ||||
| ): | ||||
|   | { | ||||
|       modifiedAst: Program | ||||
|       modifiedAst: UnboxedNode<Program> | ||||
|       pathToNode: PathToNode | ||||
|       pathToRevolveArg: PathToNode | ||||
|     } | ||||
| @ -439,7 +440,7 @@ export function revolveSketch( | ||||
| } | ||||
|  | ||||
| export function sketchOnExtrudedFace( | ||||
|   node: Program, | ||||
|   node: UnboxedNode<Program>, | ||||
|   sketchPathToNode: PathToNode, | ||||
|   extrudePathToNode: PathToNode, | ||||
|   info: ExtrudeFacePlane['faceInfo'] = { type: 'wall' } | ||||
| @ -571,7 +572,7 @@ export function splitPathAtPipeExpression(pathToNode: PathToNode): { | ||||
|   return splitPathAtPipeExpression(pathToNode.slice(0, -1)) | ||||
| } | ||||
|  | ||||
| export function createLiteral(value: string | number): Literal { | ||||
| export function createLiteral(value: string | number): UnboxedNode<Literal> { | ||||
|   return { | ||||
|     type: 'Literal', | ||||
|     start: 0, | ||||
| @ -581,7 +582,7 @@ export function createLiteral(value: string | number): Literal { | ||||
|   } | ||||
| } | ||||
|  | ||||
| export function createTagDeclarator(value: string): TagDeclarator { | ||||
| export function createTagDeclarator(value: string): UnboxedNode<TagDeclarator> { | ||||
|   return { | ||||
|     type: 'TagDeclarator', | ||||
|     start: 0, | ||||
| @ -591,7 +592,7 @@ export function createTagDeclarator(value: string): TagDeclarator { | ||||
|   } | ||||
| } | ||||
|  | ||||
| export function createIdentifier(name: string): Identifier { | ||||
| export function createIdentifier(name: string): UnboxedNode<Identifier> { | ||||
|   return { | ||||
|     type: 'Identifier', | ||||
|     start: 0, | ||||
| @ -601,7 +602,7 @@ export function createIdentifier(name: string): Identifier { | ||||
|   } | ||||
| } | ||||
|  | ||||
| export function createPipeSubstitution(): PipeSubstitution { | ||||
| export function createPipeSubstitution(): UnboxedNode<PipeSubstitution> { | ||||
|   return { | ||||
|     type: 'PipeSubstitution', | ||||
|     start: 0, | ||||
| @ -612,7 +613,7 @@ export function createPipeSubstitution(): PipeSubstitution { | ||||
| export function createCallExpressionStdLib( | ||||
|   name: string, | ||||
|   args: CallExpression['arguments'] | ||||
| ): CallExpression { | ||||
| ): UnboxedNode<CallExpression> { | ||||
|   return { | ||||
|     type: 'CallExpression', | ||||
|     start: 0, | ||||
| @ -632,7 +633,7 @@ export function createCallExpressionStdLib( | ||||
| export function createCallExpression( | ||||
|   name: string, | ||||
|   args: CallExpression['arguments'] | ||||
| ): CallExpression { | ||||
| ): UnboxedNode<CallExpression> { | ||||
|   return { | ||||
|     type: 'CallExpression', | ||||
|     start: 0, | ||||
| @ -651,7 +652,7 @@ export function createCallExpression( | ||||
|  | ||||
| export function createArrayExpression( | ||||
|   elements: ArrayExpression['elements'] | ||||
| ): ArrayExpression { | ||||
| ): UnboxedNode<ArrayExpression> { | ||||
|   return { | ||||
|     type: 'ArrayExpression', | ||||
|     start: 0, | ||||
| @ -664,7 +665,7 @@ export function createArrayExpression( | ||||
|  | ||||
| export function createPipeExpression( | ||||
|   body: PipeExpression['body'] | ||||
| ): PipeExpression { | ||||
| ): UnboxedNode<PipeExpression> { | ||||
|   return { | ||||
|     type: 'PipeExpression', | ||||
|     start: 0, | ||||
| @ -680,7 +681,7 @@ export function createVariableDeclaration( | ||||
|   init: VariableDeclarator['init'], | ||||
|   visibility: VariableDeclaration['visibility'] = 'default', | ||||
|   kind: VariableDeclaration['kind'] = 'const' | ||||
| ): VariableDeclaration { | ||||
| ): UnboxedNode<VariableDeclaration> { | ||||
|   return { | ||||
|     type: 'VariableDeclaration', | ||||
|     start: 0, | ||||
| @ -703,7 +704,7 @@ export function createVariableDeclaration( | ||||
|  | ||||
| export function createObjectExpression(properties: { | ||||
|   [key: string]: Expr | ||||
| }): ObjectExpression { | ||||
| }): UnboxedNode<ObjectExpression> { | ||||
|   return { | ||||
|     type: 'ObjectExpression', | ||||
|     start: 0, | ||||
| @ -724,7 +725,7 @@ export function createObjectExpression(properties: { | ||||
| export function createUnaryExpression( | ||||
|   argument: UnaryExpression['argument'], | ||||
|   operator: UnaryExpression['operator'] = '-' | ||||
| ): UnaryExpression { | ||||
| ): UnboxedNode<UnaryExpression> { | ||||
|   return { | ||||
|     type: 'UnaryExpression', | ||||
|     start: 0, | ||||
| @ -739,7 +740,7 @@ export function createBinaryExpression([left, operator, right]: [ | ||||
|   BinaryExpression['left'], | ||||
|   BinaryExpression['operator'], | ||||
|   BinaryExpression['right'] | ||||
| ]): BinaryExpression { | ||||
| ]): UnboxedNode<BinaryExpression> { | ||||
|   return { | ||||
|     type: 'BinaryExpression', | ||||
|     start: 0, | ||||
| @ -754,19 +755,19 @@ export function createBinaryExpression([left, operator, right]: [ | ||||
| export function createBinaryExpressionWithUnary([left, right]: [ | ||||
|   BinaryExpression['left'], | ||||
|   BinaryExpression['right'] | ||||
| ]): BinaryExpression { | ||||
| ]): UnboxedNode<BinaryExpression> { | ||||
|   if (right.type === 'UnaryExpression' && right.operator === '-') | ||||
|     return createBinaryExpression([left, '-', right.argument]) | ||||
|   return createBinaryExpression([left, '+', right]) | ||||
| } | ||||
|  | ||||
| export function giveSketchFnCallTag( | ||||
|   ast: Program, | ||||
|   ast: UnboxedNode<Program>, | ||||
|   range: Selection['range'], | ||||
|   tag?: string | ||||
| ): | ||||
|   | { | ||||
|       modifiedAst: Program | ||||
|       modifiedAst: UnboxedNode<Program> | ||||
|       tag: string | ||||
|       isTagExisting: boolean | ||||
|       pathToNode: PathToNode | ||||
| @ -801,7 +802,7 @@ export function giveSketchFnCallTag( | ||||
| } | ||||
|  | ||||
| export function moveValueIntoNewVariablePath( | ||||
|   ast: Program, | ||||
|   ast: UnboxedNode<Program>, | ||||
|   programMemory: ProgramMemory, | ||||
|   pathToNode: PathToNode, | ||||
|   variableName: string | ||||
| @ -834,12 +835,12 @@ export function moveValueIntoNewVariablePath( | ||||
| } | ||||
|  | ||||
| export function moveValueIntoNewVariable( | ||||
|   ast: Program, | ||||
|   ast: UnboxedNode<Program>, | ||||
|   programMemory: ProgramMemory, | ||||
|   sourceRange: Selection['range'], | ||||
|   variableName: string | ||||
| ): { | ||||
|   modifiedAst: Program | ||||
|   modifiedAst: UnboxedNode<Program> | ||||
|   pathToReplacedNode?: PathToNode | ||||
| } { | ||||
|   const meta = isNodeSafeToReplace(ast, sourceRange) | ||||
| @ -872,17 +873,17 @@ export function moveValueIntoNewVariable( | ||||
|  */ | ||||
| export function deleteSegmentFromPipeExpression( | ||||
|   dependentRanges: SourceRange[], | ||||
|   modifiedAst: Program, | ||||
|   modifiedAst: UnboxedNode<Program>, | ||||
|   programMemory: ProgramMemory, | ||||
|   code: string, | ||||
|   pathToNode: PathToNode | ||||
| ): Program | Error { | ||||
| ): UnboxedNode<Program> | Error { | ||||
|   let _modifiedAst = structuredClone(modifiedAst) | ||||
|  | ||||
|   dependentRanges.forEach((range) => { | ||||
|     const path = getNodePathFromSourceRange(_modifiedAst, range) | ||||
|  | ||||
|     const callExp = getNodeFromPath<CallExpression>( | ||||
|     const callExp = getNodeFromPath<UnboxedNode<CallExpression>>( | ||||
|       _modifiedAst, | ||||
|       path, | ||||
|       'CallExpression', | ||||
| @ -928,11 +929,11 @@ export function deleteSegmentFromPipeExpression( | ||||
| export function removeSingleConstraintInfo( | ||||
|   pathToCallExp: PathToNode, | ||||
|   argDetails: SimplifiedArgDetails, | ||||
|   ast: Program, | ||||
|   ast: UnboxedNode<Program>, | ||||
|   programMemory: ProgramMemory | ||||
| ): | ||||
|   | { | ||||
|       modifiedAst: Program | ||||
|       modifiedAst: UnboxedNode<Program> | ||||
|       pathToNodeMap: PathToNodeMap | ||||
|     } | ||||
|   | false { | ||||
| @ -954,12 +955,12 @@ export function removeSingleConstraintInfo( | ||||
| } | ||||
|  | ||||
| export async function deleteFromSelection( | ||||
|   ast: Program, | ||||
|   ast: UnboxedNode<Program>, | ||||
|   selection: Selection, | ||||
|   programMemory: ProgramMemory, | ||||
|   getFaceDetails: (id: string) => Promise<Models['FaceIsPlanar_type']> = () => | ||||
|     ({} as any) | ||||
| ): Promise<Program | Error> { | ||||
| ): Promise<UnboxedNode<Program> | Error> { | ||||
|   const astClone = structuredClone(ast) | ||||
|   const range = selection.range | ||||
|   const path = getNodePathFromSourceRange(ast, range) | ||||
| @ -1134,5 +1135,5 @@ export async function deleteFromSelection( | ||||
| } | ||||
|  | ||||
| const nonCodeMetaEmpty = () => { | ||||
|   return { nonCodeNodes: {}, start: [] } | ||||
|   return { nonCodeNodes: {}, startNodes: [], start: 0, end: 0 } | ||||
| } | ||||
|  | ||||
| @ -36,11 +36,12 @@ import { | ||||
|   getSweepFromSuspectedPath, | ||||
| } from 'lang/std/artifactGraph' | ||||
| import { kclManager, engineCommandManager, editorManager } from 'lib/singletons' | ||||
| import { UnboxedNode } from 'wasm-lib/kcl/bindings/UnboxedNode' | ||||
|  | ||||
| // Apply Fillet To Selection | ||||
|  | ||||
| export function applyFilletToSelection( | ||||
|   ast: Program, | ||||
|   ast: UnboxedNode<Program>, | ||||
|   selection: Selections, | ||||
|   radius: KclCommandValue | ||||
| ): void | Error { | ||||
| @ -55,10 +56,12 @@ export function applyFilletToSelection( | ||||
| } | ||||
|  | ||||
| export function modifyAstCloneWithFilletAndTag( | ||||
|   ast: Program, | ||||
|   ast: UnboxedNode<Program>, | ||||
|   selection: Selections, | ||||
|   radius: KclCommandValue | ||||
| ): { modifiedAst: Program; pathToFilletNode: Array<PathToNode> } | Error { | ||||
| ): | ||||
|   | { modifiedAst: UnboxedNode<Program>; pathToFilletNode: Array<PathToNode> } | ||||
|   | Error { | ||||
|   let clonedAst = structuredClone(ast) | ||||
|   const clonedAstForGetExtrude = structuredClone(ast) | ||||
|  | ||||
| @ -246,7 +249,7 @@ export function getPathToExtrudeForSegmentSelection( | ||||
| } | ||||
|  | ||||
| async function updateAstAndFocus( | ||||
|   modifiedAst: Program, | ||||
|   modifiedAst: UnboxedNode<Program>, | ||||
|   pathToFilletNode: Array<PathToNode> | ||||
| ) { | ||||
|   const updatedAst = await kclManager.updateAst(modifiedAst, true, { | ||||
| @ -258,7 +261,7 @@ async function updateAstAndFocus( | ||||
| } | ||||
|  | ||||
| function mutateAstWithTagForSketchSegment( | ||||
|   astClone: Program, | ||||
|   astClone: UnboxedNode<Program>, | ||||
|   pathToSegmentNode: PathToNode | ||||
| ): { modifiedAst: Program; tag: string } | Error { | ||||
|   const segmentNode = getNodeFromPath<CallExpression>( | ||||
| @ -292,7 +295,7 @@ function mutateAstWithTagForSketchSegment( | ||||
| function getEdgeTagCall( | ||||
|   tag: string, | ||||
|   selectionType: string | ||||
| ): Identifier | CallExpression { | ||||
| ): UnboxedNode<Identifier | CallExpression> { | ||||
|   let tagCall: Expr = createIdentifier(tag) | ||||
|  | ||||
|   // Modify the tag based on selectionType | ||||
| @ -426,7 +429,7 @@ export const hasValidFilletSelection = ({ | ||||
|   code, | ||||
| }: { | ||||
|   selectionRanges: Selections | ||||
|   ast: Program | ||||
|   ast: UnboxedNode<Program> | ||||
|   code: string | ||||
| }) => { | ||||
|   // check if there is anything filletable in the scene | ||||
| @ -454,7 +457,7 @@ export const hasValidFilletSelection = ({ | ||||
|   for (const selection of selectionRanges.codeBasedSelections) { | ||||
|     // check if all selections are in sketchLineHelperMap | ||||
|     const path = getNodePathFromSourceRange(ast, selection.range) | ||||
|     const segmentNode = getNodeFromPath<CallExpression>( | ||||
|     const segmentNode = getNodeFromPath<UnboxedNode<CallExpression>>( | ||||
|       ast, | ||||
|       path, | ||||
|       'CallExpression' | ||||
| @ -534,7 +537,7 @@ export const isTagUsedInFillet = ({ | ||||
|   ast, | ||||
|   callExp, | ||||
| }: { | ||||
|   ast: Program | ||||
|   ast: UnboxedNode<Program> | ||||
|   callExp: CallExpression | ||||
| }): Array<EdgeTypes> => { | ||||
|   const tag = getTagFromCallExpression(callExp) | ||||
|  | ||||
| @ -29,6 +29,7 @@ import { | ||||
| } from './std/sketchcombos' | ||||
| import { err } from 'lib/trap' | ||||
| import { ImportStatement } from 'wasm-lib/kcl/bindings/ImportStatement' | ||||
| import { UnboxedNode } from 'wasm-lib/kcl/bindings/UnboxedNode' | ||||
|  | ||||
| /** | ||||
|  * Retrieves a node from a given path within a Program node structure, optionally stopping at a specified node type. | ||||
| @ -121,12 +122,13 @@ export function getNodeFromPathCurry( | ||||
| } | ||||
|  | ||||
| function moreNodePathFromSourceRange( | ||||
|   node: | ||||
|   node: UnboxedNode< | ||||
|     | Expr | ||||
|     | ImportStatement | ||||
|     | ExpressionStatement | ||||
|     | VariableDeclaration | ||||
|     | ReturnStatement, | ||||
|     | ReturnStatement | ||||
|   >, | ||||
|   sourceRange: Selection['range'], | ||||
|   previousPath: PathToNode = [['body', '']] | ||||
| ): PathToNode { | ||||
| @ -344,15 +346,16 @@ export function getNodePathFromSourceRange( | ||||
|   return path | ||||
| } | ||||
|  | ||||
| type KCLNode = | ||||
| type KCLNode = UnboxedNode< | ||||
|   | Expr | ||||
|   | ExpressionStatement | ||||
|   | VariableDeclaration | ||||
|   | VariableDeclarator | ||||
|   | ReturnStatement | ||||
| > | ||||
|  | ||||
| export function traverse( | ||||
|   node: KCLNode | Program, | ||||
|   node: KCLNode | UnboxedNode<Program>, | ||||
|   option: { | ||||
|     enter?: (node: KCLNode, pathToNode: PathToNode) => void | ||||
|     leave?: (node: KCLNode) => void | ||||
| @ -512,9 +515,9 @@ export function findAllPreviousVariables( | ||||
| } | ||||
|  | ||||
| type ReplacerFn = ( | ||||
|   _ast: Program, | ||||
|   _ast: UnboxedNode<Program>, | ||||
|   varName: string | ||||
| ) => { modifiedAst: Program; pathToReplaced: PathToNode } | Error | ||||
| ) => { modifiedAst: UnboxedNode<Program>; pathToReplaced: PathToNode } | Error | ||||
|  | ||||
| export function isNodeSafeToReplacePath( | ||||
|   ast: Program, | ||||
| @ -583,12 +586,12 @@ export function isNodeSafeToReplacePath( | ||||
| } | ||||
|  | ||||
| export function isNodeSafeToReplace( | ||||
|   ast: Program, | ||||
|   ast: UnboxedNode<Program>, | ||||
|   sourceRange: [number, number] | ||||
| ): | ||||
|   | { | ||||
|       isSafe: boolean | ||||
|       value: Expr | ||||
|       value: UnboxedNode<Expr> | ||||
|       replacer: ReplacerFn | ||||
|     } | ||||
|   | Error { | ||||
| @ -837,7 +840,7 @@ export function findUsesOfTagInPipe( | ||||
|       ? String(thirdParam.value) | ||||
|       : thirdParam.name | ||||
|  | ||||
|   const varDec = getNodeFromPath<VariableDeclaration>( | ||||
|   const varDec = getNodeFromPath<UnboxedNode<VariableDeclaration>>( | ||||
|     ast, | ||||
|     pathToNode, | ||||
|     'VariableDeclaration' | ||||
|  | ||||
| @ -17,6 +17,7 @@ import { | ||||
| import { getNodeFromPath, getNodePathFromSourceRange } from '../queryAst' | ||||
| import { enginelessExecutor } from '../../lib/testHelpers' | ||||
| import { err } from 'lib/trap' | ||||
| import { UnboxedNode } from 'wasm-lib/kcl/bindings/UnboxedNode' | ||||
|  | ||||
| const eachQuad: [number, [number, number]][] = [ | ||||
|   [-315, [1, 1]], | ||||
| @ -687,7 +688,7 @@ describe('testing getConstraintInfo', () => { | ||||
|       ] | ||||
|       if (err(ast)) return ast | ||||
|       const pathToNode = getNodePathFromSourceRange(ast, sourceRange) | ||||
|       const callExp = getNodeFromPath<CallExpression>( | ||||
|       const callExp = getNodeFromPath<UnboxedNode<CallExpression>>( | ||||
|         ast, | ||||
|         pathToNode, | ||||
|         'CallExpression' | ||||
| @ -841,7 +842,7 @@ describe('testing getConstraintInfo', () => { | ||||
|       ] | ||||
|       if (err(ast)) return ast | ||||
|       const pathToNode = getNodePathFromSourceRange(ast, sourceRange) | ||||
|       const callExp = getNodeFromPath<CallExpression>( | ||||
|       const callExp = getNodeFromPath<UnboxedNode<CallExpression>>( | ||||
|         ast, | ||||
|         pathToNode, | ||||
|         'CallExpression' | ||||
| @ -1197,7 +1198,7 @@ describe('testing getConstraintInfo', () => { | ||||
|       ] | ||||
|       if (err(ast)) return ast | ||||
|       const pathToNode = getNodePathFromSourceRange(ast, sourceRange) | ||||
|       const callExp = getNodeFromPath<CallExpression>( | ||||
|       const callExp = getNodeFromPath<UnboxedNode<CallExpression>>( | ||||
|         ast, | ||||
|         pathToNode, | ||||
|         'CallExpression' | ||||
|  | ||||
| @ -55,6 +55,7 @@ import { err } from 'lib/trap' | ||||
| import { perpendicularDistance } from 'sketch-helpers' | ||||
| import { TagDeclarator } from 'wasm-lib/kcl/bindings/TagDeclarator' | ||||
| import { EdgeCutInfo } from 'machines/modelingMachine' | ||||
| import { UnboxedNode } from 'wasm-lib/kcl/bindings/UnboxedNode' | ||||
|  | ||||
| const STRAIGHT_SEGMENT_ERR = new Error( | ||||
|   'Invalid input, expected "straight-segment"' | ||||
| @ -1785,7 +1786,8 @@ export const angledLineThatIntersects: SketchLineHelper = { | ||||
|       ) | ||||
|     } | ||||
|     if (intersectTag !== -1) { | ||||
|       const tag = firstArg.properties[intersectTag]?.value as Identifier | ||||
|       const tag = firstArg.properties[intersectTag] | ||||
|         ?.value as UnboxedNode<Identifier> | ||||
|       const pathToTagProp: PathToNode = [ | ||||
|         ...pathToObjectExp, | ||||
|         [intersectTag, 'index'], | ||||
| @ -1825,7 +1827,9 @@ export const updateStartProfileAtArgs: SketchLineHelper['updateArgs'] = ({ | ||||
|         body: [], | ||||
|  | ||||
|         nonCodeMeta: { | ||||
|           start: [], | ||||
|           start: 0, | ||||
|           end: 0, | ||||
|           startNodes: [], | ||||
|           nonCodeNodes: [], | ||||
|         }, | ||||
|       }, | ||||
| @ -1865,7 +1869,7 @@ export const sketchLineHelperMap: { [key: string]: SketchLineHelper } = { | ||||
| } as const | ||||
|  | ||||
| export function changeSketchArguments( | ||||
|   node: Program, | ||||
|   node: UnboxedNode<Program>, | ||||
|   programMemory: ProgramMemory, | ||||
|   sourceRangeOrPath: | ||||
|     | { | ||||
| @ -1877,7 +1881,7 @@ export function changeSketchArguments( | ||||
|         pathToNode: PathToNode | ||||
|       }, | ||||
|   input: SegmentInputs | ||||
| ): { modifiedAst: Program; pathToNode: PathToNode } | Error { | ||||
| ): { modifiedAst: UnboxedNode<Program>; pathToNode: PathToNode } | Error { | ||||
|   const _node = { ...node } | ||||
|   const thePath = | ||||
|     sourceRangeOrPath.type === 'sourceRange' | ||||
| @ -1906,7 +1910,7 @@ export function changeSketchArguments( | ||||
| } | ||||
|  | ||||
| export function getConstraintInfo( | ||||
|   callExpression: CallExpression, | ||||
|   callExpression: UnboxedNode<CallExpression>, | ||||
|   code: string, | ||||
|   pathToNode: PathToNode | ||||
| ): ConstrainInfo[] { | ||||
| @ -1944,7 +1948,7 @@ export function compareVec2Epsilon2( | ||||
| } | ||||
|  | ||||
| interface CreateLineFnCallArgs { | ||||
|   node: Program | ||||
|   node: UnboxedNode<Program> | ||||
|   programMemory: ProgramMemory | ||||
|   input: SegmentInputs | ||||
|   fnName: ToolTip | ||||
| @ -1961,7 +1965,7 @@ export function addNewSketchLn({ | ||||
|   spliceBetween = false, | ||||
| }: CreateLineFnCallArgs): | ||||
|   | { | ||||
|       modifiedAst: Program | ||||
|       modifiedAst: UnboxedNode<Program> | ||||
|       pathToNode: PathToNode | ||||
|     } | ||||
|   | Error { | ||||
| @ -1971,8 +1975,12 @@ export function addNewSketchLn({ | ||||
|     return new Error('not a sketch line helper') | ||||
|   } | ||||
|  | ||||
|   getNodeFromPath<VariableDeclarator>(node, pathToNode, 'VariableDeclarator') | ||||
|   getNodeFromPath<PipeExpression | CallExpression>( | ||||
|   getNodeFromPath<UnboxedNode<VariableDeclarator>>( | ||||
|     node, | ||||
|     pathToNode, | ||||
|     'VariableDeclarator' | ||||
|   ) | ||||
|   getNodeFromPath<UnboxedNode<PipeExpression | CallExpression>>( | ||||
|     node, | ||||
|     pathToNode, | ||||
|     'PipeExpression' | ||||
| @ -1991,13 +1999,13 @@ export function addCallExpressionsToPipe({ | ||||
|   pathToNode, | ||||
|   expressions, | ||||
| }: { | ||||
|   node: Program | ||||
|   node: UnboxedNode<Program> | ||||
|   programMemory: ProgramMemory | ||||
|   pathToNode: PathToNode | ||||
|   expressions: CallExpression[] | ||||
|   expressions: UnboxedNode<CallExpression>[] | ||||
| }) { | ||||
|   const _node = { ...node } | ||||
|   const pipeExpression = getNodeFromPath<PipeExpression>( | ||||
|   const pipeExpression = getNodeFromPath<UnboxedNode<PipeExpression>>( | ||||
|     _node, | ||||
|     pathToNode, | ||||
|     'PipeExpression' | ||||
| @ -2046,7 +2054,7 @@ export function replaceSketchLine({ | ||||
|   replaceExistingCallback, | ||||
|   referencedSegment, | ||||
| }: { | ||||
|   node: Program | ||||
|   node: UnboxedNode<Program> | ||||
|   programMemory: ProgramMemory | ||||
|   pathToNode: PathToNode | ||||
|   fnName: ToolTip | ||||
| @ -2055,7 +2063,7 @@ export function replaceSketchLine({ | ||||
|   referencedSegment?: Path | ||||
| }): | ||||
|   | { | ||||
|       modifiedAst: Program | ||||
|       modifiedAst: UnboxedNode<Program> | ||||
|       valueUsedInTransform?: number | ||||
|       pathToNode: PathToNode | ||||
|     } | ||||
| @ -2107,7 +2115,7 @@ function addTagToChamfer( | ||||
|   edgeCutMeta: EdgeCutInfo | null | ||||
| ): | ||||
|   | { | ||||
|       modifiedAst: Program | ||||
|       modifiedAst: UnboxedNode<Program> | ||||
|       tag: string | ||||
|     } | ||||
|   | Error { | ||||
| @ -2234,7 +2242,7 @@ export function addTagForSketchOnFace( | ||||
|   edgeCutMeta: EdgeCutInfo | null | ||||
| ): | ||||
|   | { | ||||
|       modifiedAst: Program | ||||
|       modifiedAst: UnboxedNode<Program> | ||||
|       tag: string | ||||
|     } | ||||
|   | Error { | ||||
| @ -2272,12 +2280,14 @@ function isAngleLiteral(lineArugement: Expr): boolean { | ||||
|     : false | ||||
| } | ||||
|  | ||||
| type addTagFn = (a: AddTagInfo) => { modifiedAst: Program; tag: string } | Error | ||||
| type addTagFn = ( | ||||
|   a: AddTagInfo | ||||
| ) => { modifiedAst: UnboxedNode<Program>; tag: string } | Error | ||||
|  | ||||
| function addTag(tagIndex = 2): addTagFn { | ||||
|   return ({ node, pathToNode }) => { | ||||
|     const _node = { ...node } | ||||
|     const callExpr = getNodeFromPath<CallExpression>( | ||||
|     const callExpr = getNodeFromPath<UnboxedNode<CallExpression>>( | ||||
|       _node, | ||||
|       pathToNode, | ||||
|       'CallExpression' | ||||
|  | ||||
| @ -49,6 +49,7 @@ import { | ||||
|   getSketchSegmentFromSourceRange, | ||||
| } from './sketchConstraints' | ||||
| import { getAngle, roundOff, normaliseAngle } from '../../lib/utils' | ||||
| import { UnboxedNode } from 'wasm-lib/kcl/bindings/UnboxedNode' | ||||
|  | ||||
| export type LineInputsType = | ||||
|   | 'xAbsolute' | ||||
| @ -325,7 +326,7 @@ const setHorzVertDistanceCreateNode = | ||||
|     if (isUndef(refNum) || err(literalArg)) return REF_NUM_ERR | ||||
|  | ||||
|     const valueUsedInTransform = roundOff(literalArg - refNum, 2) | ||||
|     let finalValue: Expr = createBinaryExpressionWithUnary([ | ||||
|     let finalValue: UnboxedNode<Expr> = createBinaryExpressionWithUnary([ | ||||
|       createSegEnd(referenceSegName, !index), | ||||
|       forceValueUsedInTransform || createLiteral(valueUsedInTransform), | ||||
|     ]) | ||||
| @ -1541,7 +1542,7 @@ export function transformSecondarySketchLinesTagFirst({ | ||||
|   forceSegName, | ||||
|   forceValueUsedInTransform, | ||||
| }: { | ||||
|   ast: Program | ||||
|   ast: UnboxedNode<Program> | ||||
|   selectionRanges: Selections | ||||
|   transformInfos: TransformInfo[] | ||||
|   programMemory: ProgramMemory | ||||
| @ -1549,7 +1550,7 @@ export function transformSecondarySketchLinesTagFirst({ | ||||
|   forceValueUsedInTransform?: BinaryPart | ||||
| }): | ||||
|   | { | ||||
|       modifiedAst: Program | ||||
|       modifiedAst: UnboxedNode<Program> | ||||
|       valueUsedInTransform?: number | ||||
|       pathToNodeMap: PathToNodeMap | ||||
|       tagInfo: { | ||||
| @ -1620,7 +1621,7 @@ export function transformAstSketchLines({ | ||||
|   forceValueUsedInTransform, | ||||
|   referencedSegmentRange, | ||||
| }: { | ||||
|   ast: Program | ||||
|   ast: UnboxedNode<Program> | ||||
|   selectionRanges: Selections | PathToNode[] | ||||
|   transformInfos: TransformInfo[] | ||||
|   programMemory: ProgramMemory | ||||
| @ -1629,7 +1630,7 @@ export function transformAstSketchLines({ | ||||
|   referencedSegmentRange?: Selection['range'] | ||||
| }): | ||||
|   | { | ||||
|       modifiedAst: Program | ||||
|       modifiedAst: UnboxedNode<Program> | ||||
|       valueUsedInTransform?: number | ||||
|       pathToNodeMap: PathToNodeMap | ||||
|     } | ||||
| @ -1647,7 +1648,7 @@ export function transformAstSketchLines({ | ||||
|  | ||||
|     const getNode = getNodeFromPathCurry(node, _pathToNode) | ||||
|  | ||||
|     const callExp = getNode<CallExpression>('CallExpression') | ||||
|     const callExp = getNode<UnboxedNode<CallExpression>>('CallExpression') | ||||
|     if (err(callExp)) return callExp | ||||
|     const varDec = getNode<VariableDeclarator>('VariableDeclarator') | ||||
|     if (err(varDec)) return varDec | ||||
| @ -1806,13 +1807,16 @@ function createSegAngle(referenceSegName: string): BinaryPart { | ||||
|   return createCallExpression('segAng', [createIdentifier(referenceSegName)]) | ||||
| } | ||||
|  | ||||
| function createSegEnd(referenceSegName: string, isX: boolean): CallExpression { | ||||
| function createSegEnd( | ||||
|   referenceSegName: string, | ||||
|   isX: boolean | ||||
| ): UnboxedNode<CallExpression> { | ||||
|   return createCallExpression(isX ? 'segEndX' : 'segEndY', [ | ||||
|     createIdentifier(referenceSegName), | ||||
|   ]) | ||||
| } | ||||
|  | ||||
| function createLastSeg(isX: boolean): CallExpression { | ||||
| function createLastSeg(isX: boolean): UnboxedNode<CallExpression> { | ||||
|   return createCallExpression(isX ? 'lastSegX' : 'lastSegY', [ | ||||
|     createPipeSubstitution(), | ||||
|   ]) | ||||
| @ -1830,7 +1834,7 @@ export function getConstraintLevelFromSourceRange( | ||||
|   ast: Program | Error | ||||
| ): Error | { range: [number, number]; level: ConstraintLevel } { | ||||
|   if (err(ast)) return ast | ||||
|   const nodeMeta = getNodeFromPath<CallExpression>( | ||||
|   const nodeMeta = getNodeFromPath<UnboxedNode<CallExpression>>( | ||||
|     ast, | ||||
|     getNodePathFromSourceRange(ast, cursorRange), | ||||
|     'CallExpression' | ||||
|  | ||||
| @ -11,16 +11,17 @@ import { | ||||
|   BinaryPart, | ||||
| } from '../wasm' | ||||
| import { LineInputsType } from './sketchcombos' | ||||
| import { UnboxedNode } from 'wasm-lib/kcl/bindings/UnboxedNode' | ||||
|  | ||||
| export interface ModifyAstBase { | ||||
|   node: Program | ||||
|   node: UnboxedNode<Program> | ||||
|   // TODO #896: Remove ProgramMemory from this interface | ||||
|   previousProgramMemory: ProgramMemory | ||||
|   pathToNode: PathToNode | ||||
| } | ||||
|  | ||||
| export interface AddTagInfo { | ||||
|   node: Program | ||||
|   node: UnboxedNode<Program> | ||||
|   pathToNode: PathToNode | ||||
| } | ||||
|  | ||||
| @ -134,7 +135,7 @@ type _InputArg<T> = | ||||
|  * Which is why a union type is used that can be type narrowed using the {@link RawArg.type} property | ||||
|  * {@link RawArg.expr} is common to all of these types | ||||
|  */ | ||||
| export type InputArg = _InputArg<Expr> | ||||
| export type InputArg = _InputArg<UnboxedNode<Expr>> | ||||
|  | ||||
| /** | ||||
|  * {@link RawArg.expr} is the literal equivalent of whatever current expression is | ||||
| @ -142,7 +143,7 @@ export type InputArg = _InputArg<Expr> | ||||
|  * but of course works for expressions like myVar + someFn() etc too | ||||
|  * This is useful in cases where we want to "un-constrain" inputs to segments | ||||
|  */ | ||||
| type RawArg = _InputArg<Literal> | ||||
| type RawArg = _InputArg<UnboxedNode<Literal>> | ||||
|  | ||||
| export type InputArgs = Array<InputArg> | ||||
|  | ||||
| @ -186,7 +187,7 @@ export type CreateStdLibSketchCallExpr = (args: { | ||||
|   inputs: InputArgs | ||||
|   rawArgs: RawArgs | ||||
|   referenceSegName: string | ||||
|   tag?: Expr | ||||
|   tag?: UnboxedNode<Expr> | ||||
|   forceValueUsedInTransform?: BinaryPart | ||||
|   referencedSegment?: Path | ||||
| }) => CreatedSketchExprResult | Error | ||||
| @ -215,26 +216,26 @@ export interface ConstrainInfo { | ||||
| export interface SketchLineHelper { | ||||
|   add: (a: addCall) => | ||||
|     | { | ||||
|         modifiedAst: Program | ||||
|         modifiedAst: UnboxedNode<Program> | ||||
|         pathToNode: PathToNode | ||||
|         valueUsedInTransform?: number | ||||
|       } | ||||
|     | Error | ||||
|   updateArgs: (a: updateArgs) => | ||||
|     | { | ||||
|         modifiedAst: Program | ||||
|         modifiedAst: UnboxedNode<Program> | ||||
|         pathToNode: PathToNode | ||||
|       } | ||||
|     | Error | ||||
|   getTag: (a: CallExpression) => string | Error | ||||
|   addTag: (a: AddTagInfo) => | ||||
|     | { | ||||
|         modifiedAst: Program | ||||
|         modifiedAst: UnboxedNode<Program> | ||||
|         tag: string | ||||
|       } | ||||
|     | Error | ||||
|   getConstraintInfo: ( | ||||
|     callExp: CallExpression, | ||||
|     callExp: UnboxedNode<CallExpression>, | ||||
|     code: string, | ||||
|     pathToNode: PathToNode | ||||
|   ) => ConstrainInfo[] | ||||
|  | ||||
							
								
								
									
										13
									
								
								src/lang/wasm.test.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								src/lang/wasm.test.ts
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,13 @@ | ||||
| import { err } from 'lib/trap' | ||||
| import { parse } from './wasm' | ||||
| import { enginelessExecutor } from 'lib/testHelpers' | ||||
|  | ||||
| it('can execute parsed AST', async () => { | ||||
|   const code = `x = 1 | ||||
| // A comment.` | ||||
|   const ast = parse(code) | ||||
|   expect(err(ast)).toEqual(false) | ||||
|   const execState = await enginelessExecutor(ast) | ||||
|   expect(err(ast)).toEqual(false) | ||||
|   expect(execState.memory.get('x')).toEqual(1) | ||||
| }) | ||||
| @ -42,6 +42,7 @@ import { ExecState as RawExecState } from '../wasm-lib/kcl/bindings/ExecState' | ||||
| import { ProgramMemory as RawProgramMemory } from '../wasm-lib/kcl/bindings/ProgramMemory' | ||||
| import { EnvironmentRef } from '../wasm-lib/kcl/bindings/EnvironmentRef' | ||||
| import { Environment } from '../wasm-lib/kcl/bindings/Environment' | ||||
| import { UnboxedNode } from 'wasm-lib/kcl/bindings/UnboxedNode' | ||||
|  | ||||
| export type { Program } from '../wasm-lib/kcl/bindings/Program' | ||||
| export type { Expr } from '../wasm-lib/kcl/bindings/Expr' | ||||
| @ -122,11 +123,11 @@ export const initPromise = initialise() | ||||
| export const rangeTypeFix = (ranges: number[][]): [number, number][] => | ||||
|   ranges.map(([start, end]) => [start, end]) | ||||
|  | ||||
| export const parse = (code: string | Error): Program | Error => { | ||||
| export const parse = (code: string | Error): UnboxedNode<Program> | Error => { | ||||
|   if (err(code)) return code | ||||
|  | ||||
|   try { | ||||
|     const program: Program = parse_wasm(code) | ||||
|     const program: UnboxedNode<Program> = parse_wasm(code) | ||||
|     return program | ||||
|   } catch (e: any) { | ||||
|     // throw e | ||||
| @ -378,7 +379,7 @@ export function sketchFromKclValue( | ||||
| } | ||||
|  | ||||
| export const executor = async ( | ||||
|   node: Program, | ||||
|   node: UnboxedNode<Program>, | ||||
|   programMemory: ProgramMemory | Error = ProgramMemory.empty(), | ||||
|   idGenerator: IdGenerator = defaultIdGenerator(), | ||||
|   engineCommandManager: EngineCommandManager, | ||||
| @ -402,7 +403,7 @@ export const executor = async ( | ||||
| } | ||||
|  | ||||
| export const _executor = async ( | ||||
|   node: Program, | ||||
|   node: UnboxedNode<Program>, | ||||
|   programMemory: ProgramMemory | Error = ProgramMemory.empty(), | ||||
|   idGenerator: IdGenerator = defaultIdGenerator(), | ||||
|   engineCommandManager: EngineCommandManager, | ||||
| @ -493,13 +494,13 @@ export function lexer(str: string): Token[] | Error { | ||||
|  | ||||
| export const modifyAstForSketch = async ( | ||||
|   engineCommandManager: EngineCommandManager, | ||||
|   ast: Program, | ||||
|   ast: UnboxedNode<Program>, | ||||
|   variableName: string, | ||||
|   currentPlane: string, | ||||
|   engineId: string | ||||
| ): Promise<Program> => { | ||||
| ): Promise<UnboxedNode<Program>> => { | ||||
|   try { | ||||
|     const updatedAst: Program = await modify_ast_for_sketch_wasm( | ||||
|     const updatedAst: UnboxedNode<Program> = await modify_ast_for_sketch_wasm( | ||||
|       engineCommandManager, | ||||
|       JSON.stringify(ast), | ||||
|       variableName, | ||||
|  | ||||
| @ -5,6 +5,7 @@ import { Selection } from './selections' | ||||
| import { Identifier, Expr, VariableDeclaration } from 'lang/wasm' | ||||
| import { commandBarMachine } from 'machines/commandBarMachine' | ||||
| import { ReactNode } from 'react' | ||||
| import { UnboxedNode } from 'wasm-lib/kcl/bindings/UnboxedNode' | ||||
|  | ||||
| type Icon = CustomIconName | ||||
| const PLATFORMS = ['both', 'web', 'desktop'] as const | ||||
| @ -23,8 +24,8 @@ export interface KclExpression { | ||||
| } | ||||
| export interface KclExpressionWithVariable extends KclExpression { | ||||
|   variableName: string | ||||
|   variableDeclarationAst: VariableDeclaration | ||||
|   variableIdentifierAst: Identifier | ||||
|   variableDeclarationAst: UnboxedNode<VariableDeclaration> | ||||
|   variableIdentifierAst: UnboxedNode<Identifier> | ||||
|   insertIndex: number | ||||
| } | ||||
| export type KclCommandValue = KclExpression | KclExpressionWithVariable | ||||
|  | ||||
| @ -36,6 +36,7 @@ import { | ||||
|   getWallCodeRef, | ||||
|   ArtifactId, | ||||
| } from 'lang/std/artifactGraph' | ||||
| import { UnboxedNode } from 'wasm-lib/kcl/bindings/UnboxedNode' | ||||
|  | ||||
| export const X_AXIS_UUID = 'ad792545-7fd3-482a-a602-a93924e3055b' | ||||
| export const Y_AXIS_UUID = '680fd157-266f-4b8a-984f-cdf46b8bdf01' | ||||
| @ -244,7 +245,7 @@ export function getEventForSegmentSelection( | ||||
|   const updatedAst = parse(codeManager.code) | ||||
|   if (err(updatedAst)) return null | ||||
|  | ||||
|   const nodeMeta = getNodeFromPath<CallExpression>( | ||||
|   const nodeMeta = getNodeFromPath<UnboxedNode<CallExpression>>( | ||||
|     updatedAst, | ||||
|     pathToNode, | ||||
|     'CallExpression' | ||||
| @ -362,7 +363,7 @@ function updateSceneObjectColors(codeBasedSelections: Selection[]) { | ||||
|  | ||||
|   Object.values(sceneEntitiesManager.activeSegments).forEach((segmentGroup) => { | ||||
|     if (!SEGMENT_BODIES_PLUS_PROFILE_START.includes(segmentGroup?.name)) return | ||||
|     const nodeMeta = getNodeFromPath<CallExpression>( | ||||
|     const nodeMeta = getNodeFromPath<UnboxedNode<CallExpression>>( | ||||
|       updated, | ||||
|       segmentGroup.userData.pathToNode, | ||||
|       'CallExpression' | ||||
|  | ||||
| @ -17,6 +17,7 @@ import { DefaultPlanes } from 'wasm-lib/kcl/bindings/DefaultPlanes' | ||||
| import { err, reportRejection } from 'lib/trap' | ||||
| import { toSync } from './utils' | ||||
| import { IdGenerator } from 'wasm-lib/kcl/bindings/IdGenerator' | ||||
| import { UnboxedNode } from 'wasm-lib/kcl/bindings/UnboxedNode' | ||||
|  | ||||
| type WebSocketResponse = Models['WebSocketResponse_type'] | ||||
|  | ||||
| @ -84,7 +85,7 @@ class MockEngineCommandManager { | ||||
| } | ||||
|  | ||||
| export async function enginelessExecutor( | ||||
|   ast: Program | Error, | ||||
|   ast: UnboxedNode<Program> | Error, | ||||
|   pm: ProgramMemory | Error = ProgramMemory.empty(), | ||||
|   idGenerator: IdGenerator = defaultIdGenerator() | ||||
| ): Promise<ExecState> { | ||||
| @ -109,7 +110,7 @@ export async function enginelessExecutor( | ||||
| } | ||||
|  | ||||
| export async function executor( | ||||
|   ast: Program, | ||||
|   ast: UnboxedNode<Program>, | ||||
|   pm: ProgramMemory = ProgramMemory.empty(), | ||||
|   idGenerator: IdGenerator = defaultIdGenerator() | ||||
| ): Promise<ExecState> { | ||||
|  | ||||
| @ -1,6 +1,6 @@ | ||||
| extern crate alloc; | ||||
| use kcl_lib::ast::types::{ | ||||
|     BodyItem, Expr, Identifier, ItemVisibility, Literal, LiteralValue, NonCodeMeta, Program, VariableDeclaration, | ||||
|     BodyItem, Expr, Identifier, ItemVisibility, Literal, LiteralValue, Program, UnboxedNode, VariableDeclaration, | ||||
|     VariableDeclarator, VariableKind, | ||||
| }; | ||||
| use kcl_macros::parse; | ||||
| @ -9,36 +9,46 @@ use pretty_assertions::assert_eq; | ||||
| #[test] | ||||
| fn basic() { | ||||
|     let actual = parse!("const y = 4"); | ||||
|     let expected = Program { | ||||
|         start: 0, | ||||
|         end: 11, | ||||
|         body: vec![BodyItem::VariableDeclaration(VariableDeclaration { | ||||
|             start: 0, | ||||
|             end: 11, | ||||
|             declarations: vec![VariableDeclarator { | ||||
|                 start: 6, | ||||
|                 end: 11, | ||||
|                 id: Identifier { | ||||
|                     start: 6, | ||||
|                     end: 7, | ||||
|     let expected = UnboxedNode { | ||||
|         inner: Program { | ||||
|             body: vec![BodyItem::VariableDeclaration(UnboxedNode::new( | ||||
|                 VariableDeclaration { | ||||
|                     declarations: vec![UnboxedNode::new( | ||||
|                         VariableDeclarator { | ||||
|                             id: UnboxedNode::new( | ||||
|                                 Identifier { | ||||
|                                     name: "y".to_owned(), | ||||
|                                     digest: None, | ||||
|                                 }, | ||||
|                 init: Expr::Literal(Box::new(Literal { | ||||
|                     start: 10, | ||||
|                     end: 11, | ||||
|                                 6, | ||||
|                                 7, | ||||
|                             ), | ||||
|                             init: Expr::Literal(UnboxedNode::new( | ||||
|                                 Literal { | ||||
|                                     value: LiteralValue::IInteger(4), | ||||
|                                     raw: "4".to_owned(), | ||||
|                                     digest: None, | ||||
|                 })), | ||||
|                                 }, | ||||
|                                 10, | ||||
|                                 11, | ||||
|                             )), | ||||
|                             digest: None, | ||||
|             }], | ||||
|                         }, | ||||
|                         6, | ||||
|                         11, | ||||
|                     )], | ||||
|                     visibility: ItemVisibility::Default, | ||||
|                     kind: VariableKind::Const, | ||||
|                     digest: None, | ||||
|         })], | ||||
|         non_code_meta: NonCodeMeta::default(), | ||||
|                 }, | ||||
|                 0, | ||||
|                 11, | ||||
|             ))], | ||||
|             non_code_meta: Default::default(), | ||||
|             digest: None, | ||||
|         }, | ||||
|         start: 0, | ||||
|         end: 11, | ||||
|     }; | ||||
|     assert_eq!(expected, actual); | ||||
| } | ||||
|  | ||||
| @ -16,6 +16,8 @@ use crate::{ | ||||
|     executor::{Point2d, SourceRange}, | ||||
| }; | ||||
|  | ||||
| use super::types::UnboxedNode; | ||||
|  | ||||
| type Point3d = kcmc::shared::Point3d<f64>; | ||||
|  | ||||
| #[derive(Debug)] | ||||
| @ -35,7 +37,7 @@ const EPSILON: f64 = 0.015625; // or 2^-6 | ||||
| /// a move or a new line. | ||||
| pub async fn modify_ast_for_sketch( | ||||
|     engine: &Arc<Box<dyn EngineManager>>, | ||||
|     program: &mut Program, | ||||
|     program: &mut UnboxedNode<Program>, | ||||
|     // The name of the sketch. | ||||
|     sketch_name: &str, | ||||
|     // The type of plane the sketch is on. `XY` or `XZ`, etc | ||||
| @ -195,7 +197,7 @@ fn create_start_sketch_on( | ||||
|     end: [f64; 2], | ||||
|     plane: crate::executor::PlaneType, | ||||
|     additional_lines: Vec<[f64; 2]>, | ||||
| ) -> Result<VariableDeclarator, KclError> { | ||||
| ) -> Result<UnboxedNode<VariableDeclarator>, KclError> { | ||||
|     let start_sketch_on = CallExpression::new("startSketchOn", vec![Literal::new(plane.to_string().into()).into()])?; | ||||
|     let start_profile_at = CallExpression::new( | ||||
|         "startProfileAt", | ||||
|  | ||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @ -1,9 +1,10 @@ | ||||
| use crate::executor::Metadata; | ||||
| use crate::executor::SourceRange; | ||||
|  | ||||
| use super::impl_value_meta; | ||||
| use super::ConstraintLevel; | ||||
| use super::Hover; | ||||
| use super::Node; | ||||
| use super::NodeList; | ||||
| use super::UnboxedNode; | ||||
| use super::{Digest, Expr}; | ||||
| use databake::*; | ||||
| use schemars::JsonSchema; | ||||
| @ -19,12 +20,10 @@ type IfBlock = crate::ast::types::Program; | ||||
| #[ts(export)] | ||||
| #[serde(tag = "type")] | ||||
| pub struct IfExpression { | ||||
|     pub start: usize, | ||||
|     pub end: usize, | ||||
|     pub cond: Box<Expr>, | ||||
|     pub then_val: Box<IfBlock>, | ||||
|     pub else_ifs: Vec<ElseIf>, | ||||
|     pub final_else: Box<IfBlock>, | ||||
|     pub then_val: Node<IfBlock>, | ||||
|     pub else_ifs: NodeList<ElseIf>, | ||||
|     pub final_else: Node<IfBlock>, | ||||
|  | ||||
|     pub digest: Option<Digest>, | ||||
| } | ||||
| @ -34,57 +33,21 @@ pub struct IfExpression { | ||||
| #[ts(export)] | ||||
| #[serde(tag = "type")] | ||||
| pub struct ElseIf { | ||||
|     pub start: usize, | ||||
|     pub end: usize, | ||||
|     pub cond: Expr, | ||||
|     pub then_val: Box<IfBlock>, | ||||
|     pub then_val: Node<IfBlock>, | ||||
|  | ||||
|     pub digest: Option<Digest>, | ||||
| } | ||||
|  | ||||
| // Source code metadata | ||||
|  | ||||
| impl_value_meta!(IfExpression); | ||||
| impl_value_meta!(ElseIf); | ||||
|  | ||||
| impl IfExpression { | ||||
| impl UnboxedNode<IfExpression> { | ||||
|     fn source_ranges(&self) -> Vec<SourceRange> { | ||||
|         vec![SourceRange::from(self)] | ||||
|     } | ||||
| } | ||||
|  | ||||
| impl From<IfExpression> for Metadata { | ||||
|     fn from(value: IfExpression) -> Self { | ||||
|         Self { | ||||
|             source_range: value.into(), | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
| impl From<ElseIf> for Metadata { | ||||
|     fn from(value: ElseIf) -> Self { | ||||
|         Self { | ||||
|             source_range: value.into(), | ||||
|         } | ||||
|     } | ||||
| } | ||||
| impl From<&IfExpression> for Metadata { | ||||
|     fn from(value: &IfExpression) -> Self { | ||||
|         Self { | ||||
|             source_range: value.into(), | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
| impl From<&ElseIf> for Metadata { | ||||
|     fn from(value: &ElseIf) -> Self { | ||||
|         Self { | ||||
|             source_range: value.into(), | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
| impl ElseIf { | ||||
| impl UnboxedNode<ElseIf> { | ||||
|     #[allow(dead_code)] | ||||
|     fn source_ranges(&self) -> Vec<SourceRange> { | ||||
|         vec![SourceRange([self.start, self.end])] | ||||
| @ -93,6 +56,15 @@ impl ElseIf { | ||||
|  | ||||
| // IDE support and refactors | ||||
|  | ||||
| impl UnboxedNode<IfExpression> { | ||||
|     /// Get the constraint level. | ||||
|     pub fn get_constraint_level(&self) -> ConstraintLevel { | ||||
|         ConstraintLevel::Full { | ||||
|             source_ranges: self.source_ranges(), | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
| impl IfExpression { | ||||
|     pub fn get_hover_value_for_position(&self, pos: usize, code: &str) -> Option<Hover> { | ||||
|         self.cond | ||||
| @ -115,12 +87,7 @@ impl IfExpression { | ||||
|         } | ||||
|         self.final_else.rename_identifiers(old_name, new_name); | ||||
|     } | ||||
|     /// Get the constraint level. | ||||
|     pub fn get_constraint_level(&self) -> ConstraintLevel { | ||||
|         ConstraintLevel::Full { | ||||
|             source_ranges: self.source_ranges(), | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     pub fn replace_value(&mut self, source_range: SourceRange, new_value: Expr) { | ||||
|         self.cond.replace_value(source_range, new_value.clone()); | ||||
|         for else_if in &mut self.else_ifs { | ||||
|  | ||||
| @ -1,7 +1,7 @@ | ||||
| use super::{ | ||||
|     human_friendly_type, ArrayExpression, ArrayRangeExpression, BinaryExpression, BinaryOperator, BinaryPart, | ||||
|     CallExpression, Expr, IfExpression, LiteralIdentifier, LiteralValue, MemberExpression, MemberObject, | ||||
|     ObjectExpression, TagDeclarator, UnaryExpression, UnaryOperator, | ||||
|     ObjectExpression, TagDeclarator, UnaryExpression, UnaryOperator, UnboxedNode, | ||||
| }; | ||||
| use crate::{ | ||||
|     errors::{KclError, KclErrorDetails}, | ||||
| @ -32,7 +32,7 @@ impl BinaryPart { | ||||
|     } | ||||
| } | ||||
|  | ||||
| impl MemberExpression { | ||||
| impl UnboxedNode<MemberExpression> { | ||||
|     pub fn get_result_array(&self, exec_state: &mut ExecState, index: usize) -> Result<KclValue, KclError> { | ||||
|         let array = match &self.object { | ||||
|             MemberObject::MemberExpression(member_expr) => member_expr.get_result(exec_state)?, | ||||
| @ -137,7 +137,7 @@ impl MemberExpression { | ||||
|     } | ||||
| } | ||||
|  | ||||
| impl BinaryExpression { | ||||
| impl UnboxedNode<BinaryExpression> { | ||||
|     #[async_recursion] | ||||
|     pub async fn get_result(&self, exec_state: &mut ExecState, ctx: &ExecutorContext) -> Result<KclValue, KclError> { | ||||
|         let left_json_value = self.left.get_result(exec_state, ctx).await?.get_json_value()?; | ||||
| @ -186,7 +186,7 @@ impl BinaryExpression { | ||||
|     } | ||||
| } | ||||
|  | ||||
| impl UnaryExpression { | ||||
| impl UnboxedNode<UnaryExpression> { | ||||
|     pub async fn get_result(&self, exec_state: &mut ExecState, ctx: &ExecutorContext) -> Result<KclValue, KclError> { | ||||
|         if self.operator == UnaryOperator::Not { | ||||
|             let value = self.argument.get_result(exec_state, ctx).await?.get_json_value()?; | ||||
| @ -297,7 +297,7 @@ async fn inner_execute_pipe_body( | ||||
|     Ok(final_output) | ||||
| } | ||||
|  | ||||
| impl CallExpression { | ||||
| impl UnboxedNode<CallExpression> { | ||||
|     #[async_recursion] | ||||
|     pub async fn execute(&self, exec_state: &mut ExecState, ctx: &ExecutorContext) -> Result<KclValue, KclError> { | ||||
|         let fn_name = &self.callee.name; | ||||
| @ -502,7 +502,7 @@ impl CallExpression { | ||||
|     } | ||||
| } | ||||
|  | ||||
| impl TagDeclarator { | ||||
| impl UnboxedNode<TagDeclarator> { | ||||
|     pub async fn execute(&self, exec_state: &mut ExecState) -> Result<KclValue, KclError> { | ||||
|         let memory_item = KclValue::TagIdentifier(Box::new(TagIdentifier { | ||||
|             value: self.name.clone(), | ||||
| @ -518,7 +518,7 @@ impl TagDeclarator { | ||||
|     } | ||||
| } | ||||
|  | ||||
| impl ArrayExpression { | ||||
| impl UnboxedNode<ArrayExpression> { | ||||
|     #[async_recursion] | ||||
|     pub async fn execute(&self, exec_state: &mut ExecState, ctx: &ExecutorContext) -> Result<KclValue, KclError> { | ||||
|         let mut results = Vec::with_capacity(self.elements.len()); | ||||
| @ -543,21 +543,21 @@ impl ArrayExpression { | ||||
|     } | ||||
| } | ||||
|  | ||||
| impl ArrayRangeExpression { | ||||
| impl UnboxedNode<ArrayRangeExpression> { | ||||
|     #[async_recursion] | ||||
|     pub async fn execute(&self, exec_state: &mut ExecState, ctx: &ExecutorContext) -> Result<KclValue, KclError> { | ||||
|         let metadata = Metadata::from(&*self.start_element); | ||||
|         let metadata = Metadata::from(&self.start_element); | ||||
|         let start = ctx | ||||
|             .execute_expr(&self.start_element, exec_state, &metadata, StatementKind::Expression) | ||||
|             .await? | ||||
|             .get_json_value()?; | ||||
|         let start = parse_json_number_as_u64(&start, (&*self.start_element).into())?; | ||||
|         let metadata = Metadata::from(&*self.end_element); | ||||
|         let start = parse_json_number_as_u64(&start, (&self.start_element).into())?; | ||||
|         let metadata = Metadata::from(&self.end_element); | ||||
|         let end = ctx | ||||
|             .execute_expr(&self.end_element, exec_state, &metadata, StatementKind::Expression) | ||||
|             .await? | ||||
|             .get_json_value()?; | ||||
|         let end = parse_json_number_as_u64(&end, (&*self.end_element).into())?; | ||||
|         let end = parse_json_number_as_u64(&end, (&self.end_element).into())?; | ||||
|  | ||||
|         if end < start { | ||||
|             return Err(KclError::Semantic(KclErrorDetails { | ||||
| @ -581,7 +581,7 @@ impl ArrayRangeExpression { | ||||
|     } | ||||
| } | ||||
|  | ||||
| impl ObjectExpression { | ||||
| impl UnboxedNode<ObjectExpression> { | ||||
|     #[async_recursion] | ||||
|     pub async fn execute(&self, exec_state: &mut ExecState, ctx: &ExecutorContext) -> Result<KclValue, KclError> { | ||||
|         let mut object = serde_json::Map::new(); | ||||
| @ -655,7 +655,7 @@ pub fn json_as_bool(j: &serde_json::Value) -> Option<bool> { | ||||
|     } | ||||
| } | ||||
|  | ||||
| impl IfExpression { | ||||
| impl UnboxedNode<IfExpression> { | ||||
|     #[async_recursion] | ||||
|     pub async fn get_result(&self, exec_state: &mut ExecState, ctx: &ExecutorContext) -> Result<KclValue, KclError> { | ||||
|         // Check the `if` branch. | ||||
| @ -717,7 +717,7 @@ impl Property { | ||||
|         let property_src: SourceRange = value.clone().into(); | ||||
|         match value { | ||||
|             LiteralIdentifier::Identifier(identifier) => { | ||||
|                 let name = identifier.name; | ||||
|                 let name = &identifier.name; | ||||
|                 if !computed { | ||||
|                     // Treat the property as a literal | ||||
|                     Ok(Property::String(name.to_string())) | ||||
|  | ||||
| @ -5,6 +5,8 @@ use serde_json::Value as JValue; | ||||
|  | ||||
| use crate::ast::types::{Expr, Literal}; | ||||
|  | ||||
| use super::UnboxedNode; | ||||
|  | ||||
| #[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema, Bake)] | ||||
| #[databake(path = kcl_lib::ast::types)] | ||||
| #[ts(export)] | ||||
| @ -33,9 +35,9 @@ impl LiteralValue { | ||||
|     } | ||||
| } | ||||
|  | ||||
| impl From<Literal> for Expr { | ||||
|     fn from(literal: Literal) -> Self { | ||||
|         Expr::Literal(Box::new(literal)) | ||||
| impl From<UnboxedNode<Literal>> for Expr { | ||||
|     fn from(literal: UnboxedNode<Literal>) -> Self { | ||||
|         Expr::Literal(literal) | ||||
|     } | ||||
| } | ||||
|  | ||||
|  | ||||
| @ -26,8 +26,8 @@ type Point3D = kcmc::shared::Point3d<f64>; | ||||
|  | ||||
| use crate::{ | ||||
|     ast::types::{ | ||||
|         human_friendly_type, BodyItem, Expr, ExpressionStatement, FunctionExpression, ImportStatement, ItemVisibility, | ||||
|         KclNone, Program, ReturnStatement, TagDeclarator, | ||||
|         human_friendly_type, BodyItem, Expr, FunctionExpression, ItemVisibility, KclNone, NodeRef, Program, | ||||
|         TagDeclarator, TagNode, UnboxedNode, | ||||
|     }, | ||||
|     engine::{EngineManager, ExecutionKind}, | ||||
|     errors::{KclError, KclErrorDetails}, | ||||
| @ -339,7 +339,7 @@ impl IdGenerator { | ||||
| pub enum KclValue { | ||||
|     UserVal(UserVal), | ||||
|     TagIdentifier(Box<TagIdentifier>), | ||||
|     TagDeclarator(Box<TagDeclarator>), | ||||
|     TagDeclarator(crate::ast::types::Node<TagDeclarator>), | ||||
|     Plane(Box<Plane>), | ||||
|     Face(Box<Face>), | ||||
|  | ||||
| @ -352,7 +352,7 @@ pub enum KclValue { | ||||
|     Function { | ||||
|         #[serde(skip)] | ||||
|         func: Option<MemoryFunction>, | ||||
|         expression: Box<FunctionExpression>, | ||||
|         expression: crate::ast::types::Node<FunctionExpression>, | ||||
|         memory: Box<ProgramMemory>, | ||||
|         #[serde(rename = "__meta")] | ||||
|         meta: Vec<Metadata>, | ||||
| @ -890,7 +890,7 @@ pub type MemoryFunction = | ||||
|     fn( | ||||
|         s: Vec<KclValue>, | ||||
|         memory: ProgramMemory, | ||||
|         expression: Box<FunctionExpression>, | ||||
|         expression: crate::ast::types::Node<FunctionExpression>, | ||||
|         metadata: Vec<Metadata>, | ||||
|         exec_state: &ExecState, | ||||
|         ctx: ExecutorContext, | ||||
| @ -900,7 +900,7 @@ impl From<KclValue> for Vec<SourceRange> { | ||||
|     fn from(item: KclValue) -> Self { | ||||
|         match item { | ||||
|             KclValue::UserVal(u) => u.meta.iter().map(|m| m.source_range).collect(), | ||||
|             KclValue::TagDeclarator(t) => t.into(), | ||||
|             KclValue::TagDeclarator(t) => vec![(&t).into()], | ||||
|             KclValue::TagIdentifier(t) => t.meta.iter().map(|m| m.source_range).collect(), | ||||
|             KclValue::Solid(e) => e.meta.iter().map(|m| m.source_range).collect(), | ||||
|             KclValue::Solids { value } => value | ||||
| @ -1043,9 +1043,9 @@ impl KclValue { | ||||
|     } | ||||
|  | ||||
|     /// Get a tag declarator from a memory item. | ||||
|     pub fn get_tag_declarator(&self) -> Result<TagDeclarator, KclError> { | ||||
|     pub fn get_tag_declarator(&self) -> Result<TagNode, KclError> { | ||||
|         match self { | ||||
|             KclValue::TagDeclarator(t) => Ok(*t.clone()), | ||||
|             KclValue::TagDeclarator(t) => Ok((**t).clone()), | ||||
|             _ => Err(KclError::Semantic(KclErrorDetails { | ||||
|                 message: format!("Not a tag declarator: {:?}", self), | ||||
|                 source_ranges: self.clone().into(), | ||||
| @ -1054,9 +1054,9 @@ impl KclValue { | ||||
|     } | ||||
|  | ||||
|     /// Get an optional tag from a memory item. | ||||
|     pub fn get_tag_declarator_opt(&self) -> Result<Option<TagDeclarator>, KclError> { | ||||
|     pub fn get_tag_declarator_opt(&self) -> Result<Option<TagNode>, KclError> { | ||||
|         match self { | ||||
|             KclValue::TagDeclarator(t) => Ok(Some(*t.clone())), | ||||
|             KclValue::TagDeclarator(t) => Ok(Some((**t).clone())), | ||||
|             _ => Err(KclError::Semantic(KclErrorDetails { | ||||
|                 message: format!("Not a tag declarator: {:?}", self), | ||||
|                 source_ranges: self.clone().into(), | ||||
| @ -1200,7 +1200,7 @@ pub struct GetTangentialInfoFromPathsResult { | ||||
| } | ||||
|  | ||||
| impl Sketch { | ||||
|     pub(crate) fn add_tag(&mut self, tag: &TagDeclarator, current_path: &Path) { | ||||
|     pub(crate) fn add_tag(&mut self, tag: NodeRef<'_, TagDeclarator>, current_path: &Path) { | ||||
|         let mut tag_identifier: TagIdentifier = tag.into(); | ||||
|         let base = current_path.get_base(); | ||||
|         tag_identifier.info = Some(TagEngineInfo { | ||||
| @ -1326,7 +1326,7 @@ pub enum EdgeCut { | ||||
|         /// The engine id of the edge to fillet. | ||||
|         #[serde(rename = "edgeId")] | ||||
|         edge_id: uuid::Uuid, | ||||
|         tag: Box<Option<TagDeclarator>>, | ||||
|         tag: Box<Option<TagNode>>, | ||||
|     }, | ||||
|     /// A chamfer. | ||||
|     Chamfer { | ||||
| @ -1336,7 +1336,7 @@ pub enum EdgeCut { | ||||
|         /// The engine id of the edge to chamfer. | ||||
|         #[serde(rename = "edgeId")] | ||||
|         edge_id: uuid::Uuid, | ||||
|         tag: Box<Option<TagDeclarator>>, | ||||
|         tag: Box<Option<TagNode>>, | ||||
|     }, | ||||
| } | ||||
|  | ||||
| @ -1355,7 +1355,7 @@ impl EdgeCut { | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     pub fn tag(&self) -> Option<TagDeclarator> { | ||||
|     pub fn tag(&self) -> Option<TagNode> { | ||||
|         match self { | ||||
|             EdgeCut::Fillet { tag, .. } => *tag.clone(), | ||||
|             EdgeCut::Chamfer { tag, .. } => *tag.clone(), | ||||
| @ -1529,26 +1529,10 @@ impl From<SourceRange> for Metadata { | ||||
|     } | ||||
| } | ||||
|  | ||||
| impl From<&ImportStatement> for Metadata { | ||||
|     fn from(stmt: &ImportStatement) -> Self { | ||||
| impl<T> From<NodeRef<'_, T>> for Metadata { | ||||
|     fn from(node: NodeRef<'_, T>) -> Self { | ||||
|         Self { | ||||
|             source_range: SourceRange::new(stmt.start, stmt.end), | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
| impl From<&ExpressionStatement> for Metadata { | ||||
|     fn from(exp_statement: &ExpressionStatement) -> Self { | ||||
|         Self { | ||||
|             source_range: SourceRange::new(exp_statement.start, exp_statement.end), | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
| impl From<&ReturnStatement> for Metadata { | ||||
|     fn from(return_statement: &ReturnStatement) -> Self { | ||||
|         Self { | ||||
|             source_range: SourceRange::new(return_statement.start, return_statement.end), | ||||
|             source_range: SourceRange::new(node.start, node.end), | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @ -1573,7 +1557,7 @@ pub struct BasePath { | ||||
|     #[ts(type = "[number, number]")] | ||||
|     pub to: [f64; 2], | ||||
|     /// The tag of the path. | ||||
|     pub tag: Option<TagDeclarator>, | ||||
|     pub tag: Option<TagNode>, | ||||
|     /// Metadata. | ||||
|     #[serde(rename = "__geoMeta")] | ||||
|     pub geo_meta: GeoMeta, | ||||
| @ -1671,7 +1655,7 @@ impl Path { | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     pub fn get_tag(&self) -> Option<TagDeclarator> { | ||||
|     pub fn get_tag(&self) -> Option<TagNode> { | ||||
|         match self { | ||||
|             Path::ToPoint { base } => base.tag.clone(), | ||||
|             Path::Horizontal { base, .. } => base.tag.clone(), | ||||
| @ -1728,7 +1712,7 @@ pub struct ChamferSurface { | ||||
|     /// The id for the chamfer surface. | ||||
|     pub face_id: uuid::Uuid, | ||||
|     /// The tag. | ||||
|     pub tag: Option<TagDeclarator>, | ||||
|     pub tag: Option<UnboxedNode<TagDeclarator>>, | ||||
|     /// Metadata. | ||||
|     #[serde(flatten)] | ||||
|     pub geo_meta: GeoMeta, | ||||
| @ -1742,7 +1726,7 @@ pub struct FilletSurface { | ||||
|     /// The id for the fillet surface. | ||||
|     pub face_id: uuid::Uuid, | ||||
|     /// The tag. | ||||
|     pub tag: Option<TagDeclarator>, | ||||
|     pub tag: Option<UnboxedNode<TagDeclarator>>, | ||||
|     /// Metadata. | ||||
|     #[serde(flatten)] | ||||
|     pub geo_meta: GeoMeta, | ||||
| @ -1756,7 +1740,7 @@ pub struct ExtrudePlane { | ||||
|     /// The face id for the extrude plane. | ||||
|     pub face_id: uuid::Uuid, | ||||
|     /// The tag. | ||||
|     pub tag: Option<TagDeclarator>, | ||||
|     pub tag: Option<UnboxedNode<TagDeclarator>>, | ||||
|     /// Metadata. | ||||
|     #[serde(flatten)] | ||||
|     pub geo_meta: GeoMeta, | ||||
| @ -1770,7 +1754,7 @@ pub struct ExtrudeArc { | ||||
|     /// The face id for the extrude plane. | ||||
|     pub face_id: uuid::Uuid, | ||||
|     /// The tag. | ||||
|     pub tag: Option<TagDeclarator>, | ||||
|     pub tag: Option<UnboxedNode<TagDeclarator>>, | ||||
|     /// Metadata. | ||||
|     #[serde(flatten)] | ||||
|     pub geo_meta: GeoMeta, | ||||
| @ -1786,7 +1770,7 @@ impl ExtrudeSurface { | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     pub fn get_tag(&self) -> Option<TagDeclarator> { | ||||
|     pub fn get_tag(&self) -> Option<UnboxedNode<TagDeclarator>> { | ||||
|         match self { | ||||
|             ExtrudeSurface::ExtrudePlane(ep) => ep.tag.clone(), | ||||
|             ExtrudeSurface::ExtrudeArc(ea) => ea.tag.clone(), | ||||
| @ -1997,7 +1981,7 @@ impl ExecutorContext { | ||||
|     /// Kurt uses this for partial execution. | ||||
|     pub async fn run( | ||||
|         &self, | ||||
|         program: &crate::ast::types::Program, | ||||
|         program: NodeRef<'_, crate::ast::types::Program>, | ||||
|         memory: Option<ProgramMemory>, | ||||
|         id_generator: IdGenerator, | ||||
|         project_directory: Option<String>, | ||||
| @ -2011,7 +1995,7 @@ impl ExecutorContext { | ||||
|     /// Kurt uses this for partial execution. | ||||
|     pub async fn run_with_session_data( | ||||
|         &self, | ||||
|         program: &crate::ast::types::Program, | ||||
|         program: NodeRef<'_, crate::ast::types::Program>, | ||||
|         memory: Option<ProgramMemory>, | ||||
|         id_generator: IdGenerator, | ||||
|         project_directory: Option<String>, | ||||
| @ -2053,9 +2037,9 @@ impl ExecutorContext { | ||||
|  | ||||
|     /// Execute an AST's program. | ||||
|     #[async_recursion] | ||||
|     pub(crate) async fn inner_execute( | ||||
|         &self, | ||||
|         program: &crate::ast::types::Program, | ||||
|     pub(crate) async fn inner_execute<'a>( | ||||
|         &'a self, | ||||
|         program: NodeRef<'a, crate::ast::types::Program>, | ||||
|         exec_state: &mut ExecState, | ||||
|         body_type: BodyType, | ||||
|     ) -> Result<Option<KclValue>, KclError> { | ||||
| @ -2291,7 +2275,7 @@ impl ExecutorContext { | ||||
|     /// Execute the program, then get a PNG screenshot. | ||||
|     pub async fn execute_and_prepare_snapshot( | ||||
|         &self, | ||||
|         program: &Program, | ||||
|         program: NodeRef<'_, Program>, | ||||
|         id_generator: IdGenerator, | ||||
|         project_directory: Option<String>, | ||||
|     ) -> Result<TakeSnapshot> { | ||||
| @ -2336,7 +2320,7 @@ impl ExecutorContext { | ||||
| /// assign it to a parameter of the function, in the given block of function memory. | ||||
| /// Returns Err if too few/too many arguments were given for the function. | ||||
| fn assign_args_to_params( | ||||
|     function_expression: &FunctionExpression, | ||||
|     function_expression: NodeRef<'_, FunctionExpression>, | ||||
|     args: Vec<KclValue>, | ||||
|     mut fn_memory: ProgramMemory, | ||||
| ) -> Result<ProgramMemory, KclError> { | ||||
| @ -2388,7 +2372,7 @@ fn assign_args_to_params( | ||||
| pub(crate) async fn call_user_defined_function( | ||||
|     args: Vec<KclValue>, | ||||
|     memory: &ProgramMemory, | ||||
|     function_expression: &FunctionExpression, | ||||
|     function_expression: NodeRef<'_, FunctionExpression>, | ||||
|     exec_state: &mut ExecState, | ||||
|     ctx: &ExecutorContext, | ||||
| ) -> Result<Option<KclValue>, KclError> { | ||||
| @ -2427,7 +2411,7 @@ mod tests { | ||||
|     use pretty_assertions::assert_eq; | ||||
|  | ||||
|     use super::*; | ||||
|     use crate::ast::types::{Identifier, Parameter}; | ||||
|     use crate::ast::types::{Identifier, Parameter, UnboxedNode}; | ||||
|  | ||||
|     pub async fn parse_execute(code: &str) -> Result<ProgramMemory> { | ||||
|         let tokens = crate::token::lexer(code)?; | ||||
| @ -3399,13 +3383,11 @@ let w = f() + f() | ||||
|                 meta: Default::default(), | ||||
|             }) | ||||
|         } | ||||
|         fn ident(s: &'static str) -> Identifier { | ||||
|             Identifier { | ||||
|                 start: 0, | ||||
|                 end: 0, | ||||
|         fn ident(s: &'static str) -> UnboxedNode<Identifier> { | ||||
|             UnboxedNode::no_src(Identifier { | ||||
|                 name: s.to_owned(), | ||||
|                 digest: None, | ||||
|             } | ||||
|             }) | ||||
|         } | ||||
|         fn opt_param(s: &'static str) -> Parameter { | ||||
|             Parameter { | ||||
| @ -3497,20 +3479,20 @@ let w = f() + f() | ||||
|             ), | ||||
|         ] { | ||||
|             // Run each test. | ||||
|             let func_expr = &FunctionExpression { | ||||
|                 start: 0, | ||||
|                 end: 0, | ||||
|             let func_expr = &UnboxedNode::no_src(FunctionExpression { | ||||
|                 params, | ||||
|                 body: crate::ast::types::Program { | ||||
|                     start: 0, | ||||
|                     end: 0, | ||||
|                 body: UnboxedNode { | ||||
|                     inner: crate::ast::types::Program { | ||||
|                         body: Vec::new(), | ||||
|                         non_code_meta: Default::default(), | ||||
|                         digest: None, | ||||
|                     }, | ||||
|                     start: 0, | ||||
|                     end: 0, | ||||
|                 }, | ||||
|                 return_type: None, | ||||
|                 digest: None, | ||||
|             }; | ||||
|             }); | ||||
|             let actual = assign_args_to_params(func_expr, args, ProgramMemory::new()); | ||||
|             assert_eq!( | ||||
|                 actual, expected, | ||||
|  | ||||
| @ -13,7 +13,7 @@ use crate::{ | ||||
| pub struct FunctionParam<'a> { | ||||
|     pub inner: Option<&'a MemoryFunction>, | ||||
|     pub memory: ProgramMemory, | ||||
|     pub fn_expr: Box<FunctionExpression>, | ||||
|     pub fn_expr: crate::ast::types::Node<FunctionExpression>, | ||||
|     pub meta: Vec<Metadata>, | ||||
|     pub ctx: ExecutorContext, | ||||
| } | ||||
|  | ||||
| @ -3,7 +3,7 @@ use std::sync::Arc; | ||||
| use anyhow::Result; | ||||
|  | ||||
| use crate::{ | ||||
|     ast::types::CallExpression, | ||||
|     ast::types::{CallExpression, NodeRef}, | ||||
|     docs::StdLibFn, | ||||
|     executor::SourceRange, | ||||
|     lint::rule::{def_finding, Discovered, Finding}, | ||||
| @ -18,7 +18,10 @@ def_finding!( | ||||
| Previously, we have not been failing when too many arguments are passed to a stdlib function. This is a problem because it can lead to unexpected behavior. We will in the future fail when too many arguments are passed to a function. So fix your code now." | ||||
| ); | ||||
|  | ||||
| fn lint_too_many_args_std_lib_function(f: Box<dyn StdLibFn>, exp: &CallExpression) -> Result<Vec<Discovered>> { | ||||
| fn lint_too_many_args_std_lib_function( | ||||
|     f: Box<dyn StdLibFn>, | ||||
|     exp: NodeRef<'_, CallExpression>, | ||||
| ) -> Result<Vec<Discovered>> { | ||||
|     let mut findings = vec![]; | ||||
|  | ||||
|     if f.name() == "pow" { | ||||
|  | ||||
| @ -3,14 +3,14 @@ | ||||
| use serde::{Deserialize, Serialize}; | ||||
| use tower_lsp::lsp_types::notification::Notification; | ||||
|  | ||||
| use crate::settings::types::UnitLength; | ||||
| use crate::{ast::types::UnboxedNode, settings::types::UnitLength}; | ||||
|  | ||||
| /// A notification that the AST has changed. | ||||
| #[derive(Debug)] | ||||
| pub enum AstUpdated {} | ||||
|  | ||||
| impl Notification for AstUpdated { | ||||
|     type Params = crate::ast::types::Program; | ||||
|     type Params = UnboxedNode<crate::ast::types::Program>; | ||||
|     const METHOD: &'static str = "kcl/astUpdated"; | ||||
| } | ||||
|  | ||||
|  | ||||
| @ -40,7 +40,7 @@ use tower_lsp::{ | ||||
| }; | ||||
|  | ||||
| use crate::{ | ||||
|     ast::types::{Expr, VariableKind}, | ||||
|     ast::types::{Expr, NodeRef, UnboxedNode, VariableKind}, | ||||
|     executor::{IdGenerator, SourceRange}, | ||||
|     lsp::{backend::Backend as _, util::IntoDiagnostic}, | ||||
|     parser::PIPE_OPERATOR, | ||||
| @ -99,7 +99,7 @@ pub struct Backend { | ||||
|     /// Token maps. | ||||
|     pub token_map: DashMap<String, Vec<crate::token::Token>>, | ||||
|     /// AST maps. | ||||
|     pub ast_map: DashMap<String, crate::ast::types::Program>, | ||||
|     pub ast_map: DashMap<String, UnboxedNode<crate::ast::types::Program>>, | ||||
|     /// Memory maps. | ||||
|     pub memory_map: DashMap<String, crate::executor::ProgramMemory>, | ||||
|     /// Current code. | ||||
| @ -571,7 +571,7 @@ impl Backend { | ||||
|         self.client.publish_diagnostics(params.uri.clone(), items, None).await; | ||||
|     } | ||||
|  | ||||
|     async fn execute(&self, params: &TextDocumentItem, ast: &crate::ast::types::Program) -> Result<()> { | ||||
|     async fn execute(&self, params: &TextDocumentItem, ast: NodeRef<'_, crate::ast::types::Program>) -> Result<()> { | ||||
|         // Check if we can execute. | ||||
|         if !self.can_execute().await { | ||||
|             return Ok(()); | ||||
|  | ||||
| @ -7,6 +7,7 @@ use tower_lsp::{ | ||||
| }; | ||||
|  | ||||
| use crate::{ | ||||
|     ast::types::{Program, UnboxedNode}, | ||||
|     executor::ProgramMemory, | ||||
|     lsp::test_util::{copilot_lsp_server, kcl_lsp_server}, | ||||
| }; | ||||
| @ -1070,7 +1071,7 @@ fn myFn = (param1) => { | ||||
|  | ||||
|     // Get the ast. | ||||
|     let ast = server.ast_map.get("file:///test.kcl").unwrap().clone(); | ||||
|     assert!(ast != crate::ast::types::Program::default()); | ||||
|     assert!(ast != UnboxedNode::<Program>::default()); | ||||
|  | ||||
|     // Send semantic tokens request. | ||||
|     let semantic_tokens = server | ||||
| @ -2396,7 +2397,7 @@ async fn kcl_test_kcl_lsp_full_to_empty_file_updates_ast_and_memory() { | ||||
|  | ||||
|     // Get the ast. | ||||
|     let ast = server.ast_map.get("file:///test.kcl").unwrap().clone(); | ||||
|     assert!(ast != crate::ast::types::Program::default()); | ||||
|     assert!(ast != UnboxedNode::<Program>::default()); | ||||
|     // Get the memory. | ||||
|     let memory = server.memory_map.get("file:///test.kcl").unwrap().clone(); | ||||
|     assert!(memory != ProgramMemory::default()); | ||||
| @ -2416,7 +2417,7 @@ async fn kcl_test_kcl_lsp_full_to_empty_file_updates_ast_and_memory() { | ||||
|         }) | ||||
|         .await; | ||||
|  | ||||
|     let mut default_hashed = crate::ast::types::Program::default(); | ||||
|     let mut default_hashed = UnboxedNode::<Program>::default(); | ||||
|     default_hashed.compute_digest(); | ||||
|  | ||||
|     // Get the ast. | ||||
| @ -2453,7 +2454,7 @@ async fn kcl_test_kcl_lsp_code_unchanged_but_has_diagnostics_reexecute() { | ||||
|  | ||||
|     // Get the ast. | ||||
|     let ast = server.ast_map.get("file:///test.kcl").unwrap().clone(); | ||||
|     assert!(ast != crate::ast::types::Program::default()); | ||||
|     assert!(ast != UnboxedNode::<Program>::default()); | ||||
|     // Get the memory. | ||||
|     let memory = server.memory_map.get("file:///test.kcl").unwrap().clone(); | ||||
|     assert!(memory != ProgramMemory::default()); | ||||
| @ -2487,9 +2488,9 @@ async fn kcl_test_kcl_lsp_code_unchanged_but_has_diagnostics_reexecute() { | ||||
|     // Clear the ast and memory. | ||||
|     server | ||||
|         .ast_map | ||||
|         .insert("file:///test.kcl".to_string(), crate::ast::types::Program::default()); | ||||
|         .insert("file:///test.kcl".to_string(), UnboxedNode::<Program>::default()); | ||||
|     let ast = server.ast_map.get("file:///test.kcl").unwrap().clone(); | ||||
|     assert_eq!(ast, crate::ast::types::Program::default()); | ||||
|     assert_eq!(ast, UnboxedNode::<Program>::default()); | ||||
|     server | ||||
|         .memory_map | ||||
|         .insert("file:///test.kcl".to_string(), ProgramMemory::default()); | ||||
| @ -2513,7 +2514,7 @@ async fn kcl_test_kcl_lsp_code_unchanged_but_has_diagnostics_reexecute() { | ||||
|  | ||||
|     // Get the ast. | ||||
|     let ast = server.ast_map.get("file:///test.kcl").unwrap().clone(); | ||||
|     assert!(ast != crate::ast::types::Program::default()); | ||||
|     assert!(ast != UnboxedNode::<Program>::default()); | ||||
|     // Get the memory. | ||||
|     let memory = server.memory_map.get("file:///test.kcl").unwrap().clone(); | ||||
|     assert!(memory != ProgramMemory::default()); | ||||
| @ -2549,7 +2550,7 @@ async fn kcl_test_kcl_lsp_code_and_ast_unchanged_but_has_diagnostics_reexecute() | ||||
|  | ||||
|     // Get the ast. | ||||
|     let ast = server.ast_map.get("file:///test.kcl").unwrap().clone(); | ||||
|     assert!(ast != crate::ast::types::Program::default()); | ||||
|     assert!(ast != UnboxedNode::<Program>::default()); | ||||
|     // Get the memory. | ||||
|     let memory = server.memory_map.get("file:///test.kcl").unwrap().clone(); | ||||
|     assert!(memory != ProgramMemory::default()); | ||||
| @ -2604,7 +2605,7 @@ async fn kcl_test_kcl_lsp_code_and_ast_unchanged_but_has_diagnostics_reexecute() | ||||
|  | ||||
|     // Get the ast. | ||||
|     let ast = server.ast_map.get("file:///test.kcl").unwrap().clone(); | ||||
|     assert!(ast != crate::ast::types::Program::default()); | ||||
|     assert!(ast != UnboxedNode::<Program>::default()); | ||||
|     // Get the memory. | ||||
|     let memory = server.memory_map.get("file:///test.kcl").unwrap().clone(); | ||||
|     assert!(memory != ProgramMemory::default()); | ||||
| @ -2640,7 +2641,7 @@ async fn kcl_test_kcl_lsp_code_and_ast_units_unchanged_but_has_diagnostics_reexe | ||||
|  | ||||
|     // Get the ast. | ||||
|     let ast = server.ast_map.get("file:///test.kcl").unwrap().clone(); | ||||
|     assert!(ast != crate::ast::types::Program::default()); | ||||
|     assert!(ast != UnboxedNode::<Program>::default()); | ||||
|     // Get the memory. | ||||
|     let memory = server.memory_map.get("file:///test.kcl").unwrap().clone(); | ||||
|     assert!(memory != ProgramMemory::default()); | ||||
| @ -2698,7 +2699,7 @@ async fn kcl_test_kcl_lsp_code_and_ast_units_unchanged_but_has_diagnostics_reexe | ||||
|  | ||||
|     // Get the ast. | ||||
|     let ast = server.ast_map.get("file:///test.kcl").unwrap().clone(); | ||||
|     assert!(ast != crate::ast::types::Program::default()); | ||||
|     assert!(ast != UnboxedNode::<Program>::default()); | ||||
|     // Get the memory. | ||||
|     let memory = server.memory_map.get("file:///test.kcl").unwrap().clone(); | ||||
|     assert!(memory != ProgramMemory::default()); | ||||
| @ -2734,7 +2735,7 @@ async fn kcl_test_kcl_lsp_code_and_ast_units_unchanged_but_has_memory_reexecute_ | ||||
|  | ||||
|     // Get the ast. | ||||
|     let ast = server.ast_map.get("file:///test.kcl").unwrap().clone(); | ||||
|     assert!(ast != crate::ast::types::Program::default()); | ||||
|     assert!(ast != UnboxedNode::<Program>::default()); | ||||
|     // Get the memory. | ||||
|     let memory = server.memory_map.get("file:///test.kcl").unwrap().clone(); | ||||
|     assert!(memory != ProgramMemory::default()); | ||||
| @ -2770,7 +2771,7 @@ async fn kcl_test_kcl_lsp_code_and_ast_units_unchanged_but_has_memory_reexecute_ | ||||
|  | ||||
|     // Get the ast. | ||||
|     let ast = server.ast_map.get("file:///test.kcl").unwrap().clone(); | ||||
|     assert!(ast != crate::ast::types::Program::default()); | ||||
|     assert!(ast != UnboxedNode::<Program>::default()); | ||||
|     // Get the memory. | ||||
|     let memory = server.memory_map.get("file:///test.kcl").unwrap().clone(); | ||||
|     assert!(memory != ProgramMemory::default()); | ||||
| @ -2806,7 +2807,7 @@ async fn kcl_test_kcl_lsp_cant_execute_set() { | ||||
|  | ||||
|     // Get the ast. | ||||
|     let ast = server.ast_map.get("file:///test.kcl").unwrap().clone(); | ||||
|     assert!(ast != crate::ast::types::Program::default()); | ||||
|     assert!(ast != UnboxedNode::<Program>::default()); | ||||
|     // Get the memory. | ||||
|     let memory = server.memory_map.get("file:///test.kcl").unwrap().clone(); | ||||
|     assert!(memory != ProgramMemory::default()); | ||||
| @ -2841,7 +2842,7 @@ async fn kcl_test_kcl_lsp_cant_execute_set() { | ||||
|  | ||||
|     // Get the ast. | ||||
|     let ast = server.ast_map.get("file:///test.kcl").unwrap().clone(); | ||||
|     assert!(ast != crate::ast::types::Program::default()); | ||||
|     assert!(ast != UnboxedNode::<Program>::default()); | ||||
|     // Get the memory. | ||||
|     let memory = server.memory_map.get("file:///test.kcl").unwrap().clone(); | ||||
|     assert!(memory != ProgramMemory::default()); | ||||
| @ -2883,7 +2884,7 @@ async fn kcl_test_kcl_lsp_cant_execute_set() { | ||||
|     let units = server.executor_ctx().await.clone().unwrap().settings.units; | ||||
|     assert_eq!(units, crate::settings::types::UnitLength::Mm); | ||||
|  | ||||
|     let mut default_hashed = crate::ast::types::Program::default(); | ||||
|     let mut default_hashed = UnboxedNode::<Program>::default(); | ||||
|     default_hashed.compute_digest(); | ||||
|  | ||||
|     // Get the ast. | ||||
| @ -2924,7 +2925,7 @@ async fn kcl_test_kcl_lsp_cant_execute_set() { | ||||
|  | ||||
|     // Get the ast. | ||||
|     let ast = server.ast_map.get("file:///test.kcl").unwrap().clone(); | ||||
|     assert!(ast != crate::ast::types::Program::default()); | ||||
|     assert!(ast != UnboxedNode::<Program>::default()); | ||||
|     // Get the memory. | ||||
|     let memory = server.memory_map.get("file:///test.kcl").unwrap().clone(); | ||||
|     // Now it should NOT be the default memory. | ||||
| @ -3064,7 +3065,7 @@ const part001 = startSketchOn('XY') | ||||
|  | ||||
|     // Get the ast. | ||||
|     let ast = server.ast_map.get("file:///test.kcl").unwrap().clone(); | ||||
|     assert!(ast != crate::ast::types::Program::default()); | ||||
|     assert!(ast != UnboxedNode::<Program>::default()); | ||||
|  | ||||
|     // Assure we have one diagnostics. | ||||
|     let diagnostics = server.diagnostics_map.get("file:///test.kcl").unwrap().clone(); | ||||
| @ -3087,7 +3088,7 @@ const part001 = startSketchOn('XY') | ||||
|  | ||||
|     // Get the ast. | ||||
|     let ast = server.ast_map.get("file:///test.kcl").unwrap().clone(); | ||||
|     assert!(ast != crate::ast::types::Program::default()); | ||||
|     assert!(ast != UnboxedNode::<Program>::default()); | ||||
|  | ||||
|     // Assure we have one diagnostics. | ||||
|     let diagnostics = server.diagnostics_map.get("file:///test.kcl").unwrap().clone(); | ||||
| @ -3183,7 +3184,7 @@ const part001 = startSketchOn('XY') | ||||
|  | ||||
|     // Get the ast. | ||||
|     let ast = server.ast_map.get("file:///test.kcl").unwrap().clone(); | ||||
|     assert!(ast != crate::ast::types::Program::default()); | ||||
|     assert!(ast != UnboxedNode::<Program>::default()); | ||||
|     // Get the memory. | ||||
|     let memory = server.memory_map.get("file:///test.kcl"); | ||||
|     assert!(memory.is_none()); | ||||
| @ -3205,7 +3206,7 @@ const part001 = startSketchOn('XY') | ||||
|  | ||||
|     // Get the ast. | ||||
|     let ast = server.ast_map.get("file:///test.kcl").unwrap().clone(); | ||||
|     assert!(ast != crate::ast::types::Program::default()); | ||||
|     assert!(ast != UnboxedNode::<Program>::default()); | ||||
|     // Get the memory. | ||||
|     let memory = server.memory_map.get("file:///test.kcl"); | ||||
|     assert!(memory.is_none()); | ||||
| @ -3248,7 +3249,7 @@ const part001 = startSketchOn('XY') | ||||
|  | ||||
|     // Get the ast. | ||||
|     let ast = server.ast_map.get("file:///test.kcl").unwrap().clone(); | ||||
|     assert!(ast != crate::ast::types::Program::default()); | ||||
|     assert!(ast != UnboxedNode::<Program>::default()); | ||||
|     // Get the memory. | ||||
|     let memory = server.memory_map.get("file:///test.kcl"); | ||||
|     assert!(memory.is_none()); | ||||
| @ -3278,7 +3279,7 @@ const NEW_LINT = 1"# | ||||
|  | ||||
|     // Get the ast. | ||||
|     let ast = server.ast_map.get("file:///test.kcl").unwrap().clone(); | ||||
|     assert!(ast != crate::ast::types::Program::default()); | ||||
|     assert!(ast != UnboxedNode::<Program>::default()); | ||||
|     // Get the memory. | ||||
|     let memory = server.memory_map.get("file:///test.kcl"); | ||||
|     assert!(memory.is_none()); | ||||
| @ -3394,7 +3395,7 @@ const part001 = startSketchOn('XY') | ||||
|  | ||||
|     // Get the ast. | ||||
|     let ast = server.ast_map.get("file:///test.kcl").unwrap().clone(); | ||||
|     assert!(ast != crate::ast::types::Program::default()); | ||||
|     assert!(ast != UnboxedNode::<Program>::default()); | ||||
|  | ||||
|     // Get the symbols map. | ||||
|     let symbols_map = server.symbols_map.get("file:///test.kcl").unwrap().clone(); | ||||
| @ -3489,7 +3490,7 @@ const part001 = startSketchOn('XY') | ||||
|  | ||||
|     // Get the ast. | ||||
|     let ast = server.ast_map.get("file:///test.kcl").unwrap().clone(); | ||||
|     assert!(ast != crate::ast::types::Program::default()); | ||||
|     assert!(ast != UnboxedNode::<Program>::default()); | ||||
|  | ||||
|     // Get the symbols map. | ||||
|     let symbols_map = server.symbols_map.get("file:///test.kcl").unwrap().clone(); | ||||
| @ -3532,7 +3533,7 @@ const part001 = startSketchOn('XY') | ||||
|  | ||||
|     // Get the ast. | ||||
|     let ast = server.ast_map.get("file:///test.kcl").unwrap().clone(); | ||||
|     assert!(ast != crate::ast::types::Program::default()); | ||||
|     assert!(ast != UnboxedNode::<Program>::default()); | ||||
|  | ||||
|     // Get the symbols map. | ||||
|     let symbols_map = server.symbols_map.get("file:///test.kcl").unwrap().clone(); | ||||
|  | ||||
| @ -1,5 +1,5 @@ | ||||
| use crate::{ | ||||
|     ast::types::Program, | ||||
|     ast::types::{Program, UnboxedNode}, | ||||
|     errors::{KclError, KclErrorDetails}, | ||||
|     executor::SourceRange, | ||||
|     token::{Token, TokenType}, | ||||
| @ -13,7 +13,7 @@ pub const PIPE_SUBSTITUTION_OPERATOR: &str = "%"; | ||||
| pub const PIPE_OPERATOR: &str = "|>"; | ||||
|  | ||||
| /// Parse the given KCL code into an AST. | ||||
| pub fn parse(code: &str) -> Result<Program, KclError> { | ||||
| pub fn parse(code: &str) -> Result<UnboxedNode<Program>, KclError> { | ||||
|     let tokens = crate::token::lexer(code)?; | ||||
|     let parser = Parser::new(tokens); | ||||
|     parser.ast() | ||||
| @ -33,7 +33,7 @@ impl Parser { | ||||
|     } | ||||
|  | ||||
|     /// Run the parser | ||||
|     pub fn ast(&self) -> Result<Program, KclError> { | ||||
|     pub fn ast(&self) -> Result<UnboxedNode<Program>, KclError> { | ||||
|         if !self.unknown_tokens.is_empty() { | ||||
|             let source_ranges = self.unknown_tokens.iter().map(SourceRange::from).collect(); | ||||
|             let token_list = self.unknown_tokens.iter().map(|t| t.value.as_str()).collect::<Vec<_>>(); | ||||
| @ -48,7 +48,7 @@ impl Parser { | ||||
|         // Important, to not call this before the unknown tokens check. | ||||
|         if self.tokens.is_empty() { | ||||
|             // Empty file should just do nothing. | ||||
|             return Ok(Program::default()); | ||||
|             return Ok(UnboxedNode::<Program>::default()); | ||||
|         } | ||||
|  | ||||
|         // Check all the tokens are whitespace or comments. | ||||
| @ -57,7 +57,7 @@ impl Parser { | ||||
|             .iter() | ||||
|             .all(|t| t.token_type.is_whitespace() || t.token_type.is_comment()) | ||||
|         { | ||||
|             return Ok(Program::default()); | ||||
|             return Ok(UnboxedNode::<Program>::default()); | ||||
|         } | ||||
|  | ||||
|         parser_impl::run_parser(&mut self.tokens.as_slice()) | ||||
|  | ||||
| @ -1,18 +1,18 @@ | ||||
| use crate::{ | ||||
|     ast::types::{BinaryExpression, BinaryOperator, BinaryPart}, | ||||
|     ast::types::{BinaryExpression, BinaryOperator, BinaryPart, UnboxedNode}, | ||||
|     errors::{KclError, KclErrorDetails}, | ||||
|     executor::SourceRange, | ||||
| }; | ||||
|  | ||||
| /// Parses a list of tokens (in infix order, i.e. as the user typed them) | ||||
| /// into a binary expression tree. | ||||
| pub fn parse(infix_tokens: Vec<BinaryExpressionToken>) -> Result<BinaryExpression, KclError> { | ||||
| pub fn parse(infix_tokens: Vec<BinaryExpressionToken>) -> Result<UnboxedNode<BinaryExpression>, KclError> { | ||||
|     let rpn = postfix(infix_tokens); | ||||
|     evaluate(rpn) | ||||
| } | ||||
|  | ||||
| /// Parses a list of tokens (in postfix order) into a binary expression tree. | ||||
| fn evaluate(rpn: Vec<BinaryExpressionToken>) -> Result<BinaryExpression, KclError> { | ||||
| fn evaluate(rpn: Vec<BinaryExpressionToken>) -> Result<UnboxedNode<BinaryExpression>, KclError> { | ||||
|     let source_ranges = source_range(&rpn); | ||||
|     let mut operand_stack: Vec<BinaryPart> = Vec::new(); | ||||
|     let e = KclError::Internal(KclErrorDetails { | ||||
| @ -28,14 +28,19 @@ fn evaluate(rpn: Vec<BinaryExpressionToken>) -> Result<BinaryExpression, KclErro | ||||
|                 let Some(left) = operand_stack.pop() else { | ||||
|                     return Err(e); | ||||
|                 }; | ||||
|                 BinaryPart::BinaryExpression(Box::new(BinaryExpression { | ||||
|                     start: left.start(), | ||||
|                     end: right.end(), | ||||
|                 let start = left.start(); | ||||
|                 let end = right.end(); | ||||
|  | ||||
|                 BinaryPart::BinaryExpression(UnboxedNode::boxed( | ||||
|                     BinaryExpression { | ||||
|                         operator, | ||||
|                         left, | ||||
|                         right, | ||||
|                         digest: None, | ||||
|                 })) | ||||
|                     }, | ||||
|                     start, | ||||
|                     end, | ||||
|                 )) | ||||
|             } | ||||
|             BinaryExpressionToken::Operand(o) => o, | ||||
|         }; | ||||
| @ -125,13 +130,15 @@ mod tests { | ||||
|     fn parse_and_evaluate() { | ||||
|         /// Make a literal | ||||
|         fn lit(n: u8) -> BinaryPart { | ||||
|             BinaryPart::Literal(Box::new(Literal { | ||||
|                 start: 0, | ||||
|                 end: 0, | ||||
|             BinaryPart::Literal(UnboxedNode::new( | ||||
|                 Literal { | ||||
|                     value: n.into(), | ||||
|                     raw: n.to_string(), | ||||
|                     digest: None, | ||||
|             })) | ||||
|                 }, | ||||
|                 0, | ||||
|                 0, | ||||
|             )) | ||||
|         } | ||||
|         let tests: Vec<Vec<BinaryExpressionToken>> = vec![ | ||||
|             // 3 + 4 × 2 ÷ ( 1 − 5 ) ^ 2 ^ 3 | ||||
| @ -142,14 +149,16 @@ mod tests { | ||||
|                 BinaryOperator::Mul.into(), | ||||
|                 lit(2).into(), | ||||
|                 BinaryOperator::Div.into(), | ||||
|                 BinaryPart::BinaryExpression(Box::new(BinaryExpression { | ||||
|                     start: 0, | ||||
|                     end: 0, | ||||
|                 BinaryPart::BinaryExpression(UnboxedNode::boxed( | ||||
|                     BinaryExpression { | ||||
|                         operator: BinaryOperator::Sub, | ||||
|                         left: lit(1), | ||||
|                         right: lit(5), | ||||
|                         digest: None, | ||||
|                 })) | ||||
|                     }, | ||||
|                     0, | ||||
|                     0, | ||||
|                 )) | ||||
|                 .into(), | ||||
|                 BinaryOperator::Pow.into(), | ||||
|                 lit(2).into(), | ||||
|  | ||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @ -1,26 +1,36 @@ | ||||
| --- | ||||
| source: kcl/src/parser/parser_impl.rs | ||||
| assertion_line: 3567 | ||||
| expression: actual | ||||
| --- | ||||
| { | ||||
|   "type": "UnboxedNode", | ||||
|   "kind": { | ||||
|     "type": "BinaryExpression", | ||||
|   "start": 0, | ||||
|   "end": 5, | ||||
|     "operator": "+", | ||||
|     "left": { | ||||
|       "type": "Literal", | ||||
|       "type": "UnboxedNode", | ||||
|       "kind": { | ||||
|         "type": "Literal", | ||||
|     "start": 0, | ||||
|     "end": 1, | ||||
|         "value": 1, | ||||
|         "raw": "1" | ||||
|       }, | ||||
|       "start": 0, | ||||
|       "end": 1 | ||||
|     }, | ||||
|     "right": { | ||||
|       "type": "Literal", | ||||
|       "type": "UnboxedNode", | ||||
|       "kind": { | ||||
|         "type": "Literal", | ||||
|     "start": 4, | ||||
|     "end": 5, | ||||
|         "value": 2, | ||||
|         "raw": "2" | ||||
|       }, | ||||
|       "start": 4, | ||||
|       "end": 5 | ||||
|     } | ||||
|   }, | ||||
|   "start": 0, | ||||
|   "end": 5 | ||||
| } | ||||
|  | ||||
| @ -1,26 +1,36 @@ | ||||
| --- | ||||
| source: kcl/src/parser/parser_impl.rs | ||||
| assertion_line: 3568 | ||||
| expression: actual | ||||
| --- | ||||
| { | ||||
|   "type": "UnboxedNode", | ||||
|   "kind": { | ||||
|     "type": "BinaryExpression", | ||||
|   "start": 0, | ||||
|   "end": 3, | ||||
|     "operator": "+", | ||||
|     "left": { | ||||
|       "type": "Literal", | ||||
|       "type": "UnboxedNode", | ||||
|       "kind": { | ||||
|         "type": "Literal", | ||||
|     "start": 0, | ||||
|     "end": 1, | ||||
|         "value": 1, | ||||
|         "raw": "1" | ||||
|       }, | ||||
|       "start": 0, | ||||
|       "end": 1 | ||||
|     }, | ||||
|     "right": { | ||||
|       "type": "Literal", | ||||
|       "type": "UnboxedNode", | ||||
|       "kind": { | ||||
|         "type": "Literal", | ||||
|     "start": 2, | ||||
|     "end": 3, | ||||
|         "value": 2, | ||||
|         "raw": "2" | ||||
|       }, | ||||
|       "start": 2, | ||||
|       "end": 3 | ||||
|     } | ||||
|   }, | ||||
|   "start": 0, | ||||
|   "end": 3 | ||||
| } | ||||
|  | ||||
| @ -1,26 +1,36 @@ | ||||
| --- | ||||
| source: kcl/src/parser/parser_impl.rs | ||||
| assertion_line: 3569 | ||||
| expression: actual | ||||
| --- | ||||
| { | ||||
|   "type": "UnboxedNode", | ||||
|   "kind": { | ||||
|     "type": "BinaryExpression", | ||||
|   "start": 0, | ||||
|   "end": 4, | ||||
|     "operator": "-", | ||||
|     "left": { | ||||
|       "type": "Literal", | ||||
|       "type": "UnboxedNode", | ||||
|       "kind": { | ||||
|         "type": "Literal", | ||||
|     "start": 0, | ||||
|     "end": 1, | ||||
|         "value": 1, | ||||
|         "raw": "1" | ||||
|       }, | ||||
|       "start": 0, | ||||
|       "end": 1 | ||||
|     }, | ||||
|     "right": { | ||||
|       "type": "Literal", | ||||
|       "type": "UnboxedNode", | ||||
|       "kind": { | ||||
|         "type": "Literal", | ||||
|     "start": 3, | ||||
|     "end": 4, | ||||
|         "value": 2, | ||||
|         "raw": "2" | ||||
|       }, | ||||
|       "start": 3, | ||||
|       "end": 4 | ||||
|     } | ||||
|   }, | ||||
|   "start": 0, | ||||
|   "end": 4 | ||||
| } | ||||
|  | ||||
| @ -1,41 +1,57 @@ | ||||
| --- | ||||
| source: kcl/src/parser/parser_impl.rs | ||||
| assertion_line: 3570 | ||||
| expression: actual | ||||
| --- | ||||
| { | ||||
|   "type": "UnboxedNode", | ||||
|   "kind": { | ||||
|     "type": "BinaryExpression", | ||||
|   "start": 0, | ||||
|   "end": 9, | ||||
|     "operator": "+", | ||||
|     "left": { | ||||
|       "type": "Literal", | ||||
|       "type": "UnboxedNode", | ||||
|       "kind": { | ||||
|         "type": "Literal", | ||||
|     "start": 0, | ||||
|     "end": 1, | ||||
|         "value": 1, | ||||
|         "raw": "1" | ||||
|       }, | ||||
|       "start": 0, | ||||
|       "end": 1 | ||||
|     }, | ||||
|     "right": { | ||||
|       "type": "BinaryExpression", | ||||
|       "type": "UnboxedNode", | ||||
|       "kind": { | ||||
|         "type": "BinaryExpression", | ||||
|     "start": 4, | ||||
|     "end": 9, | ||||
|         "operator": "*", | ||||
|         "left": { | ||||
|           "type": "Literal", | ||||
|           "type": "UnboxedNode", | ||||
|           "kind": { | ||||
|             "type": "Literal", | ||||
|       "start": 4, | ||||
|       "end": 5, | ||||
|             "value": 2, | ||||
|             "raw": "2" | ||||
|           }, | ||||
|           "start": 4, | ||||
|           "end": 5 | ||||
|         }, | ||||
|         "right": { | ||||
|           "type": "Literal", | ||||
|           "type": "UnboxedNode", | ||||
|           "kind": { | ||||
|             "type": "Literal", | ||||
|       "start": 8, | ||||
|       "end": 9, | ||||
|             "value": 3, | ||||
|             "raw": "3" | ||||
|           }, | ||||
|           "start": 8, | ||||
|           "end": 9 | ||||
|         } | ||||
|       }, | ||||
|       "start": 4, | ||||
|       "end": 9 | ||||
|     } | ||||
|   }, | ||||
|   "start": 0, | ||||
|   "end": 9 | ||||
| } | ||||
|  | ||||
| @ -1,41 +1,57 @@ | ||||
| --- | ||||
| source: kcl/src/parser/parser_impl.rs | ||||
| assertion_line: 3571 | ||||
| expression: actual | ||||
| --- | ||||
| { | ||||
|   "type": "UnboxedNode", | ||||
|   "kind": { | ||||
|     "type": "BinaryExpression", | ||||
|   "start": 0, | ||||
|   "end": 11, | ||||
|     "operator": "*", | ||||
|     "left": { | ||||
|       "type": "Literal", | ||||
|       "type": "UnboxedNode", | ||||
|       "kind": { | ||||
|         "type": "Literal", | ||||
|     "start": 0, | ||||
|     "end": 1, | ||||
|         "value": 1, | ||||
|         "raw": "1" | ||||
|       }, | ||||
|       "start": 0, | ||||
|       "end": 1 | ||||
|     }, | ||||
|     "right": { | ||||
|       "type": "BinaryExpression", | ||||
|       "type": "UnboxedNode", | ||||
|       "kind": { | ||||
|         "type": "BinaryExpression", | ||||
|     "start": 6, | ||||
|     "end": 11, | ||||
|         "operator": "+", | ||||
|         "left": { | ||||
|           "type": "Literal", | ||||
|           "type": "UnboxedNode", | ||||
|           "kind": { | ||||
|             "type": "Literal", | ||||
|       "start": 6, | ||||
|       "end": 7, | ||||
|             "value": 2, | ||||
|             "raw": "2" | ||||
|           }, | ||||
|           "start": 6, | ||||
|           "end": 7 | ||||
|         }, | ||||
|         "right": { | ||||
|           "type": "Literal", | ||||
|           "type": "UnboxedNode", | ||||
|           "kind": { | ||||
|             "type": "Literal", | ||||
|       "start": 10, | ||||
|       "end": 11, | ||||
|             "value": 3, | ||||
|             "raw": "3" | ||||
|           }, | ||||
|           "start": 10, | ||||
|           "end": 11 | ||||
|         } | ||||
|       }, | ||||
|       "start": 6, | ||||
|       "end": 11 | ||||
|     } | ||||
|   }, | ||||
|   "start": 0, | ||||
|   "end": 11 | ||||
| } | ||||
|  | ||||
| @ -1,56 +1,78 @@ | ||||
| --- | ||||
| source: kcl/src/parser/parser_impl.rs | ||||
| assertion_line: 3572 | ||||
| expression: actual | ||||
| --- | ||||
| { | ||||
|   "type": "UnboxedNode", | ||||
|   "kind": { | ||||
|     "type": "BinaryExpression", | ||||
|   "start": 0, | ||||
|   "end": 17, | ||||
|     "operator": "/", | ||||
|     "left": { | ||||
|       "type": "BinaryExpression", | ||||
|       "type": "UnboxedNode", | ||||
|       "kind": { | ||||
|         "type": "BinaryExpression", | ||||
|     "start": 0, | ||||
|     "end": 11, | ||||
|         "operator": "*", | ||||
|         "left": { | ||||
|           "type": "Literal", | ||||
|           "type": "UnboxedNode", | ||||
|           "kind": { | ||||
|             "type": "Literal", | ||||
|       "start": 0, | ||||
|       "end": 1, | ||||
|             "value": 1, | ||||
|             "raw": "1" | ||||
|           }, | ||||
|           "start": 0, | ||||
|           "end": 1 | ||||
|         }, | ||||
|         "right": { | ||||
|           "type": "BinaryExpression", | ||||
|           "type": "UnboxedNode", | ||||
|           "kind": { | ||||
|             "type": "BinaryExpression", | ||||
|       "start": 6, | ||||
|       "end": 11, | ||||
|             "operator": "+", | ||||
|             "left": { | ||||
|               "type": "Literal", | ||||
|               "type": "UnboxedNode", | ||||
|               "kind": { | ||||
|                 "type": "Literal", | ||||
|         "start": 6, | ||||
|         "end": 7, | ||||
|                 "value": 2, | ||||
|                 "raw": "2" | ||||
|               }, | ||||
|       "right": { | ||||
|         "type": "Literal", | ||||
|         "type": "Literal", | ||||
|         "start": 10, | ||||
|         "end": 11, | ||||
|         "value": 3, | ||||
|         "raw": "3" | ||||
|       } | ||||
|     } | ||||
|               "start": 6, | ||||
|               "end": 7 | ||||
|             }, | ||||
|             "right": { | ||||
|               "type": "Literal", | ||||
|               "type": "UnboxedNode", | ||||
|               "kind": { | ||||
|                 "type": "Literal", | ||||
|                 "value": 3, | ||||
|                 "raw": "3" | ||||
|               }, | ||||
|               "start": 10, | ||||
|               "end": 11 | ||||
|             } | ||||
|           }, | ||||
|           "start": 6, | ||||
|           "end": 11 | ||||
|         } | ||||
|       }, | ||||
|       "start": 0, | ||||
|       "end": 11 | ||||
|     }, | ||||
|     "right": { | ||||
|       "type": "Literal", | ||||
|       "type": "UnboxedNode", | ||||
|       "kind": { | ||||
|         "type": "Literal", | ||||
|     "start": 16, | ||||
|     "end": 17, | ||||
|         "value": 4, | ||||
|         "raw": "4" | ||||
|       }, | ||||
|       "start": 16, | ||||
|       "end": 17 | ||||
|     } | ||||
|   }, | ||||
|   "start": 0, | ||||
|   "end": 17 | ||||
| } | ||||
|  | ||||
| @ -1,56 +1,78 @@ | ||||
| --- | ||||
| source: kcl/src/parser/parser_impl.rs | ||||
| assertion_line: 3573 | ||||
| expression: actual | ||||
| --- | ||||
| { | ||||
|   "type": "UnboxedNode", | ||||
|   "kind": { | ||||
|     "type": "BinaryExpression", | ||||
|   "start": 0, | ||||
|   "end": 17, | ||||
|     "operator": "+", | ||||
|     "left": { | ||||
|       "type": "Literal", | ||||
|       "type": "UnboxedNode", | ||||
|       "kind": { | ||||
|         "type": "Literal", | ||||
|     "start": 0, | ||||
|     "end": 1, | ||||
|         "value": 1, | ||||
|         "raw": "1" | ||||
|       }, | ||||
|       "start": 0, | ||||
|       "end": 1 | ||||
|     }, | ||||
|     "right": { | ||||
|       "type": "BinaryExpression", | ||||
|       "type": "UnboxedNode", | ||||
|       "kind": { | ||||
|         "type": "BinaryExpression", | ||||
|     "start": 6, | ||||
|     "end": 17, | ||||
|         "operator": "/", | ||||
|         "left": { | ||||
|           "type": "BinaryExpression", | ||||
|           "type": "UnboxedNode", | ||||
|           "kind": { | ||||
|             "type": "BinaryExpression", | ||||
|       "start": 6, | ||||
|       "end": 11, | ||||
|             "operator": "+", | ||||
|             "left": { | ||||
|               "type": "Literal", | ||||
|               "type": "UnboxedNode", | ||||
|               "kind": { | ||||
|                 "type": "Literal", | ||||
|         "start": 6, | ||||
|         "end": 7, | ||||
|                 "value": 2, | ||||
|                 "raw": "2" | ||||
|               }, | ||||
|       "right": { | ||||
|         "type": "Literal", | ||||
|         "type": "Literal", | ||||
|         "start": 10, | ||||
|         "end": 11, | ||||
|         "value": 3, | ||||
|         "raw": "3" | ||||
|       } | ||||
|               "start": 6, | ||||
|               "end": 7 | ||||
|             }, | ||||
|             "right": { | ||||
|               "type": "Literal", | ||||
|               "type": "UnboxedNode", | ||||
|               "kind": { | ||||
|                 "type": "Literal", | ||||
|                 "value": 3, | ||||
|                 "raw": "3" | ||||
|               }, | ||||
|               "start": 10, | ||||
|               "end": 11 | ||||
|             } | ||||
|           }, | ||||
|           "start": 6, | ||||
|           "end": 11 | ||||
|         }, | ||||
|         "right": { | ||||
|           "type": "Literal", | ||||
|           "type": "UnboxedNode", | ||||
|           "kind": { | ||||
|             "type": "Literal", | ||||
|       "start": 16, | ||||
|       "end": 17, | ||||
|             "value": 4, | ||||
|             "raw": "4" | ||||
|           }, | ||||
|           "start": 16, | ||||
|           "end": 17 | ||||
|         } | ||||
|       }, | ||||
|       "start": 6, | ||||
|       "end": 17 | ||||
|     } | ||||
|   }, | ||||
|   "start": 0, | ||||
|   "end": 17 | ||||
| } | ||||
|  | ||||
| @ -1,71 +1,99 @@ | ||||
| --- | ||||
| source: kcl/src/parser/parser_impl.rs | ||||
| assertion_line: 3574 | ||||
| expression: actual | ||||
| --- | ||||
| { | ||||
|   "type": "UnboxedNode", | ||||
|   "kind": { | ||||
|     "type": "BinaryExpression", | ||||
|   "start": 0, | ||||
|   "end": 22, | ||||
|     "operator": "*", | ||||
|     "left": { | ||||
|       "type": "Literal", | ||||
|       "type": "UnboxedNode", | ||||
|       "kind": { | ||||
|         "type": "Literal", | ||||
|     "start": 0, | ||||
|     "end": 1, | ||||
|         "value": 1, | ||||
|         "raw": "1" | ||||
|       }, | ||||
|       "start": 0, | ||||
|       "end": 1 | ||||
|     }, | ||||
|     "right": { | ||||
|       "type": "BinaryExpression", | ||||
|       "type": "UnboxedNode", | ||||
|       "kind": { | ||||
|         "type": "BinaryExpression", | ||||
|     "start": 7, | ||||
|     "end": 22, | ||||
|         "operator": "+", | ||||
|         "left": { | ||||
|           "type": "BinaryExpression", | ||||
|           "type": "UnboxedNode", | ||||
|           "kind": { | ||||
|             "type": "BinaryExpression", | ||||
|       "start": 7, | ||||
|       "end": 18, | ||||
|             "operator": "/", | ||||
|             "left": { | ||||
|               "type": "BinaryExpression", | ||||
|               "type": "UnboxedNode", | ||||
|               "kind": { | ||||
|                 "type": "BinaryExpression", | ||||
|         "start": 7, | ||||
|         "end": 12, | ||||
|                 "operator": "+", | ||||
|                 "left": { | ||||
|                   "type": "Literal", | ||||
|                   "type": "UnboxedNode", | ||||
|                   "kind": { | ||||
|                     "type": "Literal", | ||||
|           "start": 7, | ||||
|           "end": 8, | ||||
|                     "value": 2, | ||||
|                     "raw": "2" | ||||
|                   }, | ||||
|                   "start": 7, | ||||
|                   "end": 8 | ||||
|                 }, | ||||
|                 "right": { | ||||
|                   "type": "Literal", | ||||
|                   "type": "UnboxedNode", | ||||
|                   "kind": { | ||||
|                     "type": "Literal", | ||||
|           "start": 11, | ||||
|           "end": 12, | ||||
|                     "value": 3, | ||||
|                     "raw": "3" | ||||
|                   }, | ||||
|                   "start": 11, | ||||
|                   "end": 12 | ||||
|                 } | ||||
|               }, | ||||
|               "start": 7, | ||||
|               "end": 12 | ||||
|             }, | ||||
|             "right": { | ||||
|               "type": "Literal", | ||||
|               "type": "UnboxedNode", | ||||
|               "kind": { | ||||
|                 "type": "Literal", | ||||
|         "start": 17, | ||||
|         "end": 18, | ||||
|                 "value": 4, | ||||
|                 "raw": "4" | ||||
|               }, | ||||
|               "start": 17, | ||||
|               "end": 18 | ||||
|             } | ||||
|           }, | ||||
|           "start": 7, | ||||
|           "end": 18 | ||||
|         }, | ||||
|         "right": { | ||||
|           "type": "Literal", | ||||
|           "type": "UnboxedNode", | ||||
|           "kind": { | ||||
|             "type": "Literal", | ||||
|       "start": 21, | ||||
|       "end": 22, | ||||
|             "value": 5, | ||||
|             "raw": "5" | ||||
|           }, | ||||
|           "start": 21, | ||||
|           "end": 22 | ||||
|         } | ||||
|       }, | ||||
|       "start": 7, | ||||
|       "end": 22 | ||||
|     } | ||||
|   }, | ||||
|   "start": 0, | ||||
|   "end": 22 | ||||
| } | ||||
|  | ||||
| @ -1,41 +1,57 @@ | ||||
| --- | ||||
| source: kcl/src/parser/parser_impl.rs | ||||
| assertion_line: 3575 | ||||
| expression: actual | ||||
| --- | ||||
| { | ||||
|   "type": "UnboxedNode", | ||||
|   "kind": { | ||||
|     "type": "BinaryExpression", | ||||
|   "start": 0, | ||||
|   "end": 13, | ||||
|     "operator": "*", | ||||
|     "left": { | ||||
|       "type": "Literal", | ||||
|       "type": "UnboxedNode", | ||||
|       "kind": { | ||||
|         "type": "Literal", | ||||
|     "start": 0, | ||||
|     "end": 1, | ||||
|         "value": 1, | ||||
|         "raw": "1" | ||||
|       }, | ||||
|       "start": 0, | ||||
|       "end": 1 | ||||
|     }, | ||||
|     "right": { | ||||
|       "type": "BinaryExpression", | ||||
|       "type": "UnboxedNode", | ||||
|       "kind": { | ||||
|         "type": "BinaryExpression", | ||||
|     "start": 8, | ||||
|     "end": 13, | ||||
|         "operator": "+", | ||||
|         "left": { | ||||
|           "type": "Literal", | ||||
|           "type": "UnboxedNode", | ||||
|           "kind": { | ||||
|             "type": "Literal", | ||||
|       "start": 8, | ||||
|       "end": 9, | ||||
|             "value": 2, | ||||
|             "raw": "2" | ||||
|           }, | ||||
|           "start": 8, | ||||
|           "end": 9 | ||||
|         }, | ||||
|         "right": { | ||||
|           "type": "Literal", | ||||
|           "type": "UnboxedNode", | ||||
|           "kind": { | ||||
|             "type": "Literal", | ||||
|       "start": 12, | ||||
|       "end": 13, | ||||
|             "value": 3, | ||||
|             "raw": "3" | ||||
|           }, | ||||
|           "start": 12, | ||||
|           "end": 13 | ||||
|         } | ||||
|       }, | ||||
|       "start": 8, | ||||
|       "end": 13 | ||||
|     } | ||||
|   }, | ||||
|   "start": 0, | ||||
|   "end": 13 | ||||
| } | ||||
|  | ||||
| @ -1,81 +1,115 @@ | ||||
| --- | ||||
| source: kcl/src/parser/parser_impl.rs | ||||
| assertion_line: 3576 | ||||
| expression: actual | ||||
| --- | ||||
| { | ||||
|   "type": "UnboxedNode", | ||||
|   "kind": { | ||||
|     "type": "BinaryExpression", | ||||
|   "start": 0, | ||||
|   "end": 44, | ||||
|     "operator": "/", | ||||
|     "left": { | ||||
|       "type": "BinaryExpression", | ||||
|       "type": "UnboxedNode", | ||||
|       "kind": { | ||||
|         "type": "BinaryExpression", | ||||
|     "start": 0, | ||||
|     "end": 22, | ||||
|         "operator": "*", | ||||
|         "left": { | ||||
|           "type": "BinaryExpression", | ||||
|           "type": "UnboxedNode", | ||||
|           "kind": { | ||||
|             "type": "BinaryExpression", | ||||
|       "start": 0, | ||||
|       "end": 18, | ||||
|             "operator": "*", | ||||
|             "left": { | ||||
|               "type": "BinaryExpression", | ||||
|               "type": "UnboxedNode", | ||||
|               "kind": { | ||||
|                 "type": "BinaryExpression", | ||||
|         "start": 0, | ||||
|         "end": 12, | ||||
|                 "operator": "*", | ||||
|                 "left": { | ||||
|                   "type": "Identifier", | ||||
|                   "type": "UnboxedNode", | ||||
|                   "kind": { | ||||
|                     "type": "Identifier", | ||||
|           "start": 0, | ||||
|           "end": 8, | ||||
|                     "name": "distance" | ||||
|                   }, | ||||
|                   "start": 0, | ||||
|                   "end": 8 | ||||
|                 }, | ||||
|                 "right": { | ||||
|                   "type": "Identifier", | ||||
|                   "type": "UnboxedNode", | ||||
|                   "kind": { | ||||
|                     "type": "Identifier", | ||||
|           "start": 11, | ||||
|           "end": 12, | ||||
|                     "name": "p" | ||||
|                   }, | ||||
|                   "start": 11, | ||||
|                   "end": 12 | ||||
|                 } | ||||
|               }, | ||||
|               "start": 0, | ||||
|               "end": 12 | ||||
|             }, | ||||
|             "right": { | ||||
|               "type": "Identifier", | ||||
|               "type": "UnboxedNode", | ||||
|               "kind": { | ||||
|                 "type": "Identifier", | ||||
|         "start": 15, | ||||
|         "end": 18, | ||||
|                 "name": "FOS" | ||||
|               }, | ||||
|               "start": 15, | ||||
|               "end": 18 | ||||
|             } | ||||
|           }, | ||||
|           "start": 0, | ||||
|           "end": 18 | ||||
|         }, | ||||
|         "right": { | ||||
|           "type": "Literal", | ||||
|           "type": "UnboxedNode", | ||||
|           "kind": { | ||||
|             "type": "Literal", | ||||
|       "start": 21, | ||||
|       "end": 22, | ||||
|             "value": 6, | ||||
|             "raw": "6" | ||||
|           }, | ||||
|           "start": 21, | ||||
|           "end": 22 | ||||
|         } | ||||
|       }, | ||||
|       "start": 0, | ||||
|       "end": 22 | ||||
|     }, | ||||
|     "right": { | ||||
|       "type": "BinaryExpression", | ||||
|       "type": "UnboxedNode", | ||||
|       "kind": { | ||||
|         "type": "BinaryExpression", | ||||
|     "start": 26, | ||||
|     "end": 44, | ||||
|         "operator": "*", | ||||
|         "left": { | ||||
|           "type": "Identifier", | ||||
|           "type": "UnboxedNode", | ||||
|           "kind": { | ||||
|             "type": "Identifier", | ||||
|       "start": 26, | ||||
|       "end": 36, | ||||
|             "name": "sigmaAllow" | ||||
|           }, | ||||
|           "start": 26, | ||||
|           "end": 36 | ||||
|         }, | ||||
|         "right": { | ||||
|           "type": "Identifier", | ||||
|           "type": "UnboxedNode", | ||||
|           "kind": { | ||||
|             "type": "Identifier", | ||||
|       "start": 39, | ||||
|       "end": 44, | ||||
|             "name": "width" | ||||
|           }, | ||||
|           "start": 39, | ||||
|           "end": 44 | ||||
|         } | ||||
|       }, | ||||
|       "start": 26, | ||||
|       "end": 44 | ||||
|     } | ||||
|   }, | ||||
|   "start": 0, | ||||
|   "end": 44 | ||||
| } | ||||
|  | ||||
| @ -1,26 +1,36 @@ | ||||
| --- | ||||
| source: kcl/src/parser/parser_impl.rs | ||||
| assertion_line: 3577 | ||||
| expression: actual | ||||
| --- | ||||
| { | ||||
|   "type": "UnboxedNode", | ||||
|   "kind": { | ||||
|     "type": "BinaryExpression", | ||||
|   "start": 0, | ||||
|   "end": 8, | ||||
|     "operator": "+", | ||||
|     "left": { | ||||
|       "type": "Literal", | ||||
|       "type": "UnboxedNode", | ||||
|       "kind": { | ||||
|         "type": "Literal", | ||||
|     "start": 0, | ||||
|     "end": 1, | ||||
|         "value": 2, | ||||
|         "raw": "2" | ||||
|       }, | ||||
|       "start": 0, | ||||
|       "end": 1 | ||||
|     }, | ||||
|     "right": { | ||||
|       "type": "Literal", | ||||
|       "type": "UnboxedNode", | ||||
|       "kind": { | ||||
|         "type": "Literal", | ||||
|     "start": 7, | ||||
|     "end": 8, | ||||
|         "value": 3, | ||||
|         "raw": "3" | ||||
|       }, | ||||
|       "start": 7, | ||||
|       "end": 8 | ||||
|     } | ||||
|   }, | ||||
|   "start": 0, | ||||
|   "end": 8 | ||||
| } | ||||
|  | ||||
| @ -1,255 +1,358 @@ | ||||
| --- | ||||
| source: kcl/src/parser/parser_impl.rs | ||||
| assertion_line: 3606 | ||||
| expression: actual | ||||
| --- | ||||
| { | ||||
|   "start": 0, | ||||
|   "end": 144, | ||||
|   "type": "UnboxedNode", | ||||
|   "kind": { | ||||
|     "body": [ | ||||
|       { | ||||
|         "type": "VariableDeclaration", | ||||
|         "type": "UnboxedNode", | ||||
|         "kind": { | ||||
|           "type": "VariableDeclaration", | ||||
|       "start": 0, | ||||
|       "end": 143, | ||||
|           "declarations": [ | ||||
|             { | ||||
|               "type": "UnboxedNode", | ||||
|               "kind": { | ||||
|                 "type": "VariableDeclarator", | ||||
|           "start": 6, | ||||
|           "end": 143, | ||||
|                 "id": { | ||||
|                   "type": "UnboxedNode", | ||||
|                   "kind": { | ||||
|                     "type": "Identifier", | ||||
|             "start": 6, | ||||
|             "end": 15, | ||||
|                     "name": "boxSketch" | ||||
|                   }, | ||||
|                   "start": 6, | ||||
|                   "end": 15 | ||||
|                 }, | ||||
|                 "init": { | ||||
|                   "type": "PipeExpression", | ||||
|                   "type": "UnboxedNode", | ||||
|                   "kind": { | ||||
|                     "type": "PipeExpression", | ||||
|             "start": 18, | ||||
|             "end": 143, | ||||
|                     "body": [ | ||||
|                       { | ||||
|                         "type": "CallExpression", | ||||
|                         "type": "UnboxedNode", | ||||
|                         "kind": { | ||||
|                           "type": "CallExpression", | ||||
|                 "start": 18, | ||||
|                 "end": 39, | ||||
|                           "callee": { | ||||
|                             "type": "UnboxedNode", | ||||
|                             "kind": { | ||||
|                               "type": "Identifier", | ||||
|                   "start": 18, | ||||
|                   "end": 31, | ||||
|                               "name": "startSketchAt" | ||||
|                             }, | ||||
|                             "start": 18, | ||||
|                             "end": 31 | ||||
|                           }, | ||||
|                           "arguments": [ | ||||
|                             { | ||||
|                               "type": "ArrayExpression", | ||||
|                               "type": "UnboxedNode", | ||||
|                               "kind": { | ||||
|                                 "type": "ArrayExpression", | ||||
|                     "start": 32, | ||||
|                     "end": 38, | ||||
|                                 "elements": [ | ||||
|                                   { | ||||
|                                     "type": "Literal", | ||||
|                                     "type": "UnboxedNode", | ||||
|                                     "kind": { | ||||
|                                       "type": "Literal", | ||||
|                         "start": 33, | ||||
|                         "end": 34, | ||||
|                                       "value": 0, | ||||
|                                       "raw": "0" | ||||
|                                     }, | ||||
|                                     "start": 33, | ||||
|                                     "end": 34 | ||||
|                                   }, | ||||
|                                   { | ||||
|                                     "type": "Literal", | ||||
|                                     "type": "UnboxedNode", | ||||
|                                     "kind": { | ||||
|                                       "type": "Literal", | ||||
|                         "start": 36, | ||||
|                         "end": 37, | ||||
|                                       "value": 0, | ||||
|                                       "raw": "0" | ||||
|                                     }, | ||||
|                                     "start": 36, | ||||
|                                     "end": 37 | ||||
|                                   } | ||||
|                                 ] | ||||
|                               }, | ||||
|                               "start": 32, | ||||
|                               "end": 38 | ||||
|                             } | ||||
|                           ], | ||||
|                           "optional": false | ||||
|                         }, | ||||
|                         "start": 18, | ||||
|                         "end": 39 | ||||
|                       }, | ||||
|                       { | ||||
|                         "type": "CallExpression", | ||||
|                         "type": "UnboxedNode", | ||||
|                         "kind": { | ||||
|                           "type": "CallExpression", | ||||
|                 "start": 47, | ||||
|                 "end": 63, | ||||
|                           "callee": { | ||||
|                             "type": "UnboxedNode", | ||||
|                             "kind": { | ||||
|                               "type": "Identifier", | ||||
|                   "start": 47, | ||||
|                   "end": 51, | ||||
|                               "name": "line" | ||||
|                             }, | ||||
|                             "start": 47, | ||||
|                             "end": 51 | ||||
|                           }, | ||||
|                           "arguments": [ | ||||
|                             { | ||||
|                               "type": "ArrayExpression", | ||||
|                               "type": "UnboxedNode", | ||||
|                               "kind": { | ||||
|                                 "type": "ArrayExpression", | ||||
|                     "start": 52, | ||||
|                     "end": 59, | ||||
|                                 "elements": [ | ||||
|                                   { | ||||
|                                     "type": "Literal", | ||||
|                                     "type": "UnboxedNode", | ||||
|                                     "kind": { | ||||
|                                       "type": "Literal", | ||||
|                         "start": 53, | ||||
|                         "end": 54, | ||||
|                                       "value": 0, | ||||
|                                       "raw": "0" | ||||
|                                     }, | ||||
|                                     "start": 53, | ||||
|                                     "end": 54 | ||||
|                                   }, | ||||
|                                   { | ||||
|                                     "type": "Literal", | ||||
|                                     "type": "UnboxedNode", | ||||
|                                     "kind": { | ||||
|                                       "type": "Literal", | ||||
|                         "start": 56, | ||||
|                         "end": 58, | ||||
|                                       "value": 10, | ||||
|                                       "raw": "10" | ||||
|                                     }, | ||||
|                                     "start": 56, | ||||
|                                     "end": 58 | ||||
|                                   } | ||||
|                                 ] | ||||
|                               }, | ||||
|                               "start": 52, | ||||
|                               "end": 59 | ||||
|                             }, | ||||
|                             { | ||||
|                               "type": "PipeSubstitution", | ||||
|                     "type": "PipeSubstitution", | ||||
|                               "type": "UnboxedNode", | ||||
|                               "kind": { | ||||
|                                 "type": "PipeSubstitution" | ||||
|                               }, | ||||
|                               "start": 61, | ||||
|                               "end": 62 | ||||
|                             } | ||||
|                           ], | ||||
|                           "optional": false | ||||
|                         }, | ||||
|                         "start": 47, | ||||
|                         "end": 63 | ||||
|                       }, | ||||
|                       { | ||||
|                         "type": "CallExpression", | ||||
|                         "type": "UnboxedNode", | ||||
|                         "kind": { | ||||
|                           "type": "CallExpression", | ||||
|                 "start": 71, | ||||
|                 "end": 96, | ||||
|                           "callee": { | ||||
|                             "type": "UnboxedNode", | ||||
|                             "kind": { | ||||
|                               "type": "Identifier", | ||||
|                   "start": 71, | ||||
|                   "end": 84, | ||||
|                               "name": "tangentialArc" | ||||
|                             }, | ||||
|                             "start": 71, | ||||
|                             "end": 84 | ||||
|                           }, | ||||
|                           "arguments": [ | ||||
|                             { | ||||
|                               "type": "ArrayExpression", | ||||
|                               "type": "UnboxedNode", | ||||
|                               "kind": { | ||||
|                                 "type": "ArrayExpression", | ||||
|                     "start": 85, | ||||
|                     "end": 92, | ||||
|                                 "elements": [ | ||||
|                                   { | ||||
|                                     "type": "UnaryExpression", | ||||
|                                     "type": "UnboxedNode", | ||||
|                                     "kind": { | ||||
|                                       "type": "UnaryExpression", | ||||
|                         "start": 86, | ||||
|                         "end": 88, | ||||
|                                       "operator": "-", | ||||
|                                       "argument": { | ||||
|                                         "type": "Literal", | ||||
|                                         "type": "UnboxedNode", | ||||
|                                         "kind": { | ||||
|                                           "type": "Literal", | ||||
|                           "start": 87, | ||||
|                           "end": 88, | ||||
|                                           "value": 5, | ||||
|                                           "raw": "5" | ||||
|                                         }, | ||||
|                                         "start": 87, | ||||
|                                         "end": 88 | ||||
|                                       } | ||||
|                                     }, | ||||
|                                     "start": 86, | ||||
|                                     "end": 88 | ||||
|                                   }, | ||||
|                                   { | ||||
|                                     "type": "Literal", | ||||
|                                     "type": "UnboxedNode", | ||||
|                                     "kind": { | ||||
|                                       "type": "Literal", | ||||
|                         "start": 90, | ||||
|                         "end": 91, | ||||
|                                       "value": 5, | ||||
|                                       "raw": "5" | ||||
|                                     }, | ||||
|                                     "start": 90, | ||||
|                                     "end": 91 | ||||
|                                   } | ||||
|                                 ] | ||||
|                               }, | ||||
|                               "start": 85, | ||||
|                               "end": 92 | ||||
|                             }, | ||||
|                             { | ||||
|                               "type": "PipeSubstitution", | ||||
|                     "type": "PipeSubstitution", | ||||
|                               "type": "UnboxedNode", | ||||
|                               "kind": { | ||||
|                                 "type": "PipeSubstitution" | ||||
|                               }, | ||||
|                               "start": 94, | ||||
|                               "end": 95 | ||||
|                             } | ||||
|                           ], | ||||
|                           "optional": false | ||||
|                         }, | ||||
|                         "start": 71, | ||||
|                         "end": 96 | ||||
|                       }, | ||||
|                       { | ||||
|                         "type": "CallExpression", | ||||
|                         "type": "UnboxedNode", | ||||
|                         "kind": { | ||||
|                           "type": "CallExpression", | ||||
|                 "start": 104, | ||||
|                 "end": 121, | ||||
|                           "callee": { | ||||
|                             "type": "UnboxedNode", | ||||
|                             "kind": { | ||||
|                               "type": "Identifier", | ||||
|                   "start": 104, | ||||
|                   "end": 108, | ||||
|                               "name": "line" | ||||
|                             }, | ||||
|                             "start": 104, | ||||
|                             "end": 108 | ||||
|                           }, | ||||
|                           "arguments": [ | ||||
|                             { | ||||
|                               "type": "ArrayExpression", | ||||
|                               "type": "UnboxedNode", | ||||
|                               "kind": { | ||||
|                                 "type": "ArrayExpression", | ||||
|                     "start": 109, | ||||
|                     "end": 117, | ||||
|                                 "elements": [ | ||||
|                                   { | ||||
|                                     "type": "Literal", | ||||
|                                     "type": "UnboxedNode", | ||||
|                                     "kind": { | ||||
|                                       "type": "Literal", | ||||
|                         "start": 110, | ||||
|                         "end": 111, | ||||
|                                       "value": 5, | ||||
|                                       "raw": "5" | ||||
|                                     }, | ||||
|                                     "start": 110, | ||||
|                                     "end": 111 | ||||
|                                   }, | ||||
|                                   { | ||||
|                                     "type": "UnaryExpression", | ||||
|                                     "type": "UnboxedNode", | ||||
|                                     "kind": { | ||||
|                                       "type": "UnaryExpression", | ||||
|                         "start": 113, | ||||
|                         "end": 116, | ||||
|                                       "operator": "-", | ||||
|                                       "argument": { | ||||
|                                         "type": "Literal", | ||||
|                                         "type": "UnboxedNode", | ||||
|                                         "kind": { | ||||
|                                           "type": "Literal", | ||||
|                           "start": 114, | ||||
|                           "end": 116, | ||||
|                                           "value": 15, | ||||
|                                           "raw": "15" | ||||
|                                         }, | ||||
|                                         "start": 114, | ||||
|                                         "end": 116 | ||||
|                                       } | ||||
|                                     }, | ||||
|                                     "start": 113, | ||||
|                                     "end": 116 | ||||
|                                   } | ||||
|                                 ] | ||||
|                               }, | ||||
|                               "start": 109, | ||||
|                               "end": 117 | ||||
|                             }, | ||||
|                             { | ||||
|                               "type": "PipeSubstitution", | ||||
|                     "type": "PipeSubstitution", | ||||
|                               "type": "UnboxedNode", | ||||
|                               "kind": { | ||||
|                                 "type": "PipeSubstitution" | ||||
|                               }, | ||||
|                               "start": 119, | ||||
|                               "end": 120 | ||||
|                             } | ||||
|                           ], | ||||
|                           "optional": false | ||||
|                         }, | ||||
|                         "start": 104, | ||||
|                         "end": 121 | ||||
|                       }, | ||||
|                       { | ||||
|                         "type": "CallExpression", | ||||
|                         "type": "UnboxedNode", | ||||
|                         "kind": { | ||||
|                           "type": "CallExpression", | ||||
|                 "start": 129, | ||||
|                 "end": 143, | ||||
|                           "callee": { | ||||
|                             "type": "UnboxedNode", | ||||
|                             "kind": { | ||||
|                               "type": "Identifier", | ||||
|                   "start": 129, | ||||
|                   "end": 136, | ||||
|                               "name": "extrude" | ||||
|                             }, | ||||
|                             "start": 129, | ||||
|                             "end": 136 | ||||
|                           }, | ||||
|                           "arguments": [ | ||||
|                             { | ||||
|                               "type": "Literal", | ||||
|                               "type": "UnboxedNode", | ||||
|                               "kind": { | ||||
|                                 "type": "Literal", | ||||
|                     "start": 137, | ||||
|                     "end": 139, | ||||
|                                 "value": 10, | ||||
|                                 "raw": "10" | ||||
|                               }, | ||||
|                               "start": 137, | ||||
|                               "end": 139 | ||||
|                             }, | ||||
|                             { | ||||
|                               "type": "PipeSubstitution", | ||||
|                     "type": "PipeSubstitution", | ||||
|                               "type": "UnboxedNode", | ||||
|                               "kind": { | ||||
|                                 "type": "PipeSubstitution" | ||||
|                               }, | ||||
|                               "start": 141, | ||||
|                               "end": 142 | ||||
|                             } | ||||
|                           ], | ||||
|                           "optional": false | ||||
|                         }, | ||||
|                         "start": 129, | ||||
|                         "end": 143 | ||||
|                       } | ||||
|                     ] | ||||
|                   }, | ||||
|                   "start": 18, | ||||
|                   "end": 143 | ||||
|                 } | ||||
|               }, | ||||
|               "start": 6, | ||||
|               "end": 143 | ||||
|             } | ||||
|           ], | ||||
|           "kind": "const" | ||||
|         }, | ||||
|         "start": 0, | ||||
|         "end": 143 | ||||
|       } | ||||
|     ] | ||||
|   }, | ||||
|   "start": 0, | ||||
|   "end": 144 | ||||
| } | ||||
|  | ||||
| @ -1,44 +1,63 @@ | ||||
| --- | ||||
| source: kcl/src/parser/parser_impl.rs | ||||
| assertion_line: 3676 | ||||
| expression: actual | ||||
| --- | ||||
| { | ||||
|   "start": 0, | ||||
|   "end": 17, | ||||
|   "type": "UnboxedNode", | ||||
|   "kind": { | ||||
|     "body": [ | ||||
|       { | ||||
|         "type": "VariableDeclaration", | ||||
|         "type": "UnboxedNode", | ||||
|         "kind": { | ||||
|           "type": "VariableDeclaration", | ||||
|       "start": 0, | ||||
|       "end": 17, | ||||
|           "declarations": [ | ||||
|             { | ||||
|               "type": "UnboxedNode", | ||||
|               "kind": { | ||||
|                 "type": "VariableDeclarator", | ||||
|           "start": 6, | ||||
|           "end": 17, | ||||
|                 "id": { | ||||
|                   "type": "UnboxedNode", | ||||
|                   "kind": { | ||||
|                     "type": "Identifier", | ||||
|             "start": 6, | ||||
|             "end": 8, | ||||
|                     "name": "sg" | ||||
|                   }, | ||||
|                   "start": 6, | ||||
|                   "end": 8 | ||||
|                 }, | ||||
|                 "init": { | ||||
|                   "type": "UnaryExpression", | ||||
|                   "type": "UnboxedNode", | ||||
|                   "kind": { | ||||
|                     "type": "UnaryExpression", | ||||
|             "start": 11, | ||||
|             "end": 17, | ||||
|                     "operator": "-", | ||||
|                     "argument": { | ||||
|                       "type": "Identifier", | ||||
|                       "type": "UnboxedNode", | ||||
|                       "kind": { | ||||
|                         "type": "Identifier", | ||||
|               "start": 12, | ||||
|               "end": 17, | ||||
|                         "name": "scale" | ||||
|                       }, | ||||
|                       "start": 12, | ||||
|                       "end": 17 | ||||
|                     } | ||||
|                   }, | ||||
|                   "start": 11, | ||||
|                   "end": 17 | ||||
|                 } | ||||
|               }, | ||||
|               "start": 6, | ||||
|               "end": 17 | ||||
|             } | ||||
|           ], | ||||
|           "kind": "const" | ||||
|         }, | ||||
|         "start": 0, | ||||
|         "end": 17 | ||||
|       } | ||||
|     ] | ||||
|   }, | ||||
|   "start": 0, | ||||
|   "end": 17 | ||||
| } | ||||
|  | ||||
| @ -1,81 +1,115 @@ | ||||
| --- | ||||
| source: kcl/src/parser/parser_impl.rs | ||||
| assertion_line: 3677 | ||||
| expression: actual | ||||
| --- | ||||
| { | ||||
|   "start": 0, | ||||
|   "end": 23, | ||||
|   "type": "UnboxedNode", | ||||
|   "kind": { | ||||
|     "body": [ | ||||
|       { | ||||
|         "type": "ExpressionStatement", | ||||
|         "type": "UnboxedNode", | ||||
|         "kind": { | ||||
|           "type": "ExpressionStatement", | ||||
|       "start": 0, | ||||
|       "end": 23, | ||||
|           "expression": { | ||||
|             "type": "CallExpression", | ||||
|             "type": "UnboxedNode", | ||||
|             "kind": { | ||||
|               "type": "CallExpression", | ||||
|         "start": 0, | ||||
|         "end": 23, | ||||
|               "callee": { | ||||
|                 "type": "UnboxedNode", | ||||
|                 "kind": { | ||||
|                   "type": "Identifier", | ||||
|           "start": 0, | ||||
|           "end": 6, | ||||
|                   "name": "lineTo" | ||||
|                 }, | ||||
|                 "start": 0, | ||||
|                 "end": 6 | ||||
|               }, | ||||
|               "arguments": [ | ||||
|                 { | ||||
|                   "type": "ObjectExpression", | ||||
|                   "type": "UnboxedNode", | ||||
|                   "kind": { | ||||
|                     "type": "ObjectExpression", | ||||
|             "start": 7, | ||||
|             "end": 22, | ||||
|                     "properties": [ | ||||
|                       { | ||||
|                         "type": "UnboxedNode", | ||||
|                         "kind": { | ||||
|                           "type": "ObjectProperty", | ||||
|                 "start": 9, | ||||
|                 "end": 20, | ||||
|                           "key": { | ||||
|                             "type": "UnboxedNode", | ||||
|                             "kind": { | ||||
|                               "type": "Identifier", | ||||
|                   "start": 9, | ||||
|                   "end": 11, | ||||
|                               "name": "to" | ||||
|                             }, | ||||
|                             "start": 9, | ||||
|                             "end": 11 | ||||
|                           }, | ||||
|                           "value": { | ||||
|                             "type": "ArrayExpression", | ||||
|                             "type": "UnboxedNode", | ||||
|                             "kind": { | ||||
|                               "type": "ArrayExpression", | ||||
|                   "start": 13, | ||||
|                   "end": 20, | ||||
|                               "elements": [ | ||||
|                                 { | ||||
|                                   "type": "Literal", | ||||
|                                   "type": "UnboxedNode", | ||||
|                                   "kind": { | ||||
|                                     "type": "Literal", | ||||
|                       "start": 14, | ||||
|                       "end": 15, | ||||
|                                     "value": 0, | ||||
|                                     "raw": "0" | ||||
|                                   }, | ||||
|                                   "start": 14, | ||||
|                                   "end": 15 | ||||
|                                 }, | ||||
|                                 { | ||||
|                                   "type": "UnaryExpression", | ||||
|                                   "type": "UnboxedNode", | ||||
|                                   "kind": { | ||||
|                                     "type": "UnaryExpression", | ||||
|                       "start": 17, | ||||
|                       "end": 19, | ||||
|                                     "operator": "-", | ||||
|                                     "argument": { | ||||
|                                       "type": "Literal", | ||||
|                                       "type": "UnboxedNode", | ||||
|                                       "kind": { | ||||
|                                         "type": "Literal", | ||||
|                         "start": 18, | ||||
|                         "end": 19, | ||||
|                                         "value": 1, | ||||
|                                         "raw": "1" | ||||
|                                       }, | ||||
|                                       "start": 18, | ||||
|                                       "end": 19 | ||||
|                                     } | ||||
|                                   }, | ||||
|                                   "start": 17, | ||||
|                                   "end": 19 | ||||
|                                 } | ||||
|                               ] | ||||
|                             }, | ||||
|                             "start": 13, | ||||
|                             "end": 20 | ||||
|                           } | ||||
|                         }, | ||||
|                         "start": 9, | ||||
|                         "end": 20 | ||||
|                       } | ||||
|                     ] | ||||
|                   }, | ||||
|                   "start": 7, | ||||
|                   "end": 22 | ||||
|                 } | ||||
|               ], | ||||
|               "optional": false | ||||
|             }, | ||||
|             "start": 0, | ||||
|             "end": 23 | ||||
|           } | ||||
|         }, | ||||
|         "start": 0, | ||||
|         "end": 23 | ||||
|       } | ||||
|     ] | ||||
|   }, | ||||
|   "start": 0, | ||||
|   "end": 23 | ||||
| } | ||||
|  | ||||
| @ -1,53 +1,75 @@ | ||||
| --- | ||||
| source: kcl/src/parser/parser_impl.rs | ||||
| assertion_line: 3678 | ||||
| expression: actual | ||||
| --- | ||||
| { | ||||
|   "start": 0, | ||||
|   "end": 23, | ||||
|   "type": "UnboxedNode", | ||||
|   "kind": { | ||||
|     "body": [ | ||||
|       { | ||||
|         "type": "VariableDeclaration", | ||||
|         "type": "UnboxedNode", | ||||
|         "kind": { | ||||
|           "type": "VariableDeclaration", | ||||
|       "start": 0, | ||||
|       "end": 23, | ||||
|           "declarations": [ | ||||
|             { | ||||
|               "type": "UnboxedNode", | ||||
|               "kind": { | ||||
|                 "type": "VariableDeclarator", | ||||
|           "start": 6, | ||||
|           "end": 23, | ||||
|                 "id": { | ||||
|                   "type": "UnboxedNode", | ||||
|                   "kind": { | ||||
|                     "type": "Identifier", | ||||
|             "start": 6, | ||||
|             "end": 13, | ||||
|                     "name": "myArray" | ||||
|                   }, | ||||
|                   "start": 6, | ||||
|                   "end": 13 | ||||
|                 }, | ||||
|                 "init": { | ||||
|                   "type": "ArrayRangeExpression", | ||||
|                   "type": "UnboxedNode", | ||||
|                   "kind": { | ||||
|                     "type": "ArrayRangeExpression", | ||||
|             "start": 16, | ||||
|             "end": 23, | ||||
|                     "startElement": { | ||||
|                       "type": "Literal", | ||||
|                       "type": "UnboxedNode", | ||||
|                       "kind": { | ||||
|                         "type": "Literal", | ||||
|               "start": 17, | ||||
|               "end": 18, | ||||
|                         "value": 0, | ||||
|                         "raw": "0" | ||||
|                       }, | ||||
|                       "start": 17, | ||||
|                       "end": 18 | ||||
|                     }, | ||||
|                     "endElement": { | ||||
|                       "type": "Literal", | ||||
|                       "type": "UnboxedNode", | ||||
|                       "kind": { | ||||
|                         "type": "Literal", | ||||
|               "start": 20, | ||||
|               "end": 22, | ||||
|                         "value": 10, | ||||
|                         "raw": "10" | ||||
|                       }, | ||||
|                       "start": 20, | ||||
|                       "end": 22 | ||||
|                     }, | ||||
|                     "endInclusive": true | ||||
|                   }, | ||||
|                   "start": 16, | ||||
|                   "end": 23 | ||||
|                 } | ||||
|               }, | ||||
|               "start": 6, | ||||
|               "end": 23 | ||||
|             } | ||||
|           ], | ||||
|           "kind": "const" | ||||
|         }, | ||||
|         "start": 0, | ||||
|         "end": 23 | ||||
|       } | ||||
|     ] | ||||
|   }, | ||||
|   "start": 0, | ||||
|   "end": 23 | ||||
| } | ||||
|  | ||||
| @ -1,77 +1,111 @@ | ||||
| --- | ||||
| source: kcl/src/parser/parser_impl.rs | ||||
| assertion_line: 3679 | ||||
| expression: actual | ||||
| --- | ||||
| { | ||||
|   "start": 0, | ||||
|   "end": 80, | ||||
|   "type": "UnboxedNode", | ||||
|   "kind": { | ||||
|     "body": [ | ||||
|       { | ||||
|         "type": "VariableDeclaration", | ||||
|         "type": "UnboxedNode", | ||||
|         "kind": { | ||||
|           "type": "VariableDeclaration", | ||||
|       "start": 5, | ||||
|       "end": 57, | ||||
|           "declarations": [ | ||||
|             { | ||||
|               "type": "UnboxedNode", | ||||
|               "kind": { | ||||
|                 "type": "VariableDeclarator", | ||||
|           "start": 8, | ||||
|           "end": 57, | ||||
|                 "id": { | ||||
|                   "type": "UnboxedNode", | ||||
|                   "kind": { | ||||
|                     "type": "Identifier", | ||||
|             "start": 8, | ||||
|             "end": 24, | ||||
|                     "name": "firstPrimeNumber" | ||||
|                   }, | ||||
|                   "start": 8, | ||||
|                   "end": 24 | ||||
|                 }, | ||||
|                 "init": { | ||||
|                   "type": "FunctionExpression", | ||||
|                   "type": "UnboxedNode", | ||||
|                   "kind": { | ||||
|                     "type": "FunctionExpression", | ||||
|             "start": 27, | ||||
|             "end": 57, | ||||
|                     "params": [], | ||||
|                     "body": { | ||||
|               "start": 33, | ||||
|               "end": 57, | ||||
|                       "type": "UnboxedNode", | ||||
|                       "kind": { | ||||
|                         "body": [ | ||||
|                           { | ||||
|                             "type": "ReturnStatement", | ||||
|                             "type": "UnboxedNode", | ||||
|                             "kind": { | ||||
|                               "type": "ReturnStatement", | ||||
|                   "start": 43, | ||||
|                   "end": 51, | ||||
|                               "argument": { | ||||
|                                 "type": "Literal", | ||||
|                                 "type": "UnboxedNode", | ||||
|                                 "kind": { | ||||
|                                   "type": "Literal", | ||||
|                     "start": 50, | ||||
|                     "end": 51, | ||||
|                                   "value": 2, | ||||
|                                   "raw": "2" | ||||
|                                 }, | ||||
|                                 "start": 50, | ||||
|                                 "end": 51 | ||||
|                               } | ||||
|                             }, | ||||
|                             "start": 43, | ||||
|                             "end": 51 | ||||
|                           } | ||||
|                         ] | ||||
|                       }, | ||||
|                       "start": 33, | ||||
|                       "end": 57 | ||||
|                     } | ||||
|                   }, | ||||
|                   "start": 27, | ||||
|                   "end": 57 | ||||
|                 } | ||||
|               }, | ||||
|               "start": 8, | ||||
|               "end": 57 | ||||
|             } | ||||
|           ], | ||||
|           "kind": "fn" | ||||
|         }, | ||||
|         "start": 5, | ||||
|         "end": 57 | ||||
|       }, | ||||
|       { | ||||
|         "type": "ExpressionStatement", | ||||
|         "type": "UnboxedNode", | ||||
|         "kind": { | ||||
|           "type": "ExpressionStatement", | ||||
|       "start": 62, | ||||
|       "end": 80, | ||||
|           "expression": { | ||||
|             "type": "CallExpression", | ||||
|             "type": "UnboxedNode", | ||||
|             "kind": { | ||||
|               "type": "CallExpression", | ||||
|         "start": 62, | ||||
|         "end": 80, | ||||
|               "callee": { | ||||
|                 "type": "UnboxedNode", | ||||
|                 "kind": { | ||||
|                   "type": "Identifier", | ||||
|           "start": 62, | ||||
|           "end": 78, | ||||
|                   "name": "firstPrimeNumber" | ||||
|                 }, | ||||
|                 "start": 62, | ||||
|                 "end": 78 | ||||
|               }, | ||||
|               "arguments": [], | ||||
|               "optional": false | ||||
|             }, | ||||
|             "start": 62, | ||||
|             "end": 80 | ||||
|           } | ||||
|         }, | ||||
|         "start": 62, | ||||
|         "end": 80 | ||||
|       } | ||||
|     ] | ||||
|   }, | ||||
|   "start": 0, | ||||
|   "end": 80 | ||||
| } | ||||
|  | ||||
| @ -1,97 +1,137 @@ | ||||
| --- | ||||
| source: kcl/src/parser/parser_impl.rs | ||||
| assertion_line: 3687 | ||||
| expression: actual | ||||
| --- | ||||
| { | ||||
|   "start": 0, | ||||
|   "end": 66, | ||||
|   "type": "UnboxedNode", | ||||
|   "kind": { | ||||
|     "body": [ | ||||
|       { | ||||
|         "type": "VariableDeclaration", | ||||
|         "type": "UnboxedNode", | ||||
|         "kind": { | ||||
|           "type": "VariableDeclaration", | ||||
|       "start": 0, | ||||
|       "end": 49, | ||||
|           "declarations": [ | ||||
|             { | ||||
|               "type": "UnboxedNode", | ||||
|               "kind": { | ||||
|                 "type": "VariableDeclarator", | ||||
|           "start": 3, | ||||
|           "end": 49, | ||||
|                 "id": { | ||||
|                   "type": "UnboxedNode", | ||||
|                   "kind": { | ||||
|                     "type": "Identifier", | ||||
|             "start": 3, | ||||
|             "end": 8, | ||||
|                     "name": "thing" | ||||
|                   }, | ||||
|                   "start": 3, | ||||
|                   "end": 8 | ||||
|                 }, | ||||
|                 "init": { | ||||
|                   "type": "FunctionExpression", | ||||
|                   "type": "UnboxedNode", | ||||
|                   "kind": { | ||||
|                     "type": "FunctionExpression", | ||||
|             "start": 11, | ||||
|             "end": 49, | ||||
|                     "params": [ | ||||
|                       { | ||||
|                         "type": "Parameter", | ||||
|                         "identifier": { | ||||
|                           "type": "UnboxedNode", | ||||
|                           "kind": { | ||||
|                             "type": "Identifier", | ||||
|                   "start": 12, | ||||
|                   "end": 17, | ||||
|                             "name": "param" | ||||
|                           }, | ||||
|                           "start": 12, | ||||
|                           "end": 17 | ||||
|                         }, | ||||
|                         "optional": false | ||||
|                       } | ||||
|                     ], | ||||
|                     "body": { | ||||
|               "start": 22, | ||||
|               "end": 49, | ||||
|                       "type": "UnboxedNode", | ||||
|                       "kind": { | ||||
|                         "body": [ | ||||
|                           { | ||||
|                             "type": "ReturnStatement", | ||||
|                             "type": "UnboxedNode", | ||||
|                             "kind": { | ||||
|                               "type": "ReturnStatement", | ||||
|                   "start": 32, | ||||
|                   "end": 43, | ||||
|                               "argument": { | ||||
|                                 "type": "Literal", | ||||
|                                 "type": "UnboxedNode", | ||||
|                                 "kind": { | ||||
|                                   "type": "Literal", | ||||
|                     "start": 39, | ||||
|                     "end": 43, | ||||
|                                   "value": true, | ||||
|                                   "raw": "true" | ||||
|                                 }, | ||||
|                                 "start": 39, | ||||
|                                 "end": 43 | ||||
|                               } | ||||
|                             }, | ||||
|                             "start": 32, | ||||
|                             "end": 43 | ||||
|                           } | ||||
|                         ] | ||||
|                       }, | ||||
|                       "start": 22, | ||||
|                       "end": 49 | ||||
|                     } | ||||
|                   }, | ||||
|                   "start": 11, | ||||
|                   "end": 49 | ||||
|                 } | ||||
|               }, | ||||
|               "start": 3, | ||||
|               "end": 49 | ||||
|             } | ||||
|           ], | ||||
|           "kind": "fn" | ||||
|         }, | ||||
|         "start": 0, | ||||
|         "end": 49 | ||||
|       }, | ||||
|       { | ||||
|         "type": "ExpressionStatement", | ||||
|         "type": "UnboxedNode", | ||||
|         "kind": { | ||||
|           "type": "ExpressionStatement", | ||||
|       "start": 54, | ||||
|       "end": 66, | ||||
|           "expression": { | ||||
|             "type": "CallExpression", | ||||
|             "type": "UnboxedNode", | ||||
|             "kind": { | ||||
|               "type": "CallExpression", | ||||
|         "start": 54, | ||||
|         "end": 66, | ||||
|               "callee": { | ||||
|                 "type": "UnboxedNode", | ||||
|                 "kind": { | ||||
|                   "type": "Identifier", | ||||
|           "start": 54, | ||||
|           "end": 59, | ||||
|                   "name": "thing" | ||||
|                 }, | ||||
|                 "start": 54, | ||||
|                 "end": 59 | ||||
|               }, | ||||
|               "arguments": [ | ||||
|                 { | ||||
|                   "type": "Literal", | ||||
|                   "type": "UnboxedNode", | ||||
|                   "kind": { | ||||
|                     "type": "Literal", | ||||
|             "start": 60, | ||||
|             "end": 65, | ||||
|                     "value": false, | ||||
|                     "raw": "false" | ||||
|                   }, | ||||
|                   "start": 60, | ||||
|                   "end": 65 | ||||
|                 } | ||||
|               ], | ||||
|               "optional": false | ||||
|             }, | ||||
|             "start": 54, | ||||
|             "end": 66 | ||||
|           } | ||||
|         }, | ||||
|         "start": 54, | ||||
|         "end": 66 | ||||
|       } | ||||
|     ] | ||||
|   }, | ||||
|   "start": 0, | ||||
|   "end": 66 | ||||
| } | ||||
|  | ||||
| @ -1,247 +1,347 @@ | ||||
| --- | ||||
| source: kcl/src/parser/parser_impl.rs | ||||
| assertion_line: 3694 | ||||
| expression: actual | ||||
| --- | ||||
| { | ||||
|   "start": 0, | ||||
|   "end": 165, | ||||
|   "type": "UnboxedNode", | ||||
|   "kind": { | ||||
|     "body": [ | ||||
|       { | ||||
|         "type": "VariableDeclaration", | ||||
|         "type": "UnboxedNode", | ||||
|         "kind": { | ||||
|           "type": "VariableDeclaration", | ||||
|       "start": 0, | ||||
|       "end": 165, | ||||
|           "declarations": [ | ||||
|             { | ||||
|               "type": "UnboxedNode", | ||||
|               "kind": { | ||||
|                 "type": "VariableDeclarator", | ||||
|           "start": 6, | ||||
|           "end": 165, | ||||
|                 "id": { | ||||
|                   "type": "UnboxedNode", | ||||
|                   "kind": { | ||||
|                     "type": "Identifier", | ||||
|             "start": 6, | ||||
|             "end": 14, | ||||
|                     "name": "mySketch" | ||||
|                   }, | ||||
|                   "start": 6, | ||||
|                   "end": 14 | ||||
|                 }, | ||||
|                 "init": { | ||||
|                   "type": "PipeExpression", | ||||
|                   "type": "UnboxedNode", | ||||
|                   "kind": { | ||||
|                     "type": "PipeExpression", | ||||
|             "start": 17, | ||||
|             "end": 165, | ||||
|                     "body": [ | ||||
|                       { | ||||
|                         "type": "CallExpression", | ||||
|                         "type": "UnboxedNode", | ||||
|                         "kind": { | ||||
|                           "type": "CallExpression", | ||||
|                 "start": 17, | ||||
|                 "end": 37, | ||||
|                           "callee": { | ||||
|                             "type": "UnboxedNode", | ||||
|                             "kind": { | ||||
|                               "type": "Identifier", | ||||
|                   "start": 17, | ||||
|                   "end": 30, | ||||
|                               "name": "startSketchAt" | ||||
|                             }, | ||||
|                             "start": 17, | ||||
|                             "end": 30 | ||||
|                           }, | ||||
|                           "arguments": [ | ||||
|                             { | ||||
|                               "type": "ArrayExpression", | ||||
|                               "type": "UnboxedNode", | ||||
|                               "kind": { | ||||
|                                 "type": "ArrayExpression", | ||||
|                     "start": 31, | ||||
|                     "end": 36, | ||||
|                                 "elements": [ | ||||
|                                   { | ||||
|                                     "type": "Literal", | ||||
|                                     "type": "UnboxedNode", | ||||
|                                     "kind": { | ||||
|                                       "type": "Literal", | ||||
|                         "start": 32, | ||||
|                         "end": 33, | ||||
|                                       "value": 0, | ||||
|                                       "raw": "0" | ||||
|                                     }, | ||||
|                                     "start": 32, | ||||
|                                     "end": 33 | ||||
|                                   }, | ||||
|                                   { | ||||
|                                     "type": "Literal", | ||||
|                                     "type": "UnboxedNode", | ||||
|                                     "kind": { | ||||
|                                       "type": "Literal", | ||||
|                         "start": 34, | ||||
|                         "end": 35, | ||||
|                                       "value": 0, | ||||
|                                       "raw": "0" | ||||
|                                     }, | ||||
|                                     "start": 34, | ||||
|                                     "end": 35 | ||||
|                                   } | ||||
|                                 ] | ||||
|                               }, | ||||
|                               "start": 31, | ||||
|                               "end": 36 | ||||
|                             } | ||||
|                           ], | ||||
|                           "optional": false | ||||
|                         }, | ||||
|                         "start": 17, | ||||
|                         "end": 37 | ||||
|                       }, | ||||
|                       { | ||||
|                         "type": "CallExpression", | ||||
|                         "type": "UnboxedNode", | ||||
|                         "kind": { | ||||
|                           "type": "CallExpression", | ||||
|                 "start": 49, | ||||
|                 "end": 75, | ||||
|                           "callee": { | ||||
|                             "type": "UnboxedNode", | ||||
|                             "kind": { | ||||
|                               "type": "Identifier", | ||||
|                   "start": 49, | ||||
|                   "end": 55, | ||||
|                               "name": "lineTo" | ||||
|                             }, | ||||
|                             "start": 49, | ||||
|                             "end": 55 | ||||
|                           }, | ||||
|                           "arguments": [ | ||||
|                             { | ||||
|                               "type": "ArrayExpression", | ||||
|                               "type": "UnboxedNode", | ||||
|                               "kind": { | ||||
|                                 "type": "ArrayExpression", | ||||
|                     "start": 56, | ||||
|                     "end": 62, | ||||
|                                 "elements": [ | ||||
|                                   { | ||||
|                                     "type": "Literal", | ||||
|                                     "type": "UnboxedNode", | ||||
|                                     "kind": { | ||||
|                                       "type": "Literal", | ||||
|                         "start": 57, | ||||
|                         "end": 58, | ||||
|                                       "value": 0, | ||||
|                                       "raw": "0" | ||||
|                                     }, | ||||
|                                     "start": 57, | ||||
|                                     "end": 58 | ||||
|                                   }, | ||||
|                                   { | ||||
|                                     "type": "Literal", | ||||
|                                     "type": "UnboxedNode", | ||||
|                                     "kind": { | ||||
|                                       "type": "Literal", | ||||
|                         "start": 60, | ||||
|                         "end": 61, | ||||
|                                       "value": 1, | ||||
|                                       "raw": "1" | ||||
|                                     }, | ||||
|                                     "start": 60, | ||||
|                                     "end": 61 | ||||
|                                   } | ||||
|                                 ] | ||||
|                               }, | ||||
|                               "start": 56, | ||||
|                               "end": 62 | ||||
|                             }, | ||||
|                             { | ||||
|                               "type": "PipeSubstitution", | ||||
|                     "type": "PipeSubstitution", | ||||
|                               "type": "UnboxedNode", | ||||
|                               "kind": { | ||||
|                                 "type": "PipeSubstitution" | ||||
|                               }, | ||||
|                               "start": 64, | ||||
|                               "end": 65 | ||||
|                             }, | ||||
|                             { | ||||
|                               "type": "TagDeclarator", | ||||
|                               "type": "UnboxedNode", | ||||
|                               "kind": { | ||||
|                                 "type": "TagDeclarator", | ||||
|                     "start": 67, | ||||
|                     "end": 74, | ||||
|                                 "value": "myPath" | ||||
|                               }, | ||||
|                               "start": 67, | ||||
|                               "end": 74 | ||||
|                             } | ||||
|                           ], | ||||
|                           "optional": false | ||||
|                         }, | ||||
|                         "start": 49, | ||||
|                         "end": 75 | ||||
|                       }, | ||||
|                       { | ||||
|                         "type": "CallExpression", | ||||
|                         "type": "UnboxedNode", | ||||
|                         "kind": { | ||||
|                           "type": "CallExpression", | ||||
|                 "start": 87, | ||||
|                 "end": 104, | ||||
|                           "callee": { | ||||
|                             "type": "UnboxedNode", | ||||
|                             "kind": { | ||||
|                               "type": "Identifier", | ||||
|                   "start": 87, | ||||
|                   "end": 93, | ||||
|                               "name": "lineTo" | ||||
|                             }, | ||||
|                             "start": 87, | ||||
|                             "end": 93 | ||||
|                           }, | ||||
|                           "arguments": [ | ||||
|                             { | ||||
|                               "type": "ArrayExpression", | ||||
|                               "type": "UnboxedNode", | ||||
|                               "kind": { | ||||
|                                 "type": "ArrayExpression", | ||||
|                     "start": 94, | ||||
|                     "end": 100, | ||||
|                                 "elements": [ | ||||
|                                   { | ||||
|                                     "type": "Literal", | ||||
|                                     "type": "UnboxedNode", | ||||
|                                     "kind": { | ||||
|                                       "type": "Literal", | ||||
|                         "start": 95, | ||||
|                         "end": 96, | ||||
|                                       "value": 1, | ||||
|                                       "raw": "1" | ||||
|                                     }, | ||||
|                                     "start": 95, | ||||
|                                     "end": 96 | ||||
|                                   }, | ||||
|                                   { | ||||
|                                     "type": "Literal", | ||||
|                                     "type": "UnboxedNode", | ||||
|                                     "kind": { | ||||
|                                       "type": "Literal", | ||||
|                         "start": 98, | ||||
|                         "end": 99, | ||||
|                                       "value": 1, | ||||
|                                       "raw": "1" | ||||
|                                     }, | ||||
|                                     "start": 98, | ||||
|                                     "end": 99 | ||||
|                                   } | ||||
|                                 ] | ||||
|                               }, | ||||
|                               "start": 94, | ||||
|                               "end": 100 | ||||
|                             }, | ||||
|                             { | ||||
|                               "type": "PipeSubstitution", | ||||
|                     "type": "PipeSubstitution", | ||||
|                               "type": "UnboxedNode", | ||||
|                               "kind": { | ||||
|                                 "type": "PipeSubstitution" | ||||
|                               }, | ||||
|                               "start": 102, | ||||
|                               "end": 103 | ||||
|                             } | ||||
|                           ], | ||||
|                           "optional": false | ||||
|                         }, | ||||
|                         "start": 87, | ||||
|                         "end": 104 | ||||
|                       }, | ||||
|                       { | ||||
|                         "type": "CallExpression", | ||||
|                         "type": "UnboxedNode", | ||||
|                         "kind": { | ||||
|                           "type": "CallExpression", | ||||
|                 "start": 116, | ||||
|                 "end": 145, | ||||
|                           "callee": { | ||||
|                             "type": "UnboxedNode", | ||||
|                             "kind": { | ||||
|                               "type": "Identifier", | ||||
|                   "start": 116, | ||||
|                   "end": 122, | ||||
|                               "name": "lineTo" | ||||
|                             }, | ||||
|                             "start": 116, | ||||
|                             "end": 122 | ||||
|                           }, | ||||
|                           "arguments": [ | ||||
|                             { | ||||
|                               "type": "ArrayExpression", | ||||
|                               "type": "UnboxedNode", | ||||
|                               "kind": { | ||||
|                                 "type": "ArrayExpression", | ||||
|                     "start": 123, | ||||
|                     "end": 129, | ||||
|                                 "elements": [ | ||||
|                                   { | ||||
|                                     "type": "Literal", | ||||
|                                     "type": "UnboxedNode", | ||||
|                                     "kind": { | ||||
|                                       "type": "Literal", | ||||
|                         "start": 124, | ||||
|                         "end": 125, | ||||
|                                       "value": 1, | ||||
|                                       "raw": "1" | ||||
|                                     }, | ||||
|                                     "start": 124, | ||||
|                                     "end": 125 | ||||
|                                   }, | ||||
|                                   { | ||||
|                                     "type": "Literal", | ||||
|                                     "type": "UnboxedNode", | ||||
|                                     "kind": { | ||||
|                                       "type": "Literal", | ||||
|                         "start": 127, | ||||
|                         "end": 128, | ||||
|                                       "value": 0, | ||||
|                                       "raw": "0" | ||||
|                                     }, | ||||
|                                     "start": 127, | ||||
|                                     "end": 128 | ||||
|                                   } | ||||
|                                 ] | ||||
|                               }, | ||||
|                               "start": 123, | ||||
|                               "end": 129 | ||||
|                             }, | ||||
|                             { | ||||
|                               "type": "PipeSubstitution", | ||||
|                     "type": "PipeSubstitution", | ||||
|                               "type": "UnboxedNode", | ||||
|                               "kind": { | ||||
|                                 "type": "PipeSubstitution" | ||||
|                               }, | ||||
|                               "start": 131, | ||||
|                               "end": 132 | ||||
|                             }, | ||||
|                             { | ||||
|                               "type": "TagDeclarator", | ||||
|                               "type": "UnboxedNode", | ||||
|                               "kind": { | ||||
|                                 "type": "TagDeclarator", | ||||
|                     "start": 134, | ||||
|                     "end": 144, | ||||
|                                 "value": "rightPath" | ||||
|                               }, | ||||
|                               "start": 134, | ||||
|                               "end": 144 | ||||
|                             } | ||||
|                           ], | ||||
|                           "optional": false | ||||
|                         }, | ||||
|                         "start": 116, | ||||
|                         "end": 145 | ||||
|                       }, | ||||
|                       { | ||||
|                         "type": "CallExpression", | ||||
|                         "type": "UnboxedNode", | ||||
|                         "kind": { | ||||
|                           "type": "CallExpression", | ||||
|                 "start": 157, | ||||
|                 "end": 165, | ||||
|                           "callee": { | ||||
|                             "type": "UnboxedNode", | ||||
|                             "kind": { | ||||
|                               "type": "Identifier", | ||||
|                   "start": 157, | ||||
|                   "end": 162, | ||||
|                               "name": "close" | ||||
|                             }, | ||||
|                             "start": 157, | ||||
|                             "end": 162 | ||||
|                           }, | ||||
|                           "arguments": [ | ||||
|                             { | ||||
|                               "type": "PipeSubstitution", | ||||
|                     "type": "PipeSubstitution", | ||||
|                               "type": "UnboxedNode", | ||||
|                               "kind": { | ||||
|                                 "type": "PipeSubstitution" | ||||
|                               }, | ||||
|                               "start": 163, | ||||
|                               "end": 164 | ||||
|                             } | ||||
|                           ], | ||||
|                           "optional": false | ||||
|                         }, | ||||
|                         "start": 157, | ||||
|                         "end": 165 | ||||
|                       } | ||||
|                     ] | ||||
|                   }, | ||||
|                   "start": 17, | ||||
|                   "end": 165 | ||||
|                 } | ||||
|               }, | ||||
|               "start": 6, | ||||
|               "end": 165 | ||||
|             } | ||||
|           ], | ||||
|           "kind": "const" | ||||
|         }, | ||||
|         "start": 0, | ||||
|         "end": 165 | ||||
|       } | ||||
|     ] | ||||
|   }, | ||||
|   "start": 0, | ||||
|   "end": 165 | ||||
| } | ||||
|  | ||||
| @ -1,143 +1,201 @@ | ||||
| --- | ||||
| source: kcl/src/parser/parser_impl.rs | ||||
| assertion_line: 3702 | ||||
| expression: actual | ||||
| --- | ||||
| { | ||||
|   "start": 0, | ||||
|   "end": 70, | ||||
|   "type": "UnboxedNode", | ||||
|   "kind": { | ||||
|     "body": [ | ||||
|       { | ||||
|         "type": "VariableDeclaration", | ||||
|         "type": "UnboxedNode", | ||||
|         "kind": { | ||||
|           "type": "VariableDeclaration", | ||||
|       "start": 0, | ||||
|       "end": 70, | ||||
|           "declarations": [ | ||||
|             { | ||||
|               "type": "UnboxedNode", | ||||
|               "kind": { | ||||
|                 "type": "VariableDeclarator", | ||||
|           "start": 6, | ||||
|           "end": 70, | ||||
|                 "id": { | ||||
|                   "type": "UnboxedNode", | ||||
|                   "kind": { | ||||
|                     "type": "Identifier", | ||||
|             "start": 6, | ||||
|             "end": 14, | ||||
|                     "name": "mySketch" | ||||
|                   }, | ||||
|                   "start": 6, | ||||
|                   "end": 14 | ||||
|                 }, | ||||
|                 "init": { | ||||
|                   "type": "PipeExpression", | ||||
|                   "type": "UnboxedNode", | ||||
|                   "kind": { | ||||
|                     "type": "PipeExpression", | ||||
|             "start": 17, | ||||
|             "end": 70, | ||||
|                     "body": [ | ||||
|                       { | ||||
|                         "type": "CallExpression", | ||||
|                         "type": "UnboxedNode", | ||||
|                         "kind": { | ||||
|                           "type": "CallExpression", | ||||
|                 "start": 17, | ||||
|                 "end": 37, | ||||
|                           "callee": { | ||||
|                             "type": "UnboxedNode", | ||||
|                             "kind": { | ||||
|                               "type": "Identifier", | ||||
|                   "start": 17, | ||||
|                   "end": 30, | ||||
|                               "name": "startSketchAt" | ||||
|                             }, | ||||
|                             "start": 17, | ||||
|                             "end": 30 | ||||
|                           }, | ||||
|                           "arguments": [ | ||||
|                             { | ||||
|                               "type": "ArrayExpression", | ||||
|                               "type": "UnboxedNode", | ||||
|                               "kind": { | ||||
|                                 "type": "ArrayExpression", | ||||
|                     "start": 31, | ||||
|                     "end": 36, | ||||
|                                 "elements": [ | ||||
|                                   { | ||||
|                                     "type": "Literal", | ||||
|                                     "type": "UnboxedNode", | ||||
|                                     "kind": { | ||||
|                                       "type": "Literal", | ||||
|                         "start": 32, | ||||
|                         "end": 33, | ||||
|                                       "value": 0, | ||||
|                                       "raw": "0" | ||||
|                                     }, | ||||
|                                     "start": 32, | ||||
|                                     "end": 33 | ||||
|                                   }, | ||||
|                                   { | ||||
|                                     "type": "Literal", | ||||
|                                     "type": "UnboxedNode", | ||||
|                                     "kind": { | ||||
|                                       "type": "Literal", | ||||
|                         "start": 34, | ||||
|                         "end": 35, | ||||
|                                       "value": 0, | ||||
|                                       "raw": "0" | ||||
|                                     }, | ||||
|                                     "start": 34, | ||||
|                                     "end": 35 | ||||
|                                   } | ||||
|                                 ] | ||||
|                               }, | ||||
|                               "start": 31, | ||||
|                               "end": 36 | ||||
|                             } | ||||
|                           ], | ||||
|                           "optional": false | ||||
|                         }, | ||||
|                         "start": 17, | ||||
|                         "end": 37 | ||||
|                       }, | ||||
|                       { | ||||
|                         "type": "CallExpression", | ||||
|                         "type": "UnboxedNode", | ||||
|                         "kind": { | ||||
|                           "type": "CallExpression", | ||||
|                 "start": 41, | ||||
|                 "end": 58, | ||||
|                           "callee": { | ||||
|                             "type": "UnboxedNode", | ||||
|                             "kind": { | ||||
|                               "type": "Identifier", | ||||
|                   "start": 41, | ||||
|                   "end": 47, | ||||
|                               "name": "lineTo" | ||||
|                             }, | ||||
|                             "start": 41, | ||||
|                             "end": 47 | ||||
|                           }, | ||||
|                           "arguments": [ | ||||
|                             { | ||||
|                               "type": "ArrayExpression", | ||||
|                               "type": "UnboxedNode", | ||||
|                               "kind": { | ||||
|                                 "type": "ArrayExpression", | ||||
|                     "start": 48, | ||||
|                     "end": 54, | ||||
|                                 "elements": [ | ||||
|                                   { | ||||
|                                     "type": "Literal", | ||||
|                                     "type": "UnboxedNode", | ||||
|                                     "kind": { | ||||
|                                       "type": "Literal", | ||||
|                         "start": 49, | ||||
|                         "end": 50, | ||||
|                                       "value": 1, | ||||
|                                       "raw": "1" | ||||
|                                     }, | ||||
|                                     "start": 49, | ||||
|                                     "end": 50 | ||||
|                                   }, | ||||
|                                   { | ||||
|                                     "type": "Literal", | ||||
|                                     "type": "UnboxedNode", | ||||
|                                     "kind": { | ||||
|                                       "type": "Literal", | ||||
|                         "start": 52, | ||||
|                         "end": 53, | ||||
|                                       "value": 1, | ||||
|                                       "raw": "1" | ||||
|                                     }, | ||||
|                                     "start": 52, | ||||
|                                     "end": 53 | ||||
|                                   } | ||||
|                                 ] | ||||
|                               }, | ||||
|                               "start": 48, | ||||
|                               "end": 54 | ||||
|                             }, | ||||
|                             { | ||||
|                               "type": "PipeSubstitution", | ||||
|                     "type": "PipeSubstitution", | ||||
|                               "type": "UnboxedNode", | ||||
|                               "kind": { | ||||
|                                 "type": "PipeSubstitution" | ||||
|                               }, | ||||
|                               "start": 56, | ||||
|                               "end": 57 | ||||
|                             } | ||||
|                           ], | ||||
|                           "optional": false | ||||
|                         }, | ||||
|                         "start": 41, | ||||
|                         "end": 58 | ||||
|                       }, | ||||
|                       { | ||||
|                         "type": "CallExpression", | ||||
|                         "type": "UnboxedNode", | ||||
|                         "kind": { | ||||
|                           "type": "CallExpression", | ||||
|                 "start": 62, | ||||
|                 "end": 70, | ||||
|                           "callee": { | ||||
|                             "type": "UnboxedNode", | ||||
|                             "kind": { | ||||
|                               "type": "Identifier", | ||||
|                   "start": 62, | ||||
|                   "end": 67, | ||||
|                               "name": "close" | ||||
|                             }, | ||||
|                             "start": 62, | ||||
|                             "end": 67 | ||||
|                           }, | ||||
|                           "arguments": [ | ||||
|                             { | ||||
|                               "type": "PipeSubstitution", | ||||
|                     "type": "PipeSubstitution", | ||||
|                               "type": "UnboxedNode", | ||||
|                               "kind": { | ||||
|                                 "type": "PipeSubstitution" | ||||
|                               }, | ||||
|                               "start": 68, | ||||
|                               "end": 69 | ||||
|                             } | ||||
|                           ], | ||||
|                           "optional": false | ||||
|                         }, | ||||
|                         "start": 62, | ||||
|                         "end": 70 | ||||
|                       } | ||||
|                     ] | ||||
|                   }, | ||||
|                   "start": 17, | ||||
|                   "end": 70 | ||||
|                 } | ||||
|               }, | ||||
|               "start": 6, | ||||
|               "end": 70 | ||||
|             } | ||||
|           ], | ||||
|           "kind": "const" | ||||
|         }, | ||||
|         "start": 0, | ||||
|         "end": 70 | ||||
|       } | ||||
|     ] | ||||
|   }, | ||||
|   "start": 0, | ||||
|   "end": 70 | ||||
| } | ||||
|  | ||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user
	