From 7bf116629faa1d47e62ac37fc71a7092d86b6461 Mon Sep 17 00:00:00 2001 From: Kurt Hutten Date: Thu, 11 Apr 2024 10:35:23 +1000 Subject: [PATCH] clean up very old ast mod (#2060) * clean up very old ast mod * typo --- src/lang/modifyAst.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/lang/modifyAst.ts b/src/lang/modifyAst.ts index 8bef7c279..b185a485c 100644 --- a/src/lang/modifyAst.ts +++ b/src/lang/modifyAst.ts @@ -241,7 +241,6 @@ export function extrudeSketch( pathToExtrudeArg: PathToNode } { const _node = { ...node } - const dumbyStartend = { start: 0, end: 0 } const { node: sketchExpression } = getNodeFromPath( _node, pathToNode, @@ -256,18 +255,14 @@ export function extrudeSketch( ) const isInPipeExpression = pipeExpression.type === 'PipeExpression' - const { node: variableDeclorator, shallowPath: pathToDecleration } = + const { node: variableDeclarator, shallowPath: pathToDecleration } = getNodeFromPath(_node, pathToNode, 'VariableDeclarator') const extrudeCall = createCallExpressionStdLib('extrude', [ distance, shouldPipe ? createPipeSubstitution() - : { - type: 'Identifier', - ...dumbyStartend, - name: variableDeclorator.id.name, - }, + : createIdentifier(variableDeclarator.id.name), ]) if (shouldPipe) { @@ -277,7 +272,7 @@ export function extrudeSketch( : [sketchExpression as any, extrudeCall] ) - variableDeclorator.init = pipeChain + variableDeclarator.init = pipeChain const pathToExtrudeArg: PathToNode = [ ...pathToDecleration, ['init', 'VariableDeclarator'],