KCL: Angled line should use keyword args (#5803)

We continue migrating KCL stdlib functions to use keyword arguments. Next up is the `angledLine` family of functions (except `angledLineThatIntersects, which will be a quick follow-up).

Before vs. after:

`angledLine({angle = 90, length = 3}, %, $edge)`
  => `angledLine(angle = 90, length = 3, tag = $edge)`

`angledLineOfXLength({angle = 90, length = 3}, %, $edge)`
  => `angledLine(angle = 90, lengthX = 3, tag = $edge)`

`angledLineOfYLength({angle = 90, length = 3}, %, $edge)`
  => `angledLine(angle = 90, lengthY = 3, tag = $edge)`

`angledLineToX({angle = 90, length = 3}, %, $edge)`
  => `angledLine(angle = 90, endAbsoluteX = 3, tag = $edge)`

`angledLineToY({angle = 90, length = 3}, %, $edge)`
  => `angledLine(angle = 90, endAbsoluteY = 3, tag = $edge)`
This commit is contained in:
Adam Chalmers
2025-04-09 14:55:15 -05:00
committed by GitHub
parent b03ca30379
commit d275995dfe
288 changed files with 36142 additions and 40081 deletions

View File

@ -1,6 +1,7 @@
import type { ImportStatement } from '@rust/kcl-lib/bindings/ImportStatement'
import type { Name } from '@rust/kcl-lib/bindings/Name'
import type { Node } from '@rust/kcl-lib/bindings/Node'
import { type NonCodeMeta } from '@rust/kcl-lib/bindings/NonCodeMeta'
import type { TagDeclarator } from '@rust/kcl-lib/bindings/TagDeclarator'
import type { ImportPath } from '@rust/kcl-lib/bindings/ImportPath'
@ -163,7 +164,8 @@ export const nonCodeMetaEmpty = () => {
export function createCallExpressionStdLibKw(
name: string,
unlabeled: CallExpressionKw['unlabeled'],
args: CallExpressionKw['arguments']
args: CallExpressionKw['arguments'],
nonCodeMeta?: NonCodeMeta
): Node<CallExpressionKw> {
return {
type: 'CallExpressionKw',
@ -173,7 +175,7 @@ export function createCallExpressionStdLibKw(
outerAttrs: [],
preComments: [],
commentStart: 0,
nonCodeMeta: nonCodeMetaEmpty(),
nonCodeMeta: nonCodeMeta ?? nonCodeMetaEmpty(),
callee: createLocalName(name),
unlabeled,
arguments: args,