clean up very old ast mod (#2060)

* clean up very old ast mod

* typo
This commit is contained in:
Kurt Hutten
2024-04-11 10:35:23 +10:00
committed by GitHub
parent fe45b5b54d
commit 7bf116629f

View File

@ -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<VariableDeclarator>(_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'],