Fix loft
This commit is contained in:
@ -439,9 +439,11 @@ export function loftSketches(
|
|||||||
const modifiedAst = structuredClone(node)
|
const modifiedAst = structuredClone(node)
|
||||||
const name = findUniqueName(node, KCL_DEFAULT_CONSTANT_PREFIXES.LOFT)
|
const name = findUniqueName(node, KCL_DEFAULT_CONSTANT_PREFIXES.LOFT)
|
||||||
const elements = declarators.map((d) => createLocalName(d.id.name))
|
const elements = declarators.map((d) => createLocalName(d.id.name))
|
||||||
const loft = createCallExpressionStdLib('loft', [
|
const loft = createCallExpressionStdLibKw(
|
||||||
|
'loft',
|
||||||
createArrayExpression(elements),
|
createArrayExpression(elements),
|
||||||
])
|
[]
|
||||||
|
)
|
||||||
const declaration = createVariableDeclaration(name, loft)
|
const declaration = createVariableDeclaration(name, loft)
|
||||||
modifiedAst.body.push(declaration)
|
modifiedAst.body.push(declaration)
|
||||||
const pathToNode: PathToNode = [
|
const pathToNode: PathToNode = [
|
||||||
|
|||||||
@ -207,11 +207,11 @@ export async function deleteFromSelection(
|
|||||||
extrudeNameToDelete = dec.id.name
|
extrudeNameToDelete = dec.id.name
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
// TODO: This is wrong, loft is now a CallExpressionKw.
|
dec.init.type === 'CallExpressionKw' &&
|
||||||
dec.init.type === 'CallExpression' &&
|
|
||||||
dec.init.callee.name.name === 'loft' &&
|
dec.init.callee.name.name === 'loft' &&
|
||||||
dec.init.arguments?.[0].type === 'ArrayExpression' &&
|
dec.init.unlabeled !== null &&
|
||||||
dec.init.arguments?.[0].elements.some(
|
dec.init.unlabeled.type === 'ArrayExpression' &&
|
||||||
|
dec.init.unlabeled.elements.some(
|
||||||
(a) => a.type === 'Name' && a.name.name === varDecName
|
(a) => a.type === 'Name' && a.name.name === varDecName
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
|
|||||||
Reference in New Issue
Block a user