This commit is contained in:
Adam Chalmers
2025-01-09 15:03:35 -06:00
committed by Nick Cameron
parent 18b1d84e5c
commit cd28a4a9a1
4 changed files with 10 additions and 7 deletions

View File

@ -503,7 +503,11 @@ ${!replace1 ? ` |> ${line}\n` : ''} |> angledLine([-65, ${
`
test.each([
['line', 'line(end = [306.21, 198.85], tag = $a)', ['365.11', '33']],
['lineTo', 'line(endAbsolute = [306.21, 198.85], tag = $a)', ['110.48', '119.73']],
[
'lineTo',
'line(endAbsolute = [306.21, 198.85], tag = $a)',
['110.48', '119.73'],
],
['yLine', 'yLine(198.85, %, $a)', ['198.85', '90']],
['xLine', 'xLine(198.85, %, $a)', ['198.85', '0']],
['yLineTo', 'yLineTo(198.85, %, $a)', ['95.94', '90']],

View File

@ -1018,10 +1018,7 @@ export function giveSketchFnCallTag(
const { node: primaryCallExp } = kwCallNode
const existingTag = findKwArg(ARG_TAG, primaryCallExp)
const tagDeclarator =
existingTag ||
(createTagDeclarator(
tag || findUniqueName(ast, 'seg', 2)
))
existingTag || createTagDeclarator(tag || findUniqueName(ast, 'seg', 2))
const isTagExisting = !!existingTag
kwCallNode.node.arguments.push(createLabeledArg(ARG_TAG, tagDeclarator))
return { tagDeclarator, isTagExisting }

View File

@ -240,7 +240,9 @@ describe('testing addTagForSketchOnFace', () => {
if (err(sketchOnFaceRetVal)) return sketchOnFaceRetVal
const { modifiedAst } = sketchOnFaceRetVal
const expectedCode = genCode('line(endAbsolute = [-1.59, -1.54], tag = $seg01)')
const expectedCode = genCode(
'line(endAbsolute = [-1.59, -1.54], tag = $seg01)'
)
expect(recast(modifiedAst)).toBe(expectedCode)
})
const chamferTestCases = [

View File

@ -1612,7 +1612,7 @@ export function getTransformInfos(
const node = nodeMeta.node
if (node?.type === 'CallExpression') {
return getTransformInfo(node, constraintType)
return getTransformInfo(node, constraintType)
}
if (node?.type === 'CallExpressionKw') {