Compare commits
9 Commits
bug-fillet
...
achalmers/
Author | SHA1 | Date | |
---|---|---|---|
9a3fc3bdce | |||
4fe8741ea7 | |||
75916d4300 | |||
e65a6b6a38 | |||
86a83cadd3 | |||
00553c34ab | |||
ace9a59a45 | |||
09ebb517d9 | |||
1c697d30ee |
@ -144,11 +144,11 @@ layout: manual
|
|||||||
See also the [types overview](types)
|
See also the [types overview](types)
|
||||||
|
|
||||||
* **Primitive types**
|
* **Primitive types**
|
||||||
* [`End`](kcl/types.md#End)
|
* [`End`](kcl/types#End)
|
||||||
* [`ImportedGeometry`](kcl/types.md#ImportedGeometry)
|
* [`ImportedGeometry`](kcl/types#ImportedGeometry)
|
||||||
* [`Start`](kcl/types.md#Start)
|
* [`Start`](kcl/types#Start)
|
||||||
* [`TagDeclarator`](kcl/types.md#TagDeclarator)
|
* [`TagDeclarator`](kcl/types#TagDeclarator)
|
||||||
* [`TagIdentifier`](kcl/types.md#TagIdentifier)
|
* [`TagIdentifier`](kcl/types#TagIdentifier)
|
||||||
* [`any`](kcl/types/std-types-any)
|
* [`any`](kcl/types/std-types-any)
|
||||||
* [`bool`](kcl/types/std-types-bool)
|
* [`bool`](kcl/types/std-types-bool)
|
||||||
* [`number`](kcl/types/std-types-number)
|
* [`number`](kcl/types/std-types-number)
|
||||||
|
@ -111,9 +111,25 @@ test.describe('Point and click for boolean workflows', () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
await cmdBar.submit()
|
await cmdBar.submit()
|
||||||
|
await scene.settled(cmdBar)
|
||||||
await editor.expectEditor.toContain(operation.code)
|
await editor.expectEditor.toContain(operation.code)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
await test.step(`Delete ${operationName} operation via feature tree selection`, async () => {
|
||||||
|
await toolbar.openPane('feature-tree')
|
||||||
|
const op = await toolbar.getFeatureTreeOperation(operationName, 0)
|
||||||
|
await op.click({ button: 'right' })
|
||||||
|
await page.getByTestId('context-menu-delete').click()
|
||||||
|
await scene.settled(cmdBar)
|
||||||
|
await toolbar.closePane('feature-tree')
|
||||||
|
|
||||||
|
// Expect changes in ft and code
|
||||||
|
await toolbar.openPane('code')
|
||||||
|
await editor.expectEditor.not.toContain(operation.code)
|
||||||
|
await expect(
|
||||||
|
await toolbar.getFeatureTreeOperation(operationName, 0)
|
||||||
|
).not.toBeVisible()
|
||||||
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -871,14 +871,18 @@ a1 = startSketchOn(offsetPlane(XY, offset = 10))
|
|||||||
await page.keyboard.press('Enter')
|
await page.keyboard.press('Enter')
|
||||||
await page.keyboard.type(`extrusion = startSketchOn(XY)
|
await page.keyboard.type(`extrusion = startSketchOn(XY)
|
||||||
|> circle(center = [0, 0], radius = dia/2)
|
|> circle(center = [0, 0], radius = dia/2)
|
||||||
|> subtract2d(tool = squareHole(length, width, height))
|
|> subtract2d(tool = squareHole(l = length, w = width, height))
|
||||||
|> extrude(length = height)`)
|
|> extrude(length = height)`)
|
||||||
|
|
||||||
// error in gutter
|
// error in gutter
|
||||||
await expect(page.locator('.cm-lint-marker-error').first()).toBeVisible()
|
await expect(page.locator('.cm-lint-marker-error').first()).toBeVisible()
|
||||||
await page.hover('.cm-lint-marker-error:first-child')
|
await page.hover('.cm-lint-marker-error:first-child')
|
||||||
await expect(
|
await expect(
|
||||||
page.getByText('Expected 2 arguments, got 3').first()
|
page
|
||||||
|
.getByText(
|
||||||
|
'TODO ADAM: find the right error Expected 2 arguments, got 3'
|
||||||
|
)
|
||||||
|
.first()
|
||||||
).toBeVisible()
|
).toBeVisible()
|
||||||
|
|
||||||
// Make sure there are two diagnostics
|
// Make sure there are two diagnostics
|
||||||
|
@ -3,7 +3,7 @@ import * as fsp from 'fs/promises'
|
|||||||
|
|
||||||
import { expect, test } from '@e2e/playwright/zoo-test'
|
import { expect, test } from '@e2e/playwright/zoo-test'
|
||||||
|
|
||||||
const FEATURE_TREE_EXAMPLE_CODE = `export fn timesFive(x) {
|
const FEATURE_TREE_EXAMPLE_CODE = `export fn timesFive(@x) {
|
||||||
return 5 * x
|
return 5 * x
|
||||||
}
|
}
|
||||||
export fn triangle() {
|
export fn triangle() {
|
||||||
|
@ -24,6 +24,7 @@ export class HomePageFixture {
|
|||||||
projectTextName!: Locator
|
projectTextName!: Locator
|
||||||
sortByDateBtn!: Locator
|
sortByDateBtn!: Locator
|
||||||
sortByNameBtn!: Locator
|
sortByNameBtn!: Locator
|
||||||
|
tutorialBtn!: Locator
|
||||||
|
|
||||||
constructor(page: Page) {
|
constructor(page: Page) {
|
||||||
this.page = page
|
this.page = page
|
||||||
@ -43,6 +44,7 @@ export class HomePageFixture {
|
|||||||
|
|
||||||
this.sortByDateBtn = this.page.getByTestId('home-sort-by-modified')
|
this.sortByDateBtn = this.page.getByTestId('home-sort-by-modified')
|
||||||
this.sortByNameBtn = this.page.getByTestId('home-sort-by-name')
|
this.sortByNameBtn = this.page.getByTestId('home-sort-by-name')
|
||||||
|
this.tutorialBtn = this.page.getByTestId('home-tutorial-button')
|
||||||
}
|
}
|
||||||
|
|
||||||
private _serialiseSortBy = async (): Promise<
|
private _serialiseSortBy = async (): Promise<
|
||||||
|
@ -17,6 +17,8 @@ type LengthUnitLabel = (typeof baseUnitLabels)[keyof typeof baseUnitLabels]
|
|||||||
export class ToolbarFixture {
|
export class ToolbarFixture {
|
||||||
public page: Page
|
public page: Page
|
||||||
|
|
||||||
|
projectName!: Locator
|
||||||
|
fileName!: Locator
|
||||||
extrudeButton!: Locator
|
extrudeButton!: Locator
|
||||||
loftButton!: Locator
|
loftButton!: Locator
|
||||||
sweepButton!: Locator
|
sweepButton!: Locator
|
||||||
@ -53,6 +55,8 @@ export class ToolbarFixture {
|
|||||||
constructor(page: Page) {
|
constructor(page: Page) {
|
||||||
this.page = page
|
this.page = page
|
||||||
|
|
||||||
|
this.projectName = page.getByTestId('app-header-project-name')
|
||||||
|
this.fileName = page.getByTestId('app-header-file-name')
|
||||||
this.extrudeButton = page.getByTestId('extrude')
|
this.extrudeButton = page.getByTestId('extrude')
|
||||||
this.loftButton = page.getByTestId('loft')
|
this.loftButton = page.getByTestId('loft')
|
||||||
this.sweepButton = page.getByTestId('sweep')
|
this.sweepButton = page.getByTestId('sweep')
|
||||||
|
@ -450,7 +450,7 @@ test.describe(
|
|||||||
)
|
)
|
||||||
await expect(actual).toBeVisible()
|
await expect(actual).toBeVisible()
|
||||||
})
|
})
|
||||||
test('Home.Help.Reset onboarding', async ({
|
test('Home.Help.Replay onboarding tutorial', async ({
|
||||||
tronApp,
|
tronApp,
|
||||||
cmdBar,
|
cmdBar,
|
||||||
page,
|
page,
|
||||||
@ -464,7 +464,7 @@ test.describe(
|
|||||||
await tronApp.electron.evaluate(async ({ app }) => {
|
await tronApp.electron.evaluate(async ({ app }) => {
|
||||||
if (!app || !app.applicationMenu) return false
|
if (!app || !app.applicationMenu) return false
|
||||||
const menu = app.applicationMenu.getMenuItemById(
|
const menu = app.applicationMenu.getMenuItemById(
|
||||||
'Help.Reset onboarding'
|
'Help.Replay onboarding tutorial'
|
||||||
)
|
)
|
||||||
if (!menu) {
|
if (!menu) {
|
||||||
return false
|
return false
|
||||||
@ -2339,7 +2339,7 @@ test.describe(
|
|||||||
await scene.connectionEstablished()
|
await scene.connectionEstablished()
|
||||||
await expect(toolbar.startSketchBtn).toBeVisible()
|
await expect(toolbar.startSketchBtn).toBeVisible()
|
||||||
})
|
})
|
||||||
test('Modeling.Help.Reset onboarding', async ({
|
test('Modeling.Help.Replay onboarding tutorial', async ({
|
||||||
tronApp,
|
tronApp,
|
||||||
cmdBar,
|
cmdBar,
|
||||||
page,
|
page,
|
||||||
@ -2358,7 +2358,7 @@ test.describe(
|
|||||||
await tronApp.electron.evaluate(async ({ app }) => {
|
await tronApp.electron.evaluate(async ({ app }) => {
|
||||||
if (!app || !app.applicationMenu) fail()
|
if (!app || !app.applicationMenu) fail()
|
||||||
const menu = app.applicationMenu.getMenuItemById(
|
const menu = app.applicationMenu.getMenuItemById(
|
||||||
'Help.Reset onboarding'
|
'Help.Replay onboarding tutorial'
|
||||||
)
|
)
|
||||||
if (!menu) fail()
|
if (!menu) fail()
|
||||||
menu.click()
|
menu.click()
|
||||||
|
@ -1,502 +1,32 @@
|
|||||||
import { join } from 'path'
|
|
||||||
import { bracket } from '@e2e/playwright/fixtures/bracket'
|
|
||||||
import { onboardingPaths } from '@src/routes/Onboarding/paths'
|
|
||||||
import fsp from 'fs/promises'
|
|
||||||
|
|
||||||
import { expectPixelColor } from '@e2e/playwright/fixtures/sceneFixture'
|
|
||||||
import {
|
|
||||||
TEST_SETTINGS_KEY,
|
|
||||||
TEST_SETTINGS_ONBOARDING_EXPORT,
|
|
||||||
TEST_SETTINGS_ONBOARDING_START,
|
|
||||||
TEST_SETTINGS_ONBOARDING_USER_MENU,
|
|
||||||
} from '@e2e/playwright/storageStates'
|
|
||||||
import {
|
|
||||||
createProject,
|
|
||||||
executorInputPath,
|
|
||||||
getUtils,
|
|
||||||
settingsToToml,
|
|
||||||
} from '@e2e/playwright/test-utils'
|
|
||||||
import { expect, test } from '@e2e/playwright/zoo-test'
|
import { expect, test } from '@e2e/playwright/zoo-test'
|
||||||
|
|
||||||
// Because our default test settings have the onboardingStatus set to 'dismissed',
|
|
||||||
// we must set it to empty for the tests where we want to see the onboarding immediately.
|
|
||||||
|
|
||||||
test.describe('Onboarding tests', () => {
|
test.describe('Onboarding tests', () => {
|
||||||
test('Onboarding code is shown in the editor', async ({
|
test('Desktop onboarding flow works', async ({
|
||||||
page,
|
page,
|
||||||
homePage,
|
homePage,
|
||||||
tronApp,
|
toolbar,
|
||||||
}) => {
|
editor,
|
||||||
if (!tronApp) {
|
|
||||||
fail()
|
|
||||||
}
|
|
||||||
await tronApp.cleanProjectDir({
|
|
||||||
app: {
|
|
||||||
onboarding_status: '',
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const u = await getUtils(page)
|
|
||||||
await page.setBodyDimensions({ width: 1200, height: 500 })
|
|
||||||
await homePage.goToModelingScene()
|
|
||||||
|
|
||||||
// Test that the onboarding pane loaded
|
|
||||||
await expect(page.getByText('Welcome to Design Studio! This')).toBeVisible()
|
|
||||||
|
|
||||||
// Test that the onboarding pane loaded
|
|
||||||
await expect(page.getByText('Welcome to Design Studio! This')).toBeVisible()
|
|
||||||
|
|
||||||
// *and* that the code is shown in the editor
|
|
||||||
await expect(page.locator('.cm-content')).toContainText('// Shelf Bracket')
|
|
||||||
|
|
||||||
// Make sure the model loaded
|
|
||||||
const XYPlanePoint = { x: 774, y: 116 } as const
|
|
||||||
const modelColor: [number, number, number] = [45, 45, 45]
|
|
||||||
await page.mouse.move(XYPlanePoint.x, XYPlanePoint.y)
|
|
||||||
expect(await u.getGreatestPixDiff(XYPlanePoint, modelColor)).toBeLessThan(8)
|
|
||||||
})
|
|
||||||
|
|
||||||
test(
|
|
||||||
'Desktop: fresh onboarding executes and loads',
|
|
||||||
{
|
|
||||||
tag: '@electron',
|
|
||||||
},
|
|
||||||
async ({ page, tronApp, scene }) => {
|
|
||||||
if (!tronApp) {
|
|
||||||
fail()
|
|
||||||
}
|
|
||||||
await tronApp.cleanProjectDir({
|
|
||||||
app: {
|
|
||||||
onboarding_status: '',
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const viewportSize = { width: 1200, height: 500 }
|
|
||||||
await page.setBodyDimensions(viewportSize)
|
|
||||||
|
|
||||||
await test.step(`Create a project and open to the onboarding`, async () => {
|
|
||||||
await createProject({ name: 'project-link', page })
|
|
||||||
await test.step(`Ensure the engine connection works by testing the sketch button`, async () => {
|
|
||||||
await scene.connectionEstablished()
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
await test.step(`Ensure we see the onboarding stuff`, async () => {
|
|
||||||
// Test that the onboarding pane loaded
|
|
||||||
await expect(
|
|
||||||
page.getByText('Welcome to Design Studio! This')
|
|
||||||
).toBeVisible()
|
|
||||||
|
|
||||||
// *and* that the code is shown in the editor
|
|
||||||
await expect(page.locator('.cm-content')).toContainText(
|
|
||||||
'// Shelf Bracket'
|
|
||||||
)
|
|
||||||
|
|
||||||
// TODO: jess make less shit
|
|
||||||
// Make sure the model loaded
|
|
||||||
//const XYPlanePoint = { x: 986, y: 522 } as const
|
|
||||||
//const modelColor: [number, number, number] = [76, 76, 76]
|
|
||||||
//await page.mouse.move(XYPlanePoint.x, XYPlanePoint.y)
|
|
||||||
|
|
||||||
//await expectPixelColor(page, modelColor, XYPlanePoint, 8)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
test('Code resets after confirmation', async ({
|
|
||||||
page,
|
|
||||||
homePage,
|
|
||||||
tronApp,
|
|
||||||
scene,
|
scene,
|
||||||
}) => {
|
|
||||||
if (!tronApp) {
|
|
||||||
fail()
|
|
||||||
}
|
|
||||||
await tronApp.cleanProjectDir()
|
|
||||||
|
|
||||||
const initialCode = `sketch001 = startSketchOn(XZ)`
|
|
||||||
|
|
||||||
// Load the page up with some code so we see the confirmation warning
|
|
||||||
// when we go to replay onboarding
|
|
||||||
await page.addInitScript((code) => {
|
|
||||||
localStorage.setItem('persistCode', code)
|
|
||||||
}, initialCode)
|
|
||||||
|
|
||||||
await page.setBodyDimensions({ width: 1200, height: 500 })
|
|
||||||
await homePage.goToModelingScene()
|
|
||||||
await scene.connectionEstablished()
|
|
||||||
|
|
||||||
// Replay the onboarding
|
|
||||||
await page.getByRole('link', { name: 'Settings' }).last().click()
|
|
||||||
const replayButton = page.getByRole('button', {
|
|
||||||
name: 'Replay onboarding',
|
|
||||||
})
|
|
||||||
await expect(replayButton).toBeVisible()
|
|
||||||
await replayButton.click()
|
|
||||||
|
|
||||||
// Ensure we see the warning, and that the code has not yet updated
|
|
||||||
await expect(page.getByText('Would you like to create')).toBeVisible()
|
|
||||||
await expect(page.locator('.cm-content')).toHaveText(initialCode)
|
|
||||||
|
|
||||||
const nextButton = page.getByTestId('onboarding-next')
|
|
||||||
await nextButton.hover()
|
|
||||||
await nextButton.click()
|
|
||||||
|
|
||||||
// Ensure we see the introduction and that the code has been reset
|
|
||||||
await expect(page.getByText('Welcome to Design Studio!')).toBeVisible()
|
|
||||||
await expect(page.locator('.cm-content')).toContainText('// Shelf Bracket')
|
|
||||||
|
|
||||||
// There used to be old code here that checked if we stored the reset
|
|
||||||
// code into localStorage but that isn't the case on desktop. It gets
|
|
||||||
// saved to the file system, which we have other tests for.
|
|
||||||
})
|
|
||||||
|
|
||||||
test('Click through each onboarding step and back', async ({
|
|
||||||
context,
|
|
||||||
page,
|
|
||||||
homePage,
|
|
||||||
tronApp,
|
tronApp,
|
||||||
}) => {
|
}) => {
|
||||||
if (!tronApp) {
|
if (!tronApp) {
|
||||||
fail()
|
fail()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Because our default test settings have the onboardingStatus set to 'dismissed',
|
||||||
|
// we must set it to empty for the tests where we want to see the onboarding UI.
|
||||||
await tronApp.cleanProjectDir({
|
await tronApp.cleanProjectDir({
|
||||||
app: {
|
app: {
|
||||||
onboarding_status: '',
|
onboarding_status: '',
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
// Override beforeEach test setup
|
|
||||||
await context.addInitScript(
|
const bracketComment = '// Shelf Bracket'
|
||||||
async ({ settingsKey, settings }) => {
|
const tutorialWelcomHeading = page.getByText(
|
||||||
// Give no initial code, so that the onboarding start is shown immediately
|
'Welcome to Design Studio! This'
|
||||||
localStorage.setItem('persistCode', '')
|
|
||||||
localStorage.setItem(settingsKey, settings)
|
|
||||||
},
|
|
||||||
{
|
|
||||||
settingsKey: TEST_SETTINGS_KEY,
|
|
||||||
settings: settingsToToml({
|
|
||||||
settings: TEST_SETTINGS_ONBOARDING_START,
|
|
||||||
}),
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
await page.setBodyDimensions({ width: 1200, height: 1080 })
|
|
||||||
await homePage.goToModelingScene()
|
|
||||||
|
|
||||||
// Test that the onboarding pane loaded
|
|
||||||
await expect(page.getByText('Welcome to Design Studio! This')).toBeVisible()
|
|
||||||
|
|
||||||
const nextButton = page.getByTestId('onboarding-next')
|
const nextButton = page.getByTestId('onboarding-next')
|
||||||
const prevButton = page.getByTestId('onboarding-prev')
|
const prevButton = page.getByTestId('onboarding-prev')
|
||||||
|
|
||||||
while ((await nextButton.innerText()) !== 'Finish') {
|
|
||||||
await nextButton.hover()
|
|
||||||
await nextButton.click()
|
|
||||||
}
|
|
||||||
|
|
||||||
while ((await prevButton.innerText()) !== 'Dismiss') {
|
|
||||||
await prevButton.hover()
|
|
||||||
await prevButton.click()
|
|
||||||
}
|
|
||||||
|
|
||||||
// Dismiss the onboarding
|
|
||||||
await prevButton.hover()
|
|
||||||
await prevButton.click()
|
|
||||||
|
|
||||||
// Test that the onboarding pane is gone
|
|
||||||
await expect(page.getByTestId('onboarding-content')).not.toBeVisible()
|
|
||||||
await expect.poll(() => page.url()).not.toContain('/onboarding')
|
|
||||||
})
|
|
||||||
|
|
||||||
test('Onboarding redirects and code updating', async ({
|
|
||||||
context,
|
|
||||||
page,
|
|
||||||
homePage,
|
|
||||||
tronApp,
|
|
||||||
}) => {
|
|
||||||
if (!tronApp) {
|
|
||||||
fail()
|
|
||||||
}
|
|
||||||
await tronApp.cleanProjectDir({
|
|
||||||
app: {
|
|
||||||
onboarding_status: '/export',
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const originalCode = 'sigmaAllow = 15000'
|
|
||||||
|
|
||||||
// Override beforeEach test setup
|
|
||||||
await context.addInitScript(
|
|
||||||
async ({ settingsKey, settings, code }) => {
|
|
||||||
// Give some initial code, so we can test that it's cleared
|
|
||||||
localStorage.setItem('persistCode', code)
|
|
||||||
localStorage.setItem(settingsKey, settings)
|
|
||||||
},
|
|
||||||
{
|
|
||||||
settingsKey: TEST_SETTINGS_KEY,
|
|
||||||
settings: settingsToToml({
|
|
||||||
settings: TEST_SETTINGS_ONBOARDING_EXPORT,
|
|
||||||
}),
|
|
||||||
code: originalCode,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
await page.setBodyDimensions({ width: 1200, height: 500 })
|
|
||||||
await homePage.goToModelingScene()
|
|
||||||
|
|
||||||
// Test that the redirect happened
|
|
||||||
await expect.poll(() => page.url()).toContain('/onboarding/export')
|
|
||||||
|
|
||||||
// Test that you come back to this page when you refresh
|
|
||||||
await page.reload()
|
|
||||||
await expect.poll(() => page.url()).toContain('/onboarding/export')
|
|
||||||
|
|
||||||
// Test that the code changes when you advance to the next step
|
|
||||||
await page.getByTestId('onboarding-next').hover()
|
|
||||||
await page.getByTestId('onboarding-next').click()
|
|
||||||
|
|
||||||
// Test that the onboarding pane loaded
|
|
||||||
const title = page.locator('[data-testid="onboarding-content"]')
|
|
||||||
await expect(title).toBeAttached()
|
|
||||||
|
|
||||||
await expect(page.locator('.cm-content')).not.toHaveText(originalCode)
|
|
||||||
|
|
||||||
// Test that the code is not empty when you click on the next step
|
|
||||||
await page.locator('[data-testid="onboarding-next"]').hover()
|
|
||||||
await page.locator('[data-testid="onboarding-next"]').click()
|
|
||||||
await expect(page.locator('.cm-content')).toHaveText(/.+/)
|
|
||||||
})
|
|
||||||
|
|
||||||
test('Onboarding code gets reset to demo on Interactive Numbers step', async ({
|
|
||||||
page,
|
|
||||||
homePage,
|
|
||||||
tronApp,
|
|
||||||
editor,
|
|
||||||
toolbar,
|
|
||||||
}) => {
|
|
||||||
if (!tronApp) {
|
|
||||||
fail()
|
|
||||||
}
|
|
||||||
await tronApp.cleanProjectDir({
|
|
||||||
app: {
|
|
||||||
onboarding_status: '/parametric-modeling',
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const badCode = `// This is bad code we shouldn't see`
|
|
||||||
|
|
||||||
await page.setBodyDimensions({ width: 1200, height: 1080 })
|
|
||||||
await homePage.goToModelingScene()
|
|
||||||
|
|
||||||
await expect
|
|
||||||
.poll(() => page.url())
|
|
||||||
.toContain(onboardingPaths.PARAMETRIC_MODELING)
|
|
||||||
|
|
||||||
// Check the code got reset on load
|
|
||||||
await toolbar.openPane('code')
|
|
||||||
await editor.expectEditor.toContain(bracket, {
|
|
||||||
shouldNormalise: true,
|
|
||||||
timeout: 10_000,
|
|
||||||
})
|
|
||||||
|
|
||||||
// Mess with the code again
|
|
||||||
await editor.replaceCode('', badCode)
|
|
||||||
await editor.expectEditor.toContain(badCode, {
|
|
||||||
shouldNormalise: true,
|
|
||||||
timeout: 10_000,
|
|
||||||
})
|
|
||||||
|
|
||||||
// Click to the next step
|
|
||||||
await page.locator('[data-testid="onboarding-next"]').hover()
|
|
||||||
await page.locator('[data-testid="onboarding-next"]').click()
|
|
||||||
await page.waitForURL('**' + onboardingPaths.INTERACTIVE_NUMBERS, {
|
|
||||||
waitUntil: 'domcontentloaded',
|
|
||||||
})
|
|
||||||
|
|
||||||
// Check that the code has been reset
|
|
||||||
await editor.expectEditor.toContain(bracket, {
|
|
||||||
shouldNormalise: true,
|
|
||||||
timeout: 10_000,
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
// (lee) The two avatar tests are weird because even on main, we don't have
|
|
||||||
// anything to do with the avatar inside the onboarding test. Due to the
|
|
||||||
// low impact of an avatar not showing I'm changing this to fixme.
|
|
||||||
test('Avatar text updates depending on image load success', async ({
|
|
||||||
context,
|
|
||||||
page,
|
|
||||||
toolbar,
|
|
||||||
homePage,
|
|
||||||
tronApp,
|
|
||||||
}) => {
|
|
||||||
if (!tronApp) {
|
|
||||||
fail()
|
|
||||||
}
|
|
||||||
|
|
||||||
await tronApp.cleanProjectDir({
|
|
||||||
app: {
|
|
||||||
onboarding_status: '',
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
// Override beforeEach test setup
|
|
||||||
await context.addInitScript(
|
|
||||||
async ({ settingsKey, settings }) => {
|
|
||||||
localStorage.setItem(settingsKey, settings)
|
|
||||||
},
|
|
||||||
{
|
|
||||||
settingsKey: TEST_SETTINGS_KEY,
|
|
||||||
settings: settingsToToml({
|
|
||||||
settings: TEST_SETTINGS_ONBOARDING_USER_MENU,
|
|
||||||
}),
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
await page.setBodyDimensions({ width: 1200, height: 500 })
|
|
||||||
await homePage.goToModelingScene()
|
|
||||||
|
|
||||||
// Test that the text in this step is correct
|
|
||||||
const avatarLocator = toolbar.userSidebarButton.locator('img')
|
|
||||||
const onboardingOverlayLocator = page
|
|
||||||
.getByTestId('onboarding-content')
|
|
||||||
.locator('div')
|
|
||||||
.nth(1)
|
|
||||||
|
|
||||||
// Expect the avatar to be visible and for the text to reference it
|
|
||||||
await expect(avatarLocator).toBeVisible()
|
|
||||||
await expect(onboardingOverlayLocator).toBeVisible()
|
|
||||||
await expect(onboardingOverlayLocator).toContainText('your avatar')
|
|
||||||
|
|
||||||
// This is to force the avatar to 404.
|
|
||||||
// For our test image (only triggers locally. on CI, it's Kurt's /
|
|
||||||
// gravatar image )
|
|
||||||
await page.route('/cat.jpg', async (route) => {
|
|
||||||
await route.fulfill({
|
|
||||||
status: 404,
|
|
||||||
contentType: 'text/plain',
|
|
||||||
body: 'Not Found!',
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
// 404 the CI avatar image
|
|
||||||
await page.route('https://lh3.googleusercontent.com/**', async (route) => {
|
|
||||||
await route.fulfill({
|
|
||||||
status: 404,
|
|
||||||
contentType: 'text/plain',
|
|
||||||
body: 'Not Found!',
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
await page.reload({ waitUntil: 'domcontentloaded' })
|
|
||||||
|
|
||||||
// Now expect the text to be different
|
|
||||||
await expect(avatarLocator).not.toBeVisible()
|
|
||||||
await expect(onboardingOverlayLocator).toBeVisible()
|
|
||||||
await expect(onboardingOverlayLocator).toContainText('the menu button')
|
|
||||||
})
|
|
||||||
|
|
||||||
test("Avatar text doesn't mention avatar when no avatar", async ({
|
|
||||||
context,
|
|
||||||
page,
|
|
||||||
toolbar,
|
|
||||||
homePage,
|
|
||||||
tronApp,
|
|
||||||
}) => {
|
|
||||||
if (!tronApp) {
|
|
||||||
fail()
|
|
||||||
}
|
|
||||||
|
|
||||||
await tronApp.cleanProjectDir({
|
|
||||||
app: {
|
|
||||||
onboarding_status: '',
|
|
||||||
},
|
|
||||||
})
|
|
||||||
// Override beforeEach test setup
|
|
||||||
await context.addInitScript(
|
|
||||||
async ({ settingsKey, settings }) => {
|
|
||||||
localStorage.setItem(settingsKey, settings)
|
|
||||||
localStorage.setItem('FORCE_NO_IMAGE', 'FORCE_NO_IMAGE')
|
|
||||||
},
|
|
||||||
{
|
|
||||||
settingsKey: TEST_SETTINGS_KEY,
|
|
||||||
settings: settingsToToml({
|
|
||||||
settings: TEST_SETTINGS_ONBOARDING_USER_MENU,
|
|
||||||
}),
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
await page.setBodyDimensions({ width: 1200, height: 500 })
|
|
||||||
await homePage.goToModelingScene()
|
|
||||||
|
|
||||||
// Test that the text in this step is correct
|
|
||||||
const sidebar = toolbar.userSidebarButton
|
|
||||||
const avatar = sidebar.locator('img')
|
|
||||||
const onboardingOverlayLocator = page
|
|
||||||
.getByTestId('onboarding-content')
|
|
||||||
.locator('div')
|
|
||||||
.nth(1)
|
|
||||||
|
|
||||||
// Expect the avatar to be visible and for the text to reference it
|
|
||||||
await expect(avatar).not.toBeVisible()
|
|
||||||
await expect(onboardingOverlayLocator).toBeVisible()
|
|
||||||
await expect(onboardingOverlayLocator).toContainText('the menu button')
|
|
||||||
|
|
||||||
// Test we mention what else is in this menu for https://github.com/KittyCAD/modeling-app/issues/2939
|
|
||||||
// which doesn't deserver its own full test spun up
|
|
||||||
const userMenuFeatures = [
|
|
||||||
'manage your account',
|
|
||||||
'report a bug',
|
|
||||||
'request a feature',
|
|
||||||
'sign out',
|
|
||||||
]
|
|
||||||
for (const feature of userMenuFeatures) {
|
|
||||||
await expect(onboardingOverlayLocator).toContainText(feature)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
test('Restarting onboarding on desktop takes one attempt', async ({
|
|
||||||
context,
|
|
||||||
page,
|
|
||||||
toolbar,
|
|
||||||
tronApp,
|
|
||||||
}) => {
|
|
||||||
if (!tronApp) {
|
|
||||||
fail()
|
|
||||||
}
|
|
||||||
|
|
||||||
await tronApp.cleanProjectDir({
|
|
||||||
app: {
|
|
||||||
onboarding_status: 'dismissed',
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
await context.folderSetupFn(async (dir) => {
|
|
||||||
const routerTemplateDir = join(dir, 'router-template-slate')
|
|
||||||
await fsp.mkdir(routerTemplateDir, { recursive: true })
|
|
||||||
await fsp.copyFile(
|
|
||||||
executorInputPath('router-template-slate.kcl'),
|
|
||||||
join(routerTemplateDir, 'main.kcl')
|
|
||||||
)
|
|
||||||
})
|
|
||||||
|
|
||||||
// Our constants
|
|
||||||
const u = await getUtils(page)
|
|
||||||
const projectCard = page.getByText('router-template-slate')
|
|
||||||
const helpMenuButton = page.getByRole('button', {
|
|
||||||
name: 'Help and resources',
|
|
||||||
})
|
|
||||||
const restartOnboardingButton = page.getByRole('button', {
|
|
||||||
name: 'Reset onboarding',
|
|
||||||
})
|
|
||||||
const nextButton = page.getByTestId('onboarding-next')
|
|
||||||
|
|
||||||
const tutorialProjectIndicator = page
|
|
||||||
.getByTestId('project-sidebar-toggle')
|
|
||||||
.filter({ hasText: 'Tutorial Project 00' })
|
|
||||||
const tutorialModalText = page.getByText('Welcome to Design Studio!')
|
|
||||||
const tutorialDismissButton = page.getByRole('button', { name: 'Dismiss' })
|
|
||||||
const userMenuButton = toolbar.userSidebarButton
|
const userMenuButton = toolbar.userSidebarButton
|
||||||
const userMenuSettingsButton = page.getByRole('button', {
|
const userMenuSettingsButton = page.getByRole('button', {
|
||||||
name: 'User settings',
|
name: 'User settings',
|
||||||
@ -508,53 +38,138 @@ test('Restarting onboarding on desktop takes one attempt', async ({
|
|||||||
const restartOnboardingSettingsButton = page.getByRole('button', {
|
const restartOnboardingSettingsButton = page.getByRole('button', {
|
||||||
name: 'Replay onboarding',
|
name: 'Replay onboarding',
|
||||||
})
|
})
|
||||||
|
const helpMenuButton = page.getByRole('button', {
|
||||||
|
name: 'Help and resources',
|
||||||
|
})
|
||||||
|
const helpMenuRestartOnboardingButton = page.getByRole('button', {
|
||||||
|
name: 'Replay onboarding tutorial',
|
||||||
|
})
|
||||||
|
const postDismissToast = page.getByText(
|
||||||
|
'Click the question mark in the lower-right corner if you ever want to redo the tutorial!'
|
||||||
|
)
|
||||||
|
|
||||||
await test.step('Navigate into project', async () => {
|
await test.step('Test initial home page view, showing a tutorial button', async () => {
|
||||||
await expect(page.getByRole('heading', { name: 'Projects' })).toBeVisible()
|
await expect(homePage.tutorialBtn).toBeVisible()
|
||||||
await expect(projectCard).toBeVisible()
|
await homePage.expectState({
|
||||||
await projectCard.click()
|
projectCards: [],
|
||||||
await u.waitForPageLoad()
|
sortBy: 'last-modified-desc',
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
await test.step('Restart the onboarding from help menu', async () => {
|
await test.step('Create a blank project and verify no onboarding chrome is shown', async () => {
|
||||||
await helpMenuButton.click()
|
await homePage.goToModelingScene()
|
||||||
await restartOnboardingButton.click()
|
await expect(toolbar.projectName).toContainText('testDefault')
|
||||||
|
await expect(tutorialWelcomHeading).not.toBeVisible()
|
||||||
|
await editor.expectEditor.toContain('@settings(defaultLengthUnit = in)', {
|
||||||
|
shouldNormalise: true,
|
||||||
|
})
|
||||||
|
await scene.connectionEstablished()
|
||||||
|
await expect(toolbar.startSketchBtn).toBeEnabled({ timeout: 15_000 })
|
||||||
|
})
|
||||||
|
|
||||||
|
await test.step('Go home and verify we still see the tutorial button, then begin it.', async () => {
|
||||||
|
await toolbar.logoLink.click()
|
||||||
|
await expect(homePage.tutorialBtn).toBeVisible()
|
||||||
|
await homePage.expectState({
|
||||||
|
projectCards: [
|
||||||
|
{
|
||||||
|
title: 'testDefault',
|
||||||
|
fileCount: 1,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
sortBy: 'last-modified-desc',
|
||||||
|
})
|
||||||
|
await homePage.tutorialBtn.click()
|
||||||
|
})
|
||||||
|
|
||||||
|
// This is web-only.
|
||||||
|
// TODO: write a new test just for the onboarding in browser
|
||||||
|
// await test.step('Ensure the onboarding request toast appears', async () => {
|
||||||
|
// await expect(page.getByTestId('onboarding-toast')).toBeVisible()
|
||||||
|
// await page.getByTestId('onboarding-next').click()
|
||||||
|
// })
|
||||||
|
|
||||||
|
await test.step('Ensure we see the welcome screen in a new project', async () => {
|
||||||
|
await expect(toolbar.projectName).toContainText('Tutorial Project 00')
|
||||||
|
await expect(tutorialWelcomHeading).toBeVisible()
|
||||||
|
await editor.expectEditor.toContain(bracketComment)
|
||||||
|
await scene.connectionEstablished()
|
||||||
|
await expect(toolbar.startSketchBtn).toBeEnabled({ timeout: 15_000 })
|
||||||
|
})
|
||||||
|
|
||||||
|
await test.step('Test the clicking through the onboarding flow', async () => {
|
||||||
|
await test.step('Going forward', async () => {
|
||||||
|
while ((await nextButton.innerText()) !== 'Finish') {
|
||||||
await nextButton.hover()
|
await nextButton.hover()
|
||||||
await nextButton.click()
|
await nextButton.click()
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
await test.step('Confirm that the onboarding has restarted', async () => {
|
await test.step('Going backward', async () => {
|
||||||
await expect(tutorialProjectIndicator).toBeVisible()
|
while ((await prevButton.innerText()) !== 'Dismiss') {
|
||||||
await expect(tutorialModalText).toBeVisible()
|
await prevButton.hover()
|
||||||
// Make sure the model loaded
|
await prevButton.click()
|
||||||
const XYPlanePoint = { x: 988, y: 523 } as const
|
}
|
||||||
const modelColor: [number, number, number] = [76, 76, 76]
|
|
||||||
|
|
||||||
await page.mouse.move(XYPlanePoint.x, XYPlanePoint.y)
|
|
||||||
await expectPixelColor(page, modelColor, XYPlanePoint, 8)
|
|
||||||
await tutorialDismissButton.click()
|
|
||||||
// Make sure model still there.
|
|
||||||
await expectPixelColor(page, modelColor, XYPlanePoint, 8)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
await test.step('Clear code and restart onboarding from settings', async () => {
|
// Dismiss the onboarding
|
||||||
await u.openKclCodePanel()
|
await test.step('Dismiss the onboarding', async () => {
|
||||||
await expect(u.codeLocator).toContainText('// Shelf Bracket')
|
await prevButton.hover()
|
||||||
await u.codeLocator.selectText()
|
await prevButton.click()
|
||||||
await u.codeLocator.fill('')
|
await expect(page.getByTestId('onboarding-content')).not.toBeVisible()
|
||||||
|
await expect(postDismissToast).toBeVisible()
|
||||||
|
await expect.poll(() => page.url()).not.toContain('/onboarding')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
await test.step('Navigate to settings', async () => {
|
await test.step('Resetting onboarding from inside project should always make a new one', async () => {
|
||||||
|
await test.step('Reset onboarding from settings', async () => {
|
||||||
await userMenuButton.click()
|
await userMenuButton.click()
|
||||||
await userMenuSettingsButton.click()
|
await userMenuSettingsButton.click()
|
||||||
await expect(settingsHeading).toBeVisible()
|
await expect(settingsHeading).toBeVisible()
|
||||||
await expect(restartOnboardingSettingsButton).toBeVisible()
|
await expect(restartOnboardingSettingsButton).toBeVisible()
|
||||||
|
await restartOnboardingSettingsButton.click()
|
||||||
})
|
})
|
||||||
|
|
||||||
await restartOnboardingSettingsButton.click()
|
await test.step('Makes a new project', async () => {
|
||||||
// Since the code is empty, we should not see the confirmation dialog
|
await expect(toolbar.projectName).toContainText('Tutorial Project 01')
|
||||||
await expect(nextButton).not.toBeVisible()
|
await expect(tutorialWelcomHeading).toBeVisible()
|
||||||
await expect(tutorialProjectIndicator).toBeVisible()
|
await editor.expectEditor.toContain(bracketComment)
|
||||||
await expect(tutorialModalText).toBeVisible()
|
await scene.connectionEstablished()
|
||||||
|
await expect(toolbar.startSketchBtn).toBeEnabled({ timeout: 15_000 })
|
||||||
|
})
|
||||||
|
|
||||||
|
await test.step('Dismiss the onboarding', async () => {
|
||||||
|
await postDismissToast.waitFor({ state: 'detached' })
|
||||||
|
await page.keyboard.press('Escape')
|
||||||
|
await expect(postDismissToast).toBeVisible()
|
||||||
|
await expect(page.getByTestId('onboarding-content')).not.toBeVisible()
|
||||||
|
await expect.poll(() => page.url()).not.toContain('/onboarding')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
await test.step('Resetting onboarding from home help menu makes a new project', async () => {
|
||||||
|
await test.step('Go home and reset onboarding from lower-right help menu', async () => {
|
||||||
|
await toolbar.logoLink.click()
|
||||||
|
await expect(homePage.tutorialBtn).not.toBeVisible()
|
||||||
|
await expect(
|
||||||
|
homePage.projectCard.getByText('Tutorial Project 00')
|
||||||
|
).toBeVisible()
|
||||||
|
await expect(
|
||||||
|
homePage.projectCard.getByText('Tutorial Project 01')
|
||||||
|
).toBeVisible()
|
||||||
|
|
||||||
|
await helpMenuButton.click()
|
||||||
|
await helpMenuRestartOnboardingButton.click()
|
||||||
|
})
|
||||||
|
|
||||||
|
await test.step('Makes a new project', async () => {
|
||||||
|
await expect(toolbar.projectName).toContainText('Tutorial Project 02')
|
||||||
|
await expect(tutorialWelcomHeading).toBeVisible()
|
||||||
|
await editor.expectEditor.toContain(bracketComment)
|
||||||
|
await scene.connectionEstablished()
|
||||||
|
await expect(toolbar.startSketchBtn).toBeEnabled({ timeout: 15_000 })
|
||||||
|
})
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
@ -1222,7 +1222,7 @@ profile001 = startProfile(sketch001, at = [299.72, 230.82])
|
|||||||
return lugSketch
|
return lugSketch
|
||||||
}
|
}
|
||||||
|
|
||||||
lug([0, 0], 10, .5, XY)`
|
lug(origin = [0, 0], length = 10, diameter = .5, plane = XY)`
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -78,16 +78,16 @@ part001 = startSketchOn(-XZ)
|
|||||||
|> xLine(endAbsolute = totalLen, tag = $seg03)
|
|> xLine(endAbsolute = totalLen, tag = $seg03)
|
||||||
|> yLine(length = -armThick, tag = $seg01)
|
|> yLine(length = -armThick, tag = $seg01)
|
||||||
|> angledLineThatIntersects(angle = turns::HALF_TURN, offset = -armThick, intersectTag = seg04)
|
|> angledLineThatIntersects(angle = turns::HALF_TURN, offset = -armThick, intersectTag = seg04)
|
||||||
|> angledLine(angle = segAng(seg04, %) + 180, endAbsoluteY = turns::ZERO)
|
|> angledLine(angle = segAng(seg04) + 180, endAbsoluteY = turns::ZERO)
|
||||||
|> angledLine(
|
|> angledLine(
|
||||||
angle = -bottomAng,
|
angle = -bottomAng,
|
||||||
endAbsoluteY = -totalHeightHalf - armThick,
|
endAbsoluteY = -totalHeightHalf - armThick,
|
||||||
tag = $seg02,
|
tag = $seg02,
|
||||||
)
|
)
|
||||||
|> xLine(length = endAbsolute = segEndX(seg03) + 0)
|
|> xLine(length = endAbsolute = segEndX(seg03) + 0)
|
||||||
|> yLine(length = -segLen(seg01, %))
|
|> yLine(length = -segLen(seg01))
|
||||||
|> angledLineThatIntersects(angle = turns::HALF_TURN, offset = -armThick, intersectTag = seg02)
|
|> angledLineThatIntersects(angle = turns::HALF_TURN, offset = -armThick, intersectTag = seg02)
|
||||||
|> angledLine(angle = segAng(seg02, %) + 180, endAbsoluteY = -baseHeight)
|
|> angledLine(angle = segAng(seg02) + 180, endAbsoluteY = -baseHeight)
|
||||||
|> xLine(endAbsolute = turns::ZERO)
|
|> xLine(endAbsolute = turns::ZERO)
|
||||||
|> close()
|
|> close()
|
||||||
|> extrude(length = 4)`
|
|> extrude(length = 4)`
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import type { SaveSettingsPayload } from '@src/lib/settings/settingsTypes'
|
import type { SaveSettingsPayload } from '@src/lib/settings/settingsTypes'
|
||||||
import { Themes } from '@src/lib/theme'
|
import { Themes } from '@src/lib/theme'
|
||||||
import type { DeepPartial } from '@src/lib/types'
|
import type { DeepPartial } from '@src/lib/types'
|
||||||
import { onboardingPaths } from '@src/routes/Onboarding/paths'
|
import { ONBOARDING_SUBPATHS } from '@src/lib/onboardingPaths'
|
||||||
|
|
||||||
import type { Settings } from '@rust/kcl-lib/bindings/Settings'
|
import type { Settings } from '@rust/kcl-lib/bindings/Settings'
|
||||||
|
|
||||||
@ -31,12 +31,15 @@ export const TEST_SETTINGS: DeepPartial<Settings> = {
|
|||||||
|
|
||||||
export const TEST_SETTINGS_ONBOARDING_USER_MENU: DeepPartial<Settings> = {
|
export const TEST_SETTINGS_ONBOARDING_USER_MENU: DeepPartial<Settings> = {
|
||||||
...TEST_SETTINGS,
|
...TEST_SETTINGS,
|
||||||
app: { ...TEST_SETTINGS.app, onboarding_status: onboardingPaths.USER_MENU },
|
app: {
|
||||||
|
...TEST_SETTINGS.app,
|
||||||
|
onboarding_status: ONBOARDING_SUBPATHS.USER_MENU,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
export const TEST_SETTINGS_ONBOARDING_EXPORT: DeepPartial<Settings> = {
|
export const TEST_SETTINGS_ONBOARDING_EXPORT: DeepPartial<Settings> = {
|
||||||
...TEST_SETTINGS,
|
...TEST_SETTINGS,
|
||||||
app: { ...TEST_SETTINGS.app, onboarding_status: onboardingPaths.EXPORT },
|
app: { ...TEST_SETTINGS.app, onboarding_status: ONBOARDING_SUBPATHS.EXPORT },
|
||||||
}
|
}
|
||||||
|
|
||||||
export const TEST_SETTINGS_ONBOARDING_PARAMETRIC_MODELING: DeepPartial<Settings> =
|
export const TEST_SETTINGS_ONBOARDING_PARAMETRIC_MODELING: DeepPartial<Settings> =
|
||||||
@ -44,7 +47,7 @@ export const TEST_SETTINGS_ONBOARDING_PARAMETRIC_MODELING: DeepPartial<Settings>
|
|||||||
...TEST_SETTINGS,
|
...TEST_SETTINGS,
|
||||||
app: {
|
app: {
|
||||||
...TEST_SETTINGS.app,
|
...TEST_SETTINGS.app,
|
||||||
onboarding_status: onboardingPaths.PARAMETRIC_MODELING,
|
onboarding_status: ONBOARDING_SUBPATHS.PARAMETRIC_MODELING,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ import type { BrowserContext, Locator, Page, TestInfo } from '@playwright/test'
|
|||||||
import { expect } from '@playwright/test'
|
import { expect } from '@playwright/test'
|
||||||
import type { EngineCommand } from '@src/lang/std/artifactGraph'
|
import type { EngineCommand } from '@src/lang/std/artifactGraph'
|
||||||
import type { Configuration } from '@src/lang/wasm'
|
import type { Configuration } from '@src/lang/wasm'
|
||||||
import { COOKIE_NAME } from '@src/lib/constants'
|
import { COOKIE_NAME, IS_PLAYWRIGHT_KEY } from '@src/lib/constants'
|
||||||
import { reportRejection } from '@src/lib/trap'
|
import { reportRejection } from '@src/lib/trap'
|
||||||
import type { DeepPartial } from '@src/lib/types'
|
import type { DeepPartial } from '@src/lib/types'
|
||||||
import { isArray } from '@src/lib/utils'
|
import { isArray } from '@src/lib/utils'
|
||||||
@ -19,7 +19,6 @@ import type { ProjectConfiguration } from '@rust/kcl-lib/bindings/ProjectConfigu
|
|||||||
import { isErrorWhitelisted } from '@e2e/playwright/lib/console-error-whitelist'
|
import { isErrorWhitelisted } from '@e2e/playwright/lib/console-error-whitelist'
|
||||||
import { secrets } from '@e2e/playwright/secrets'
|
import { secrets } from '@e2e/playwright/secrets'
|
||||||
import { TEST_SETTINGS, TEST_SETTINGS_KEY } from '@e2e/playwright/storageStates'
|
import { TEST_SETTINGS, TEST_SETTINGS_KEY } from '@e2e/playwright/storageStates'
|
||||||
import { IS_PLAYWRIGHT_KEY } from '@src/lib/constants'
|
|
||||||
import { test } from '@e2e/playwright/zoo-test'
|
import { test } from '@e2e/playwright/zoo-test'
|
||||||
|
|
||||||
const toNormalizedCode = (text: string) => {
|
const toNormalizedCode = (text: string) => {
|
||||||
|
@ -781,7 +781,7 @@ profile001 = startProfile(sketch001, at = [56.37, 120.33])
|
|||||||
interiorAbsolute = [360.16, 231.76],
|
interiorAbsolute = [360.16, 231.76],
|
||||||
endAbsolute = [391.48, 131.54],
|
endAbsolute = [391.48, 131.54],
|
||||||
)
|
)
|
||||||
|> yLine(-131.54, %)
|
|> yLine(length = -131.54)
|
||||||
|> arc(angleStart = 33.53, angleEnd = -141.07, radius = 126.46)
|
|> arc(angleStart = 33.53, angleEnd = -141.07, radius = 126.46)
|
||||||
`
|
`
|
||||||
)
|
)
|
||||||
|
@ -1130,7 +1130,7 @@ part001 = startSketchOn(XZ)
|
|||||||
|> line(end = [-20.38, -10.12])
|
|> line(end = [-20.38, -10.12])
|
||||||
|> line(end = [-15.79, 17.08])
|
|> line(end = [-15.79, 17.08])
|
||||||
|
|
||||||
fn yohey(pos) {
|
fn yohey(@pos) {
|
||||||
sketch004 = startSketchOn(XZ)
|
sketch004 = startSketchOn(XZ)
|
||||||
${extrudeAndEditBlockedInFunction}
|
${extrudeAndEditBlockedInFunction}
|
||||||
|> line(end = [27.55, -1.65])
|
|> line(end = [27.55, -1.65])
|
||||||
|
@ -11,4 +11,3 @@
|
|||||||
6) src/lib/singletons.ts -> src/clientSideScene/sceneEntities.ts -> src/clientSideScene/segments.ts -> src/components/Toolbar/angleLengthInfo.ts
|
6) src/lib/singletons.ts -> src/clientSideScene/sceneEntities.ts -> src/clientSideScene/segments.ts -> src/components/Toolbar/angleLengthInfo.ts
|
||||||
7) src/lib/singletons.ts -> src/clientSideScene/sceneEntities.ts -> src/clientSideScene/segments.ts
|
7) src/lib/singletons.ts -> src/clientSideScene/sceneEntities.ts -> src/clientSideScene/segments.ts
|
||||||
8) src/hooks/useModelingContext.ts -> src/components/ModelingMachineProvider.tsx -> src/components/Toolbar/Intersect.tsx -> src/components/SetHorVertDistanceModal.tsx -> src/lib/useCalculateKclExpression.ts
|
8) src/hooks/useModelingContext.ts -> src/components/ModelingMachineProvider.tsx -> src/components/Toolbar/Intersect.tsx -> src/components/SetHorVertDistanceModal.tsx -> src/lib/useCalculateKclExpression.ts
|
||||||
9) src/routes/Onboarding/index.tsx -> src/routes/Onboarding/Camera.tsx -> src/routes/Onboarding/utils.tsx
|
|
||||||
|
1
package-lock.json
generated
1
package-lock.json
generated
@ -14664,6 +14664,7 @@
|
|||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz",
|
||||||
"integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==",
|
"integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==",
|
||||||
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=10"
|
"node": ">=10"
|
||||||
|
@ -474,3 +474,79 @@ extrude(profile001, length = 100)
|
|||||||
result.first().unwrap();
|
result.first().unwrap();
|
||||||
result.last().unwrap();
|
result.last().unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "artifact-graph")]
|
||||||
|
#[tokio::test(flavor = "multi_thread")]
|
||||||
|
async fn kcl_test_cache_multi_file_other_file_only_change() {
|
||||||
|
let code = r#"import "toBeImported.kcl" as importedCube
|
||||||
|
|
||||||
|
importedCube
|
||||||
|
|
||||||
|
sketch001 = startSketchOn(XZ)
|
||||||
|
profile001 = startProfile(sketch001, at = [-134.53, -56.17])
|
||||||
|
|> angledLine(angle = 0, length = 79.05, tag = $rectangleSegmentA001)
|
||||||
|
|> angledLine(angle = segAng(rectangleSegmentA001) - 90, length = 76.28)
|
||||||
|
|> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001), tag = $seg01)
|
||||||
|
|> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg02)
|
||||||
|
|> close()
|
||||||
|
extrude001 = extrude(profile001, length = 100)
|
||||||
|
sketch003 = startSketchOn(extrude001, face = seg02)
|
||||||
|
sketch002 = startSketchOn(extrude001, face = seg01)
|
||||||
|
"#;
|
||||||
|
|
||||||
|
let other_file = (
|
||||||
|
std::path::PathBuf::from("toBeImported.kcl"),
|
||||||
|
r#"sketch001 = startSketchOn(XZ)
|
||||||
|
profile001 = startProfile(sketch001, at = [281.54, 305.81])
|
||||||
|
|> angledLine(angle = 0, length = 123.43, tag = $rectangleSegmentA001)
|
||||||
|
|> angledLine(angle = segAng(rectangleSegmentA001) - 90, length = 85.99)
|
||||||
|
|> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001))
|
||||||
|
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||||
|
|> close()
|
||||||
|
extrude(profile001, length = 100)
|
||||||
|
"#
|
||||||
|
.to_string(),
|
||||||
|
);
|
||||||
|
|
||||||
|
let other_file2 = (
|
||||||
|
std::path::PathBuf::from("toBeImported.kcl"),
|
||||||
|
r#"sketch001 = startSketchOn(XZ)
|
||||||
|
profile001 = startProfile(sketch001, at = [281.54, 305.81])
|
||||||
|
|> angledLine(angle = 0, length = 123.43, tag = $rectangleSegmentA001)
|
||||||
|
|> angledLine(angle = segAng(rectangleSegmentA001) - 90, length = 85.99)
|
||||||
|
|> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001))
|
||||||
|
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||||
|
|> close()
|
||||||
|
extrude(profile001, length = 100)
|
||||||
|
|> translate(z = 100)
|
||||||
|
"#
|
||||||
|
.to_string(),
|
||||||
|
);
|
||||||
|
|
||||||
|
let result = cache_test(
|
||||||
|
"multi_file_other_file_only_change",
|
||||||
|
vec![
|
||||||
|
Variation {
|
||||||
|
code,
|
||||||
|
other_files: vec![other_file],
|
||||||
|
settings: &Default::default(),
|
||||||
|
},
|
||||||
|
Variation {
|
||||||
|
code,
|
||||||
|
other_files: vec![other_file2],
|
||||||
|
settings: &Default::default(),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
)
|
||||||
|
.await;
|
||||||
|
|
||||||
|
let r1 = result.first().unwrap();
|
||||||
|
let r2 = result.last().unwrap();
|
||||||
|
|
||||||
|
assert!(r1.1 != r2.1, "The images should be different");
|
||||||
|
// Make sure the outcomes are different.
|
||||||
|
assert!(
|
||||||
|
r1.2.artifact_graph != r2.2.artifact_graph,
|
||||||
|
"The outcomes artifact graphs should be different"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
@ -1,9 +0,0 @@
|
|||||||
part001 = startSketchOn(XY)
|
|
||||||
|> startProfile(at = [0, 0])
|
|
||||||
|> line(end = [1, 3.82], tag = $seg01)
|
|
||||||
|> angled(
|
|
||||||
angle = -angleToMatchLengthX(seg01, 3, %),
|
|
||||||
endAbsoluteX = 3,
|
|
||||||
)
|
|
||||||
|> close()
|
|
||||||
|> extrude(length = 10)
|
|
@ -1,9 +0,0 @@
|
|||||||
part001 = startSketchOn(XY)
|
|
||||||
|> startProfile(at = [0, 0])
|
|
||||||
|> line(end = [1, 3.82], tag = $seg01)
|
|
||||||
|> angledLine(
|
|
||||||
angle = -angleToMatchLengthY(seg01, 3, %),
|
|
||||||
endAbsoluteX = 3,
|
|
||||||
)
|
|
||||||
|> close()
|
|
||||||
|> extrude(length = 10)
|
|
@ -32,13 +32,13 @@ bracket = startSketchOn(XY)
|
|||||||
|> fillet(
|
|> fillet(
|
||||||
radius = filletR,
|
radius = filletR,
|
||||||
tags = [
|
tags = [
|
||||||
getPreviousAdjacentEdge('innerEdge', %)
|
getPreviousAdjacentEdge('innerEdge')
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|> fillet(
|
|> fillet(
|
||||||
radius = filletR + thickness,
|
radius = filletR + thickness,
|
||||||
tags = [
|
tags = [
|
||||||
getPreviousAdjacentEdge('outerEdge', %)
|
getPreviousAdjacentEdge('outerEdge')
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -1,79 +0,0 @@
|
|||||||
rpizWidth = 30
|
|
||||||
rpizLength = 65
|
|
||||||
|
|
||||||
caseThickness = 1
|
|
||||||
|
|
||||||
border = 4
|
|
||||||
|
|
||||||
screwHeight = 4
|
|
||||||
|
|
||||||
caseWidth = rpizWidth + border * 2
|
|
||||||
caseLength = rpizLength + border * 2
|
|
||||||
caseHeight = 8
|
|
||||||
|
|
||||||
widthBetweenScrews = 23
|
|
||||||
lengthBetweenScrews = 29 * 2
|
|
||||||
|
|
||||||
miniHdmiDistance = 12.4
|
|
||||||
microUsb1Distance = 41.4
|
|
||||||
microUsb2Distance = 54
|
|
||||||
|
|
||||||
miniHdmiWidth = 11.2
|
|
||||||
microUsbWidth = 7.4
|
|
||||||
connectorPadding = 4
|
|
||||||
|
|
||||||
miniHdmiHole = startSketchOn(XY)
|
|
||||||
|> startProfile(at = [0, border + miniHdmiDistance - (miniHdmiWidth / 2)])
|
|
||||||
|> lineTo([
|
|
||||||
0,
|
|
||||||
border + miniHdmiDistance + miniHdmiWidth / 2
|
|
||||||
], %)
|
|
||||||
|> lineTo([
|
|
||||||
1,
|
|
||||||
border + miniHdmiDistance + miniHdmiWidth / 2
|
|
||||||
], %)
|
|
||||||
|> lineTo([
|
|
||||||
1,
|
|
||||||
border + miniHdmiDistance - (miniHdmiWidth / 2)
|
|
||||||
], %)
|
|
||||||
|> close()
|
|
||||||
|
|
||||||
case = startSketchOn(XY)
|
|
||||||
|> startProfile(at = [0, 0])
|
|
||||||
|> line(endAbsolute = [caseWidth, 0], tag = $edge1)
|
|
||||||
|> line(endAbsolute = [caseWidth, caseLength], tag = $edge2)
|
|
||||||
|> line(endAbsolute = [0, caseLength], tag = $edge3)
|
|
||||||
|> close(tag = $edge4)
|
|
||||||
|> extrude(length = caseHeight)
|
|
||||||
|> fillet(
|
|
||||||
radius = 1,
|
|
||||||
tags = [
|
|
||||||
getNextAdjacentEdge(edge1),
|
|
||||||
getNextAdjacentEdge(edge2),
|
|
||||||
getNextAdjacentEdge(edge3),
|
|
||||||
getNextAdjacentEdge(edge4)
|
|
||||||
],
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
fn m25Screw(x, y, height) {
|
|
||||||
screw = startSketchOn(XY)
|
|
||||||
|> startProfile(at = [0, 0])
|
|
||||||
|> circle(center= [x, y], radius=2.5)
|
|
||||||
|> subtract2d(tool = circle(center= [x, y], radius = 1.25))
|
|
||||||
|> extrude(length = height)
|
|
||||||
return screw
|
|
||||||
}
|
|
||||||
|
|
||||||
m25Screw(x = border + rpizWidth / 2 - (widthBetweenScrews / 2), y = 0 + border + rpizLength / 2 - (lengthBetweenScrews / 2), height = screwHeight)
|
|
||||||
|
|
||||||
m25Screw(x = border + rpizWidth / 2 - (widthBetweenScrews / 2), y = 0 + border + rpizLength / 2 + lengthBetweenScrews / 2, height = screwHeight)
|
|
||||||
|
|
||||||
m25Screw(x = border + rpizWidth / 2 + widthBetweenScrews / 2, y = 0 + border + rpizLength / 2 + lengthBetweenScrews / 2, height = screwHeight)
|
|
||||||
|
|
||||||
m25Screw(x = border + rpizWidth / 2 + widthBetweenScrews / 2, y = 0 + border + rpizLength / 2 - (lengthBetweenScrews / 2), height = screwHeight)
|
|
||||||
|
|
||||||
shell(
|
|
||||||
faces = [END],
|
|
||||||
thickness = caseThickness
|
|
||||||
)
|
|
@ -1,20 +1,20 @@
|
|||||||
svg = startSketchOn(XY)
|
svg = startSketchOn(XY)
|
||||||
|> lineTo([0],%)
|
|> line(endAbsolute = [0])
|
||||||
|> lineTo([0 + 1],%)
|
|> line(endAbsolute = [0 + 1])
|
||||||
|> lineTo([0 + 1 + 2],%)
|
|> line(endAbsolute = [0 + 1 + 2])
|
||||||
|> lineTo([0 + 1 + 2 + 3],%)
|
|> line(endAbsolute = [0 + 1 + 2 + 3])
|
||||||
|> lineTo([0 + 1 + 2 + 3 + 4],%)
|
|> line(endAbsolute = [0 + 1 + 2 + 3 + 4])
|
||||||
|> lineTo([0 + 1 + 2 + 3 + 4 + 5],%)
|
|> line(endAbsolute = [0 + 1 + 2 + 3 + 4 + 5])
|
||||||
|> lineTo([0 + 1 + 2 + 3 + 4 + 5 + 6],%)
|
|> line(endAbsolute = [0 + 1 + 2 + 3 + 4 + 5 + 6])
|
||||||
|> lineTo([0 + 1 + 2 + 3 + 4 + 5 + 6 + 7],%)
|
|> line(endAbsolute = [0 + 1 + 2 + 3 + 4 + 5 + 6 + 7])
|
||||||
|> lineTo([0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8],%)
|
|> line(endAbsolute = [0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8])
|
||||||
|> lineTo([0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9],%)
|
|> line(endAbsolute = [0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9])
|
||||||
|> lineTo([0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10],%)
|
|> line(endAbsolute = [0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10])
|
||||||
|> lineTo([0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11],%)
|
|> line(endAbsolute = [0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11])
|
||||||
|> lineTo([0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12],%)
|
|> line(endAbsolute = [0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12])
|
||||||
|> lineTo([0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13],%)
|
|> line(endAbsolute = [0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13])
|
||||||
|> lineTo([0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14],%)
|
|> line(endAbsolute = [0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14])
|
||||||
|> lineTo([0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15],%)
|
|> line(endAbsolute = [0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15])
|
||||||
|> lineTo([0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16],%)
|
|> line(endAbsolute = [0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16])
|
||||||
|> lineTo([0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17],%)
|
|> line(endAbsolute = [0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17])
|
||||||
|> lineTo([0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18],%)
|
|> line(endAbsolute = [0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18])
|
||||||
|
@ -1,42 +0,0 @@
|
|||||||
triangleHeight = 200
|
|
||||||
plumbusLen = 100
|
|
||||||
radius = 80
|
|
||||||
|
|
||||||
triangleLen = 500
|
|
||||||
p = startSketchOn(XY)
|
|
||||||
|> startProfile(at = [0, 0])
|
|
||||||
|> angledLine(angle = 60, length = triangleLen, tag = $a)
|
|
||||||
|> angledLine(angle = 180, length = triangleLen, tag = $b)
|
|
||||||
|> angledLine(angle = 300, length = triangleLen, tag = $c)
|
|
||||||
|> extrude(length = triangleHeight)
|
|
||||||
|
|
||||||
fn circl(@x, face) {
|
|
||||||
return startSketchOn(p, face = face)
|
|
||||||
|> startProfile(at = [x + radius, triangleHeight/2])
|
|
||||||
|> arc(
|
|
||||||
angleStart = 0,
|
|
||||||
angleEnd = 360,
|
|
||||||
radius = radius,
|
|
||||||
tag = $arc_tag,
|
|
||||||
)
|
|
||||||
|> close()
|
|
||||||
}
|
|
||||||
|
|
||||||
c1 = circl(-200, face = c)
|
|
||||||
plumbus1 =
|
|
||||||
c1
|
|
||||||
|> extrude(length = plumbusLen)
|
|
||||||
|> fillet(
|
|
||||||
radius = 5,
|
|
||||||
tags = [c1.tags.arc_tag, getOppositeEdge(c1.tags.arc_tag)]
|
|
||||||
)
|
|
||||||
c2 = circl(200, face = a)
|
|
||||||
plumbus0 =
|
|
||||||
c2
|
|
||||||
|> extrude(length = plumbusLen)
|
|
||||||
|> fillet(
|
|
||||||
radius = 5,
|
|
||||||
tags = [c2.tags.arc_tag, getOppositeEdge(c2.tags.arc_tag)]
|
|
||||||
, %)
|
|
||||||
|
|
||||||
|
|
@ -21,10 +21,10 @@ sketch001 = startSketchOn(XZ)
|
|||||||
|> xLine(endAbsolute = slateWidthHalf + templateThickness, tag = $seg04)
|
|> xLine(endAbsolute = slateWidthHalf + templateThickness, tag = $seg04)
|
||||||
|> yLine(length = -length002, tag = $seg03)
|
|> yLine(length = -length002, tag = $seg03)
|
||||||
|> xLine(endAbsolute = 0, tag = $seg02)
|
|> xLine(endAbsolute = 0, tag = $seg02)
|
||||||
|> xLine(length = -segLen(seg02, %))
|
|> xLine(length = -segLen(seg02))
|
||||||
|> yLine(length = segLen(seg03, %))
|
|> yLine(length = segLen(seg03))
|
||||||
|> xLine(length = segLen(seg04, %))
|
|> xLine(length = segLen(seg04))
|
||||||
|> yLine(length = segLen(seg05, %))
|
|> yLine(length = segLen(seg05))
|
||||||
|> arc(
|
|> arc(
|
||||||
angleEnd = 90,
|
angleEnd = 90,
|
||||||
angleStart = 180,
|
angleStart = 180,
|
||||||
@ -36,16 +36,16 @@ extrude001 = extrude(sketch001, length = 5)
|
|||||||
sketch002 = startSketchOn(extrude001, face = 'START')
|
sketch002 = startSketchOn(extrude001, face = 'START')
|
||||||
|> startProfile(at = [-slateWidthHalf, -templateGap * 2 - (templateDiameter / 2)])
|
|> startProfile(at = [-slateWidthHalf, -templateGap * 2 - (templateDiameter / 2)])
|
||||||
|> xLine(length = -7, tag = $rectangleSegmentA001)
|
|> xLine(length = -7, tag = $rectangleSegmentA001)
|
||||||
|> angledLine(angle = segAng(rectangleSegmentA001, %) + 90, length = minClampingDistance, tag = $rectangleSegmentB001)
|
|> angledLine(angle = segAng(rectangleSegmentA001) + 90, length = minClampingDistance, tag = $rectangleSegmentB001)
|
||||||
|> angledLine(angle = segAng(rectangleSegmentA001, %), length = -segLen(rectangleSegmentA001, %), tag = $rectangleSegmentC001)
|
|> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001), tag = $rectangleSegmentC001)
|
||||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||||
|> close()
|
|> close()
|
||||||
extrude002 = extrude(sketch002, length = 7.5)
|
extrude002 = extrude(sketch002, length = 7.5)
|
||||||
sketch003 = startSketchOn(extrude001, face = 'START')
|
sketch003 = startSketchOn(extrude001, face = 'START')
|
||||||
|> startProfile(at = [slateWidthHalf, -templateGap * 2 - (templateDiameter / 2)])
|
|> startProfile(at = [slateWidthHalf, -templateGap * 2 - (templateDiameter / 2)])
|
||||||
|> xLine(length = 7, tag = $rectangleSegmentA002)
|
|> xLine(length = 7, tag = $rectangleSegmentA002)
|
||||||
|> angledLine(angle = segAng(rectangleSegmentA002, %) - 90, length = minClampingDistance)
|
|> angledLine(angle = segAng(rectangleSegmentA002) - 90, length = minClampingDistance)
|
||||||
|> angledLine(angle = segAng(rectangleSegmentA002, %), length = -segLen(rectangleSegmentA002, %))
|
|> angledLine(angle = segAng(rectangleSegmentA002), length = -segLen(rectangleSegmentA002))
|
||||||
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||||
|> close()
|
|> close()
|
||||||
extrude003 = extrude(sketch003, length = 7.5)
|
extrude003 = extrude(sketch003, length = 7.5)
|
||||||
|
Binary file not shown.
After Width: | Height: | Size: 35 KiB |
Binary file not shown.
After Width: | Height: | Size: 33 KiB |
@ -141,7 +141,7 @@ fn generate_index(combined: &IndexMap<String, Box<dyn StdLibFn>>, kcl_lib: &[Doc
|
|||||||
types
|
types
|
||||||
.get_mut("Primitive types")
|
.get_mut("Primitive types")
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.push((name.to_owned(), format!("types.md#{name}")));
|
.push((name.to_owned(), format!("types#{name}")));
|
||||||
}
|
}
|
||||||
|
|
||||||
for d in kcl_lib {
|
for d in kcl_lib {
|
||||||
|
@ -80,6 +80,15 @@ pub(super) enum CacheResult {
|
|||||||
/// The program that needs to be executed.
|
/// The program that needs to be executed.
|
||||||
program: Node<Program>,
|
program: Node<Program>,
|
||||||
},
|
},
|
||||||
|
/// Check only the imports, and not the main program.
|
||||||
|
/// Before sending this we already checked the main program and it is the same.
|
||||||
|
/// And we made sure the import statements > 0.
|
||||||
|
CheckImportsOnly {
|
||||||
|
/// Argument is whether we need to reapply settings.
|
||||||
|
reapply_settings: bool,
|
||||||
|
/// The ast of the main file, which did not change.
|
||||||
|
ast: Node<Program>,
|
||||||
|
},
|
||||||
/// Argument is whether we need to reapply settings.
|
/// Argument is whether we need to reapply settings.
|
||||||
NoAction(bool),
|
NoAction(bool),
|
||||||
}
|
}
|
||||||
@ -105,9 +114,21 @@ pub(super) async fn get_changed_program(old: CacheInformation<'_>, new: CacheInf
|
|||||||
// If the ASTs are the EXACT same we return None.
|
// If the ASTs are the EXACT same we return None.
|
||||||
// We don't even need to waste time computing the digests.
|
// We don't even need to waste time computing the digests.
|
||||||
if old.ast == new.ast {
|
if old.ast == new.ast {
|
||||||
|
// First we need to make sure an imported file didn't change it's ast.
|
||||||
|
// We know they have the same imports because the ast is the same.
|
||||||
|
// If we have no imports, we can skip this.
|
||||||
|
if !old.ast.has_import_statements() {
|
||||||
|
println!("No imports, no need to check.");
|
||||||
return CacheResult::NoAction(reapply_settings);
|
return CacheResult::NoAction(reapply_settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Tell the CacheResult we need to check all the imports, but the main ast is the same.
|
||||||
|
return CacheResult::CheckImportsOnly {
|
||||||
|
reapply_settings,
|
||||||
|
ast: old.ast.clone(),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
// We have to clone just because the digests are stored inline :-(
|
// We have to clone just because the digests are stored inline :-(
|
||||||
let mut old_ast = old.ast.clone();
|
let mut old_ast = old.ast.clone();
|
||||||
let mut new_ast = new.ast.clone();
|
let mut new_ast = new.ast.clone();
|
||||||
@ -119,9 +140,21 @@ pub(super) async fn get_changed_program(old: CacheInformation<'_>, new: CacheInf
|
|||||||
|
|
||||||
// Check if the digest is the same.
|
// Check if the digest is the same.
|
||||||
if old_ast.digest == new_ast.digest {
|
if old_ast.digest == new_ast.digest {
|
||||||
|
// First we need to make sure an imported file didn't change it's ast.
|
||||||
|
// We know they have the same imports because the ast is the same.
|
||||||
|
// If we have no imports, we can skip this.
|
||||||
|
if !old.ast.has_import_statements() {
|
||||||
|
println!("No imports, no need to check.");
|
||||||
return CacheResult::NoAction(reapply_settings);
|
return CacheResult::NoAction(reapply_settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Tell the CacheResult we need to check all the imports, but the main ast is the same.
|
||||||
|
return CacheResult::CheckImportsOnly {
|
||||||
|
reapply_settings,
|
||||||
|
ast: old.ast.clone(),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
// Check if the annotations are different.
|
// Check if the annotations are different.
|
||||||
if !old_ast
|
if !old_ast
|
||||||
.inner_attrs
|
.inner_attrs
|
||||||
@ -242,6 +275,8 @@ fn generate_changed_program(old_ast: Node<Program>, mut new_ast: Node<Program>,
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
|
use pretty_assertions::assert_eq;
|
||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::execution::{parse_execute, parse_execute_with_project_dir, ExecTestResults};
|
use crate::execution::{parse_execute, parse_execute_with_project_dir, ExecTestResults};
|
||||||
|
|
||||||
@ -658,6 +693,92 @@ extrude(profile001, length = 100)"#
|
|||||||
)
|
)
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert_eq!(result, CacheResult::NoAction(false));
|
let CacheResult::CheckImportsOnly { reapply_settings, .. } = result else {
|
||||||
|
panic!("Expected CheckImportsOnly, got {:?}", result);
|
||||||
|
};
|
||||||
|
|
||||||
|
assert_eq!(reapply_settings, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[tokio::test(flavor = "multi_thread")]
|
||||||
|
async fn test_cache_multi_file_only_other_file_changes_should_reexecute() {
|
||||||
|
let code = r#"import "toBeImported.kcl" as importedCube
|
||||||
|
|
||||||
|
importedCube
|
||||||
|
|
||||||
|
sketch001 = startSketchOn(XZ)
|
||||||
|
profile001 = startProfile(sketch001, at = [-134.53, -56.17])
|
||||||
|
|> angledLine(angle = 0, length = 79.05, tag = $rectangleSegmentA001)
|
||||||
|
|> angledLine(angle = segAng(rectangleSegmentA001) - 90, length = 76.28)
|
||||||
|
|> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001), tag = $seg01)
|
||||||
|
|> line(endAbsolute = [profileStartX(%), profileStartY(%)], tag = $seg02)
|
||||||
|
|> close()
|
||||||
|
extrude001 = extrude(profile001, length = 100)
|
||||||
|
sketch003 = startSketchOn(extrude001, face = seg02)
|
||||||
|
sketch002 = startSketchOn(extrude001, face = seg01)
|
||||||
|
"#;
|
||||||
|
|
||||||
|
let other_file = (
|
||||||
|
std::path::PathBuf::from("toBeImported.kcl"),
|
||||||
|
r#"sketch001 = startSketchOn(XZ)
|
||||||
|
profile001 = startProfile(sketch001, at = [281.54, 305.81])
|
||||||
|
|> angledLine(angle = 0, length = 123.43, tag = $rectangleSegmentA001)
|
||||||
|
|> angledLine(angle = segAng(rectangleSegmentA001) - 90, length = 85.99)
|
||||||
|
|> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001))
|
||||||
|
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||||
|
|> close()
|
||||||
|
extrude(profile001, length = 100)"#
|
||||||
|
.to_string(),
|
||||||
|
);
|
||||||
|
|
||||||
|
let other_file2 = (
|
||||||
|
std::path::PathBuf::from("toBeImported.kcl"),
|
||||||
|
r#"sketch001 = startSketchOn(XZ)
|
||||||
|
profile001 = startProfile(sketch001, at = [281.54, 305.81])
|
||||||
|
|> angledLine(angle = 0, length = 123.43, tag = $rectangleSegmentA001)
|
||||||
|
|> angledLine(angle = segAng(rectangleSegmentA001) - 90, length = 85.99)
|
||||||
|
|> angledLine(angle = segAng(rectangleSegmentA001), length = -segLen(rectangleSegmentA001))
|
||||||
|
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
||||||
|
|> close()
|
||||||
|
extrude(profile001, length = 100)
|
||||||
|
|> translate(z=100)
|
||||||
|
"#
|
||||||
|
.to_string(),
|
||||||
|
);
|
||||||
|
|
||||||
|
let tmp_dir = std::env::temp_dir();
|
||||||
|
let tmp_dir = tmp_dir.join(uuid::Uuid::new_v4().to_string());
|
||||||
|
|
||||||
|
// Create a temporary file for each of the other files.
|
||||||
|
let tmp_file = tmp_dir.join(other_file.0);
|
||||||
|
std::fs::create_dir_all(tmp_file.parent().unwrap()).unwrap();
|
||||||
|
std::fs::write(&tmp_file, other_file.1).unwrap();
|
||||||
|
|
||||||
|
let ExecTestResults { program, exec_ctxt, .. } =
|
||||||
|
parse_execute_with_project_dir(code, Some(tmp_dir)).await.unwrap();
|
||||||
|
|
||||||
|
// Change the other file.
|
||||||
|
std::fs::write(tmp_file, other_file2.1).unwrap();
|
||||||
|
|
||||||
|
let mut new_program = crate::Program::parse_no_errs(code).unwrap();
|
||||||
|
new_program.compute_digest();
|
||||||
|
|
||||||
|
let result = get_changed_program(
|
||||||
|
CacheInformation {
|
||||||
|
ast: &program.ast,
|
||||||
|
settings: &exec_ctxt.settings,
|
||||||
|
},
|
||||||
|
CacheInformation {
|
||||||
|
ast: &new_program.ast,
|
||||||
|
settings: &exec_ctxt.settings,
|
||||||
|
},
|
||||||
|
)
|
||||||
|
.await;
|
||||||
|
|
||||||
|
let CacheResult::CheckImportsOnly { reapply_settings, .. } = result else {
|
||||||
|
panic!("Expected CheckImportsOnly, got {:?}", result);
|
||||||
|
};
|
||||||
|
|
||||||
|
assert_eq!(reapply_settings, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,9 +19,9 @@ use crate::{
|
|||||||
modules::{ModuleId, ModulePath, ModuleRepr},
|
modules::{ModuleId, ModulePath, ModuleRepr},
|
||||||
parsing::ast::types::{
|
parsing::ast::types::{
|
||||||
Annotation, ArrayExpression, ArrayRangeExpression, BinaryExpression, BinaryOperator, BinaryPart, BodyItem,
|
Annotation, ArrayExpression, ArrayRangeExpression, BinaryExpression, BinaryOperator, BinaryPart, BodyItem,
|
||||||
CallExpression, CallExpressionKw, Expr, FunctionExpression, IfExpression, ImportPath, ImportSelector,
|
CallExpressionKw, Expr, FunctionExpression, IfExpression, ImportPath, ImportSelector, ItemVisibility,
|
||||||
ItemVisibility, LiteralIdentifier, LiteralValue, MemberExpression, MemberObject, Name, Node, NodeRef,
|
LiteralIdentifier, LiteralValue, MemberExpression, MemberObject, Name, Node, NodeRef, ObjectExpression,
|
||||||
ObjectExpression, PipeExpression, Program, TagDeclarator, Type, UnaryExpression, UnaryOperator,
|
PipeExpression, Program, TagDeclarator, Type, UnaryExpression, UnaryOperator,
|
||||||
},
|
},
|
||||||
source_range::SourceRange,
|
source_range::SourceRange,
|
||||||
std::{
|
std::{
|
||||||
@ -668,7 +668,6 @@ impl ExecutorContext {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Expr::CallExpression(call_expression) => call_expression.execute(exec_state, self).await?,
|
|
||||||
Expr::CallExpressionKw(call_expression) => call_expression.execute(exec_state, self).await?,
|
Expr::CallExpressionKw(call_expression) => call_expression.execute(exec_state, self).await?,
|
||||||
Expr::PipeExpression(pipe_expression) => pipe_expression.get_result(exec_state, self).await?,
|
Expr::PipeExpression(pipe_expression) => pipe_expression.get_result(exec_state, self).await?,
|
||||||
Expr::PipeSubstitution(pipe_substitution) => match statement_kind {
|
Expr::PipeSubstitution(pipe_substitution) => match statement_kind {
|
||||||
@ -755,7 +754,6 @@ impl BinaryPart {
|
|||||||
BinaryPart::Literal(literal) => Ok(KclValue::from_literal((**literal).clone(), exec_state)),
|
BinaryPart::Literal(literal) => Ok(KclValue::from_literal((**literal).clone(), exec_state)),
|
||||||
BinaryPart::Name(name) => name.get_result(exec_state, ctx).await.cloned(),
|
BinaryPart::Name(name) => name.get_result(exec_state, ctx).await.cloned(),
|
||||||
BinaryPart::BinaryExpression(binary_expression) => binary_expression.get_result(exec_state, ctx).await,
|
BinaryPart::BinaryExpression(binary_expression) => binary_expression.get_result(exec_state, ctx).await,
|
||||||
BinaryPart::CallExpression(call_expression) => call_expression.execute(exec_state, ctx).await,
|
|
||||||
BinaryPart::CallExpressionKw(call_expression) => call_expression.execute(exec_state, ctx).await,
|
BinaryPart::CallExpressionKw(call_expression) => call_expression.execute(exec_state, ctx).await,
|
||||||
BinaryPart::UnaryExpression(unary_expression) => unary_expression.get_result(exec_state, ctx).await,
|
BinaryPart::UnaryExpression(unary_expression) => unary_expression.get_result(exec_state, ctx).await,
|
||||||
BinaryPart::MemberExpression(member_expression) => member_expression.get_result(exec_state),
|
BinaryPart::MemberExpression(member_expression) => member_expression.get_result(exec_state),
|
||||||
@ -1426,12 +1424,6 @@ impl Node<CallExpressionKw> {
|
|||||||
e.add_source_ranges(vec![callsite])
|
e.add_source_ranges(vec![callsite])
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
#[cfg(feature = "artifact-graph")]
|
|
||||||
if matches!(fn_src, FunctionSource::User { .. }) {
|
|
||||||
// Track return operation.
|
|
||||||
exec_state.global.operations.push(Operation::GroupEnd);
|
|
||||||
}
|
|
||||||
|
|
||||||
let result = return_value.ok_or_else(move || {
|
let result = return_value.ok_or_else(move || {
|
||||||
let mut source_ranges: Vec<SourceRange> = vec![callsite];
|
let mut source_ranges: Vec<SourceRange> = vec![callsite];
|
||||||
// We want to send the source range of the original function.
|
// We want to send the source range of the original function.
|
||||||
@ -1450,145 +1442,6 @@ impl Node<CallExpressionKw> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Node<CallExpression> {
|
|
||||||
#[async_recursion]
|
|
||||||
pub async fn execute(&self, exec_state: &mut ExecState, ctx: &ExecutorContext) -> Result<KclValue, KclError> {
|
|
||||||
let fn_name = &self.callee;
|
|
||||||
let callsite = SourceRange::from(self);
|
|
||||||
|
|
||||||
let mut fn_args: Vec<Arg> = Vec::with_capacity(self.arguments.len());
|
|
||||||
|
|
||||||
for arg_expr in &self.arguments {
|
|
||||||
let metadata = Metadata {
|
|
||||||
source_range: SourceRange::from(arg_expr),
|
|
||||||
};
|
|
||||||
let value = ctx
|
|
||||||
.execute_expr(arg_expr, exec_state, &metadata, &[], StatementKind::Expression)
|
|
||||||
.await?;
|
|
||||||
let arg = Arg::new(value, SourceRange::from(arg_expr));
|
|
||||||
fn_args.push(arg);
|
|
||||||
}
|
|
||||||
let fn_args = fn_args; // remove mutability
|
|
||||||
|
|
||||||
match ctx.stdlib.get_either(fn_name) {
|
|
||||||
FunctionKind::Core(func) => {
|
|
||||||
if func.deprecated() {
|
|
||||||
exec_state.warn(CompilationError::err(
|
|
||||||
self.callee.as_source_range(),
|
|
||||||
format!("`{fn_name}` is deprecated, see the docs for a recommended replacement"),
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(feature = "artifact-graph")]
|
|
||||||
let op = if func.feature_tree_operation() {
|
|
||||||
let op_labeled_args = func
|
|
||||||
.args(false)
|
|
||||||
.iter()
|
|
||||||
.zip(&fn_args)
|
|
||||||
.map(|(k, arg)| {
|
|
||||||
(
|
|
||||||
k.name.clone(),
|
|
||||||
OpArg::new(OpKclValue::from(&arg.value), arg.source_range),
|
|
||||||
)
|
|
||||||
})
|
|
||||||
.collect();
|
|
||||||
Some(Operation::StdLibCall {
|
|
||||||
std_lib_fn: (&func).into(),
|
|
||||||
unlabeled_arg: None,
|
|
||||||
labeled_args: op_labeled_args,
|
|
||||||
source_range: callsite,
|
|
||||||
is_error: false,
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
None
|
|
||||||
};
|
|
||||||
|
|
||||||
// Attempt to call the function.
|
|
||||||
let args = crate::std::Args::new(
|
|
||||||
fn_args,
|
|
||||||
self.into(),
|
|
||||||
ctx.clone(),
|
|
||||||
exec_state.mod_local.pipe_value.clone().map(|v| Arg::new(v, callsite)),
|
|
||||||
);
|
|
||||||
let mut return_value = {
|
|
||||||
// Don't early-return in this block.
|
|
||||||
exec_state.mut_stack().push_new_env_for_rust_call();
|
|
||||||
let result = func.std_lib_fn()(exec_state, args).await;
|
|
||||||
exec_state.mut_stack().pop_env();
|
|
||||||
|
|
||||||
#[cfg(feature = "artifact-graph")]
|
|
||||||
if let Some(mut op) = op {
|
|
||||||
op.set_std_lib_call_is_error(result.is_err());
|
|
||||||
// Track call operation. We do this after the call
|
|
||||||
// since things like patternTransform may call user code
|
|
||||||
// before running, and we will likely want to use the
|
|
||||||
// return value. The call takes ownership of the args,
|
|
||||||
// so we need to build the op before the call.
|
|
||||||
exec_state.global.operations.push(op);
|
|
||||||
}
|
|
||||||
result
|
|
||||||
}?;
|
|
||||||
|
|
||||||
update_memory_for_tags_of_geometry(&mut return_value, exec_state)?;
|
|
||||||
|
|
||||||
Ok(return_value)
|
|
||||||
}
|
|
||||||
FunctionKind::UserDefined => {
|
|
||||||
let source_range = SourceRange::from(self);
|
|
||||||
// Clone the function so that we can use a mutable reference to
|
|
||||||
// exec_state.
|
|
||||||
let func = fn_name.get_result(exec_state, ctx).await?.clone();
|
|
||||||
|
|
||||||
// Track call operation.
|
|
||||||
#[cfg(feature = "artifact-graph")]
|
|
||||||
exec_state.global.operations.push(Operation::GroupBegin {
|
|
||||||
group: Group::FunctionCall {
|
|
||||||
name: Some(fn_name.to_string()),
|
|
||||||
function_source_range: func.function_def_source_range().unwrap_or_default(),
|
|
||||||
unlabeled_arg: None,
|
|
||||||
// TODO: Add the arguments for legacy positional parameters.
|
|
||||||
labeled_args: Default::default(),
|
|
||||||
},
|
|
||||||
source_range: callsite,
|
|
||||||
});
|
|
||||||
|
|
||||||
let Some(fn_src) = func.as_fn() else {
|
|
||||||
return Err(KclError::Semantic(KclErrorDetails {
|
|
||||||
message: "cannot call this because it isn't a function".to_string(),
|
|
||||||
source_ranges: vec![source_range],
|
|
||||||
}));
|
|
||||||
};
|
|
||||||
let return_value = fn_src
|
|
||||||
.call(Some(fn_name.to_string()), exec_state, ctx, fn_args, source_range)
|
|
||||||
.await
|
|
||||||
.map_err(|e| {
|
|
||||||
// Add the call expression to the source ranges.
|
|
||||||
// TODO currently ignored by the frontend
|
|
||||||
e.add_source_ranges(vec![source_range])
|
|
||||||
})?;
|
|
||||||
|
|
||||||
let result = return_value.ok_or_else(move || {
|
|
||||||
let mut source_ranges: Vec<SourceRange> = vec![source_range];
|
|
||||||
// We want to send the source range of the original function.
|
|
||||||
if let KclValue::Function { meta, .. } = func {
|
|
||||||
source_ranges = meta.iter().map(|m| m.source_range).collect();
|
|
||||||
};
|
|
||||||
KclError::UndefinedValue(KclErrorDetails {
|
|
||||||
message: format!("Result of function {} is undefined", fn_name),
|
|
||||||
source_ranges,
|
|
||||||
})
|
|
||||||
})?;
|
|
||||||
|
|
||||||
// Track return operation.
|
|
||||||
#[cfg(feature = "artifact-graph")]
|
|
||||||
exec_state.global.operations.push(Operation::GroupEnd);
|
|
||||||
|
|
||||||
Ok(result)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn update_memory_for_tags_of_geometry(result: &mut KclValue, exec_state: &mut ExecState) -> Result<(), KclError> {
|
fn update_memory_for_tags_of_geometry(result: &mut KclValue, exec_state: &mut ExecState) -> Result<(), KclError> {
|
||||||
// If the return result is a sketch or solid, we want to update the
|
// If the return result is a sketch or solid, we want to update the
|
||||||
// memory for the tags of the group.
|
// memory for the tags of the group.
|
||||||
@ -2474,7 +2327,15 @@ impl FunctionSource {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
call_user_defined_function_kw(fn_name.as_deref(), args.kw_args, *memory, ast, exec_state, ctx).await
|
let result =
|
||||||
|
call_user_defined_function_kw(fn_name.as_deref(), args.kw_args, *memory, ast, exec_state, ctx)
|
||||||
|
.await;
|
||||||
|
|
||||||
|
// Track return operation.
|
||||||
|
#[cfg(feature = "artifact-graph")]
|
||||||
|
exec_state.global.operations.push(Operation::GroupEnd);
|
||||||
|
|
||||||
|
result
|
||||||
}
|
}
|
||||||
FunctionSource::None => unreachable!(),
|
FunctionSource::None => unreachable!(),
|
||||||
}
|
}
|
||||||
@ -2791,13 +2652,12 @@ d = b + c
|
|||||||
let mut exec_state = ExecState::new(&exec_ctxt);
|
let mut exec_state = ExecState::new(&exec_ctxt);
|
||||||
|
|
||||||
exec_ctxt
|
exec_ctxt
|
||||||
.run_concurrent(
|
.run(
|
||||||
&crate::Program {
|
&crate::Program {
|
||||||
ast: main.clone(),
|
ast: main.clone(),
|
||||||
original_file_contents: "".to_owned(),
|
original_file_contents: "".to_owned(),
|
||||||
},
|
},
|
||||||
&mut exec_state,
|
&mut exec_state,
|
||||||
false,
|
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
@ -263,20 +263,6 @@ impl KclValue {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "artifact-graph")]
|
|
||||||
pub(crate) fn function_def_source_range(&self) -> Option<SourceRange> {
|
|
||||||
let KclValue::Function {
|
|
||||||
value: FunctionSource::User { ast, .. },
|
|
||||||
..
|
|
||||||
} = self
|
|
||||||
else {
|
|
||||||
return None;
|
|
||||||
};
|
|
||||||
// TODO: It would be nice if we could extract the source range starting
|
|
||||||
// at the fn, but that's the variable declaration.
|
|
||||||
Some(ast.as_source_range())
|
|
||||||
}
|
|
||||||
|
|
||||||
#[allow(unused)]
|
#[allow(unused)]
|
||||||
pub(crate) fn none() -> Self {
|
pub(crate) fn none() -> Self {
|
||||||
Self::KclNone {
|
Self::KclNone {
|
||||||
|
@ -42,6 +42,7 @@ use crate::{
|
|||||||
parsing::ast::types::{Expr, ImportPath, NodeRef},
|
parsing::ast::types::{Expr, ImportPath, NodeRef},
|
||||||
source_range::SourceRange,
|
source_range::SourceRange,
|
||||||
std::StdLib,
|
std::StdLib,
|
||||||
|
walk::{Universe, UniverseMap},
|
||||||
CompilationError, ExecError, KclErrorWithOutputs,
|
CompilationError, ExecError, KclErrorWithOutputs,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -586,7 +587,7 @@ impl ExecutorContext {
|
|||||||
pub async fn run_with_caching(&self, program: crate::Program) -> Result<ExecOutcome, KclErrorWithOutputs> {
|
pub async fn run_with_caching(&self, program: crate::Program) -> Result<ExecOutcome, KclErrorWithOutputs> {
|
||||||
assert!(!self.is_mock());
|
assert!(!self.is_mock());
|
||||||
|
|
||||||
let (program, mut exec_state, preserve_mem) = if let Some(OldAstState {
|
let (program, mut exec_state, preserve_mem, imports_info) = if let Some(OldAstState {
|
||||||
ast: old_ast,
|
ast: old_ast,
|
||||||
exec_state: mut old_state,
|
exec_state: mut old_state,
|
||||||
settings: old_settings,
|
settings: old_settings,
|
||||||
@ -603,7 +604,7 @@ impl ExecutorContext {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Get the program that actually changed from the old and new information.
|
// Get the program that actually changed from the old and new information.
|
||||||
let (clear_scene, program) = match cache::get_changed_program(old, new).await {
|
let (clear_scene, program, import_check_info) = match cache::get_changed_program(old, new).await {
|
||||||
CacheResult::ReExecute {
|
CacheResult::ReExecute {
|
||||||
clear_scene,
|
clear_scene,
|
||||||
reapply_settings,
|
reapply_settings,
|
||||||
@ -616,7 +617,7 @@ impl ExecutorContext {
|
|||||||
.await
|
.await
|
||||||
.is_err()
|
.is_err()
|
||||||
{
|
{
|
||||||
(true, program)
|
(true, program, None)
|
||||||
} else {
|
} else {
|
||||||
(
|
(
|
||||||
clear_scene,
|
clear_scene,
|
||||||
@ -624,6 +625,52 @@ impl ExecutorContext {
|
|||||||
ast: changed_program,
|
ast: changed_program,
|
||||||
original_file_contents: program.original_file_contents,
|
original_file_contents: program.original_file_contents,
|
||||||
},
|
},
|
||||||
|
None,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
CacheResult::CheckImportsOnly {
|
||||||
|
reapply_settings,
|
||||||
|
ast: changed_program,
|
||||||
|
} => {
|
||||||
|
if reapply_settings
|
||||||
|
&& self
|
||||||
|
.engine
|
||||||
|
.reapply_settings(&self.settings, Default::default(), old_state.id_generator())
|
||||||
|
.await
|
||||||
|
.is_err()
|
||||||
|
{
|
||||||
|
(true, program, None)
|
||||||
|
} else {
|
||||||
|
// We need to check our imports to see if they changed.
|
||||||
|
let mut new_exec_state = ExecState::new(self);
|
||||||
|
let (new_universe, new_universe_map) = self.get_universe(&program, &mut new_exec_state).await?;
|
||||||
|
let mut clear_scene = false;
|
||||||
|
|
||||||
|
let mut keys = new_universe.keys().clone().collect::<Vec<_>>();
|
||||||
|
keys.sort();
|
||||||
|
for key in keys {
|
||||||
|
let (_, id, _, _) = &new_universe[key];
|
||||||
|
let old_source = old_state.get_source(*id);
|
||||||
|
let new_source = new_exec_state.get_source(*id);
|
||||||
|
if old_source != new_source {
|
||||||
|
clear_scene = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
(
|
||||||
|
clear_scene,
|
||||||
|
crate::Program {
|
||||||
|
ast: changed_program,
|
||||||
|
original_file_contents: program.original_file_contents,
|
||||||
|
},
|
||||||
|
// We only care about this if we are clearing the scene.
|
||||||
|
if clear_scene {
|
||||||
|
Some((new_universe, new_universe_map, new_exec_state))
|
||||||
|
} else {
|
||||||
|
None
|
||||||
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -646,7 +693,7 @@ impl ExecutorContext {
|
|||||||
let outcome = old_state.to_exec_outcome(result_env).await;
|
let outcome = old_state.to_exec_outcome(result_env).await;
|
||||||
return Ok(outcome);
|
return Ok(outcome);
|
||||||
}
|
}
|
||||||
(true, program)
|
(true, program, None)
|
||||||
}
|
}
|
||||||
CacheResult::NoAction(false) => {
|
CacheResult::NoAction(false) => {
|
||||||
let outcome = old_state.to_exec_outcome(result_env).await;
|
let outcome = old_state.to_exec_outcome(result_env).await;
|
||||||
@ -654,34 +701,42 @@ impl ExecutorContext {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
let (exec_state, preserve_mem) = if clear_scene {
|
let (exec_state, preserve_mem, universe_info) =
|
||||||
|
if let Some((new_universe, new_universe_map, mut new_exec_state)) = import_check_info {
|
||||||
|
// Clear the scene if the imports changed.
|
||||||
|
self.send_clear_scene(&mut new_exec_state, Default::default())
|
||||||
|
.await
|
||||||
|
.map_err(KclErrorWithOutputs::no_outputs)?;
|
||||||
|
|
||||||
|
(new_exec_state, false, Some((new_universe, new_universe_map)))
|
||||||
|
} else if clear_scene {
|
||||||
// Pop the execution state, since we are starting fresh.
|
// Pop the execution state, since we are starting fresh.
|
||||||
let mut exec_state = old_state;
|
let mut exec_state = old_state;
|
||||||
exec_state.reset(self);
|
exec_state.reset(self);
|
||||||
|
|
||||||
// We don't do this in mock mode since there is no engine connection
|
|
||||||
// anyways and from the TS side we override memory and don't want to clear it.
|
|
||||||
self.send_clear_scene(&mut exec_state, Default::default())
|
self.send_clear_scene(&mut exec_state, Default::default())
|
||||||
.await
|
.await
|
||||||
.map_err(KclErrorWithOutputs::no_outputs)?;
|
.map_err(KclErrorWithOutputs::no_outputs)?;
|
||||||
|
|
||||||
(exec_state, false)
|
(exec_state, false, None)
|
||||||
} else {
|
} else {
|
||||||
old_state.mut_stack().restore_env(result_env);
|
old_state.mut_stack().restore_env(result_env);
|
||||||
|
|
||||||
(old_state, true)
|
(old_state, true, None)
|
||||||
};
|
};
|
||||||
|
|
||||||
(program, exec_state, preserve_mem)
|
(program, exec_state, preserve_mem, universe_info)
|
||||||
} else {
|
} else {
|
||||||
let mut exec_state = ExecState::new(self);
|
let mut exec_state = ExecState::new(self);
|
||||||
self.send_clear_scene(&mut exec_state, Default::default())
|
self.send_clear_scene(&mut exec_state, Default::default())
|
||||||
.await
|
.await
|
||||||
.map_err(KclErrorWithOutputs::no_outputs)?;
|
.map_err(KclErrorWithOutputs::no_outputs)?;
|
||||||
(program, exec_state, false)
|
(program, exec_state, false, None)
|
||||||
};
|
};
|
||||||
|
|
||||||
let result = self.run_concurrent(&program, &mut exec_state, preserve_mem).await;
|
let result = self
|
||||||
|
.run_concurrent(&program, &mut exec_state, imports_info, preserve_mem)
|
||||||
|
.await;
|
||||||
|
|
||||||
if result.is_err() {
|
if result.is_err() {
|
||||||
cache::bust_cache().await;
|
cache::bust_cache().await;
|
||||||
@ -714,7 +769,7 @@ impl ExecutorContext {
|
|||||||
program: &crate::Program,
|
program: &crate::Program,
|
||||||
exec_state: &mut ExecState,
|
exec_state: &mut ExecState,
|
||||||
) -> Result<(EnvironmentRef, Option<ModelingSessionData>), KclErrorWithOutputs> {
|
) -> Result<(EnvironmentRef, Option<ModelingSessionData>), KclErrorWithOutputs> {
|
||||||
self.run_concurrent(program, exec_state, false).await
|
self.run_concurrent(program, exec_state, None, false).await
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Perform the execution of a program using a concurrent
|
/// Perform the execution of a program using a concurrent
|
||||||
@ -728,47 +783,24 @@ impl ExecutorContext {
|
|||||||
&self,
|
&self,
|
||||||
program: &crate::Program,
|
program: &crate::Program,
|
||||||
exec_state: &mut ExecState,
|
exec_state: &mut ExecState,
|
||||||
|
universe_info: Option<(Universe, UniverseMap)>,
|
||||||
preserve_mem: bool,
|
preserve_mem: bool,
|
||||||
) -> Result<(EnvironmentRef, Option<ModelingSessionData>), KclErrorWithOutputs> {
|
) -> Result<(EnvironmentRef, Option<ModelingSessionData>), KclErrorWithOutputs> {
|
||||||
exec_state.add_root_module_contents(program);
|
// Reuse our cached universe if we have one.
|
||||||
|
#[allow(unused_variables)]
|
||||||
|
let (universe, universe_map) = if let Some((universe, universe_map)) = universe_info {
|
||||||
|
(universe, universe_map)
|
||||||
|
} else {
|
||||||
|
self.get_universe(program, exec_state).await?
|
||||||
|
};
|
||||||
|
|
||||||
|
let default_planes = self.engine.get_default_planes().read().await.clone();
|
||||||
|
|
||||||
|
// Run the prelude to set up the engine.
|
||||||
self.eval_prelude(exec_state, SourceRange::synthetic())
|
self.eval_prelude(exec_state, SourceRange::synthetic())
|
||||||
.await
|
.await
|
||||||
.map_err(KclErrorWithOutputs::no_outputs)?;
|
.map_err(KclErrorWithOutputs::no_outputs)?;
|
||||||
|
|
||||||
let mut universe = std::collections::HashMap::new();
|
|
||||||
|
|
||||||
let default_planes = self.engine.get_default_planes().read().await.clone();
|
|
||||||
#[cfg_attr(not(feature = "artifact-graph"), expect(unused_variables))]
|
|
||||||
let root_imports = crate::walk::import_universe(
|
|
||||||
self,
|
|
||||||
&ModuleRepr::Kcl(program.ast.clone(), None),
|
|
||||||
&mut universe,
|
|
||||||
exec_state,
|
|
||||||
)
|
|
||||||
.await
|
|
||||||
.map_err(|err| {
|
|
||||||
println!("Error: {err:?}");
|
|
||||||
let module_id_to_module_path: IndexMap<ModuleId, ModulePath> = exec_state
|
|
||||||
.global
|
|
||||||
.path_to_source_id
|
|
||||||
.iter()
|
|
||||||
.map(|(k, v)| ((*v), k.clone()))
|
|
||||||
.collect();
|
|
||||||
|
|
||||||
KclErrorWithOutputs::new(
|
|
||||||
err,
|
|
||||||
#[cfg(feature = "artifact-graph")]
|
|
||||||
exec_state.global.operations.clone(),
|
|
||||||
#[cfg(feature = "artifact-graph")]
|
|
||||||
exec_state.global.artifact_commands.clone(),
|
|
||||||
#[cfg(feature = "artifact-graph")]
|
|
||||||
exec_state.global.artifact_graph.clone(),
|
|
||||||
module_id_to_module_path,
|
|
||||||
exec_state.global.id_to_source.clone(),
|
|
||||||
default_planes.clone(),
|
|
||||||
)
|
|
||||||
})?;
|
|
||||||
|
|
||||||
for modules in crate::walk::import_graph(&universe, self)
|
for modules in crate::walk::import_graph(&universe, self)
|
||||||
.map_err(|err| {
|
.map_err(|err| {
|
||||||
let module_id_to_module_path: IndexMap<ModuleId, ModulePath> = exec_state
|
let module_id_to_module_path: IndexMap<ModuleId, ModulePath> = exec_state
|
||||||
@ -821,7 +853,7 @@ impl ExecutorContext {
|
|||||||
ModulePath::Local { value, .. } => {
|
ModulePath::Local { value, .. } => {
|
||||||
// We only want to display the top-level module imports in
|
// We only want to display the top-level module imports in
|
||||||
// the Feature Tree, not transitive imports.
|
// the Feature Tree, not transitive imports.
|
||||||
if root_imports.contains_key(value) {
|
if universe_map.contains_key(value) {
|
||||||
exec_state.global.operations.push(Operation::GroupBegin {
|
exec_state.global.operations.push(Operation::GroupBegin {
|
||||||
group: Group::ModuleInstance {
|
group: Group::ModuleInstance {
|
||||||
name: value.file_name().unwrap_or_default().to_string_lossy().into_owned(),
|
name: value.file_name().unwrap_or_default().to_string_lossy().into_owned(),
|
||||||
@ -974,6 +1006,52 @@ impl ExecutorContext {
|
|||||||
self.inner_run(program, exec_state, preserve_mem).await
|
self.inner_run(program, exec_state, preserve_mem).await
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Get the universe & universe map of the program.
|
||||||
|
/// And see if any of the imports changed.
|
||||||
|
async fn get_universe(
|
||||||
|
&self,
|
||||||
|
program: &crate::Program,
|
||||||
|
exec_state: &mut ExecState,
|
||||||
|
) -> Result<(Universe, UniverseMap), KclErrorWithOutputs> {
|
||||||
|
exec_state.add_root_module_contents(program);
|
||||||
|
|
||||||
|
let mut universe = std::collections::HashMap::new();
|
||||||
|
|
||||||
|
let default_planes = self.engine.get_default_planes().read().await.clone();
|
||||||
|
|
||||||
|
let root_imports = crate::walk::import_universe(
|
||||||
|
self,
|
||||||
|
&ModuleRepr::Kcl(program.ast.clone(), None),
|
||||||
|
&mut universe,
|
||||||
|
exec_state,
|
||||||
|
)
|
||||||
|
.await
|
||||||
|
.map_err(|err| {
|
||||||
|
println!("Error: {err:?}");
|
||||||
|
let module_id_to_module_path: IndexMap<ModuleId, ModulePath> = exec_state
|
||||||
|
.global
|
||||||
|
.path_to_source_id
|
||||||
|
.iter()
|
||||||
|
.map(|(k, v)| ((*v), k.clone()))
|
||||||
|
.collect();
|
||||||
|
|
||||||
|
KclErrorWithOutputs::new(
|
||||||
|
err,
|
||||||
|
#[cfg(feature = "artifact-graph")]
|
||||||
|
exec_state.global.operations.clone(),
|
||||||
|
#[cfg(feature = "artifact-graph")]
|
||||||
|
exec_state.global.artifact_commands.clone(),
|
||||||
|
#[cfg(feature = "artifact-graph")]
|
||||||
|
exec_state.global.artifact_graph.clone(),
|
||||||
|
module_id_to_module_path,
|
||||||
|
exec_state.global.id_to_source.clone(),
|
||||||
|
default_planes,
|
||||||
|
)
|
||||||
|
})?;
|
||||||
|
|
||||||
|
Ok((universe, root_imports))
|
||||||
|
}
|
||||||
|
|
||||||
/// Perform the execution of a program. Accept all possible parameters and
|
/// Perform the execution of a program. Accept all possible parameters and
|
||||||
/// output everything.
|
/// output everything.
|
||||||
async fn inner_run(
|
async fn inner_run(
|
||||||
|
@ -238,6 +238,10 @@ impl ExecState {
|
|||||||
self.global.id_to_source.insert(id, source.clone());
|
self.global.id_to_source.insert(id, source.clone());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub(super) fn get_source(&self, id: ModuleId) -> Option<&ModuleSource> {
|
||||||
|
self.global.id_to_source.get(&id)
|
||||||
|
}
|
||||||
|
|
||||||
pub(super) fn add_module(&mut self, id: ModuleId, path: ModulePath, repr: ModuleRepr) {
|
pub(super) fn add_module(&mut self, id: ModuleId, path: ModulePath, repr: ModuleRepr) {
|
||||||
debug_assert!(self.global.path_to_source_id.contains_key(&path));
|
debug_assert!(self.global.path_to_source_id.contains_key(&path));
|
||||||
let module_info = ModuleInfo { id, repr, path };
|
let module_info = ModuleInfo { id, repr, path };
|
||||||
|
@ -6,8 +6,7 @@ use crate::{
|
|||||||
execution::{types::UnitLen, PlaneInfo, Point3d},
|
execution::{types::UnitLen, PlaneInfo, Point3d},
|
||||||
lint::rule::{def_finding, Discovered, Finding},
|
lint::rule::{def_finding, Discovered, Finding},
|
||||||
parsing::ast::types::{
|
parsing::ast::types::{
|
||||||
BinaryPart, CallExpression, CallExpressionKw, Expr, LiteralValue, Node as AstNode, ObjectExpression, Program,
|
BinaryPart, CallExpressionKw, Expr, LiteralValue, Node as AstNode, ObjectExpression, Program, UnaryOperator,
|
||||||
UnaryOperator,
|
|
||||||
},
|
},
|
||||||
walk::Node,
|
walk::Node,
|
||||||
SourceRange,
|
SourceRange,
|
||||||
@ -128,37 +127,11 @@ fn get_offset(info: &PlaneInfo) -> Option<f64> {
|
|||||||
|
|
||||||
pub fn start_sketch_on_check_specific_plane(node: Node) -> Result<Option<(SourceRange, PlaneName, f64)>> {
|
pub fn start_sketch_on_check_specific_plane(node: Node) -> Result<Option<(SourceRange, PlaneName, f64)>> {
|
||||||
match node {
|
match node {
|
||||||
Node::CallExpression(node) => start_sketch_on_check_specific_plane_pos(node),
|
|
||||||
Node::CallExpressionKw(node) => start_sketch_on_check_specific_plane_kw(node),
|
Node::CallExpressionKw(node) => start_sketch_on_check_specific_plane_kw(node),
|
||||||
_ => Ok(None),
|
_ => Ok(None),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn start_sketch_on_check_specific_plane_pos(
|
|
||||||
call: &AstNode<CallExpression>,
|
|
||||||
) -> Result<Option<(SourceRange, PlaneName, f64)>> {
|
|
||||||
if call.inner.callee.inner.name.name != "startSketchOn" {
|
|
||||||
return Ok(None);
|
|
||||||
}
|
|
||||||
|
|
||||||
if call.arguments.len() != 1 {
|
|
||||||
// we only look for single-argument object patterns, if there's more
|
|
||||||
// than that we don't have a plane decl
|
|
||||||
return Ok(None);
|
|
||||||
}
|
|
||||||
|
|
||||||
let call_source_range = SourceRange::new(
|
|
||||||
call.arguments[0].start(),
|
|
||||||
call.arguments[0].end(),
|
|
||||||
call.arguments[0].module_id(),
|
|
||||||
);
|
|
||||||
|
|
||||||
let Expr::ObjectExpression(arg) = &call.arguments[0] else {
|
|
||||||
return Ok(None);
|
|
||||||
};
|
|
||||||
common(arg, call_source_range)
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn start_sketch_on_check_specific_plane_kw(
|
pub fn start_sketch_on_check_specific_plane_kw(
|
||||||
call: &AstNode<CallExpressionKw>,
|
call: &AstNode<CallExpressionKw>,
|
||||||
) -> Result<Option<(SourceRange, PlaneName, f64)>> {
|
) -> Result<Option<(SourceRange, PlaneName, f64)>> {
|
||||||
|
@ -89,7 +89,6 @@ impl Expr {
|
|||||||
Expr::FunctionExpression(function_expression) => {
|
Expr::FunctionExpression(function_expression) => {
|
||||||
function_expression.get_hover_value_for_position(pos, code, opts)
|
function_expression.get_hover_value_for_position(pos, code, opts)
|
||||||
}
|
}
|
||||||
Expr::CallExpression(call_expression) => call_expression.get_hover_value_for_position(pos, code, opts),
|
|
||||||
Expr::CallExpressionKw(call_expression) => call_expression.get_hover_value_for_position(pos, code, opts),
|
Expr::CallExpressionKw(call_expression) => call_expression.get_hover_value_for_position(pos, code, opts),
|
||||||
Expr::PipeExpression(pipe_expression) => pipe_expression.get_hover_value_for_position(pos, code, opts),
|
Expr::PipeExpression(pipe_expression) => pipe_expression.get_hover_value_for_position(pos, code, opts),
|
||||||
Expr::ArrayExpression(array_expression) => array_expression.get_hover_value_for_position(pos, code, opts),
|
Expr::ArrayExpression(array_expression) => array_expression.get_hover_value_for_position(pos, code, opts),
|
||||||
@ -144,9 +143,6 @@ impl BinaryPart {
|
|||||||
BinaryPart::BinaryExpression(binary_expression) => {
|
BinaryPart::BinaryExpression(binary_expression) => {
|
||||||
binary_expression.get_hover_value_for_position(pos, code, opts)
|
binary_expression.get_hover_value_for_position(pos, code, opts)
|
||||||
}
|
}
|
||||||
BinaryPart::CallExpression(call_expression) => {
|
|
||||||
call_expression.get_hover_value_for_position(pos, code, opts)
|
|
||||||
}
|
|
||||||
BinaryPart::CallExpressionKw(call_expression) => {
|
BinaryPart::CallExpressionKw(call_expression) => {
|
||||||
call_expression.get_hover_value_for_position(pos, code, opts)
|
call_expression.get_hover_value_for_position(pos, code, opts)
|
||||||
}
|
}
|
||||||
@ -161,35 +157,6 @@ impl BinaryPart {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl CallExpression {
|
|
||||||
fn get_hover_value_for_position(&self, pos: usize, code: &str, opts: &HoverOpts) -> Option<Hover> {
|
|
||||||
let callee_source_range: SourceRange = self.callee.clone().into();
|
|
||||||
if callee_source_range.contains(pos) {
|
|
||||||
return Some(Hover::Function {
|
|
||||||
name: self.callee.to_string(),
|
|
||||||
range: callee_source_range.to_lsp_range(code),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
for (index, arg) in self.arguments.iter().enumerate() {
|
|
||||||
let source_range: SourceRange = arg.into();
|
|
||||||
if source_range.contains(pos) {
|
|
||||||
return if opts.prefer_sig {
|
|
||||||
Some(Hover::Signature {
|
|
||||||
name: self.callee.to_string(),
|
|
||||||
parameter_index: index as u32,
|
|
||||||
range: source_range.to_lsp_range(code),
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
arg.get_hover_value_for_position(pos, code, opts)
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
None
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl CallExpressionKw {
|
impl CallExpressionKw {
|
||||||
fn get_hover_value_for_position(&self, pos: usize, code: &str, opts: &HoverOpts) -> Option<Hover> {
|
fn get_hover_value_for_position(&self, pos: usize, code: &str, opts: &HoverOpts) -> Option<Hover> {
|
||||||
let callee_source_range: SourceRange = self.callee.clone().into();
|
let callee_source_range: SourceRange = self.callee.clone().into();
|
||||||
|
@ -516,23 +516,6 @@ impl Backend {
|
|||||||
}
|
}
|
||||||
return get_modifier(vec![SemanticTokenModifier::DECLARATION]);
|
return get_modifier(vec![SemanticTokenModifier::DECLARATION]);
|
||||||
}
|
}
|
||||||
crate::walk::Node::CallExpression(call_expr) => {
|
|
||||||
let sr: SourceRange = (&call_expr.callee).into();
|
|
||||||
if sr.contains(source_range.start()) {
|
|
||||||
let mut ti = token_index.lock().map_err(|_| anyhow::anyhow!("mutex"))?;
|
|
||||||
*ti = match self.get_semantic_token_type_index(&SemanticTokenType::FUNCTION) {
|
|
||||||
Some(index) => index,
|
|
||||||
None => token_type_index,
|
|
||||||
};
|
|
||||||
|
|
||||||
if self.stdlib_completions.contains_key(&call_expr.callee.name.name) {
|
|
||||||
// This is a stdlib function.
|
|
||||||
return get_modifier(vec![SemanticTokenModifier::DEFAULT_LIBRARY]);
|
|
||||||
}
|
|
||||||
|
|
||||||
return Ok(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
crate::walk::Node::CallExpressionKw(call_expr) => {
|
crate::walk::Node::CallExpressionKw(call_expr) => {
|
||||||
let sr: SourceRange = (&call_expr.callee).into();
|
let sr: SourceRange = (&call_expr.callee).into();
|
||||||
if sr.contains(source_range.start()) {
|
if sr.contains(source_range.start()) {
|
||||||
|
@ -2,11 +2,11 @@ use sha2::{Digest as DigestTrait, Sha256};
|
|||||||
|
|
||||||
use crate::parsing::ast::types::{
|
use crate::parsing::ast::types::{
|
||||||
Annotation, ArrayExpression, ArrayRangeExpression, AscribedExpression, BinaryExpression, BinaryPart, BodyItem,
|
Annotation, ArrayExpression, ArrayRangeExpression, AscribedExpression, BinaryExpression, BinaryPart, BodyItem,
|
||||||
CallExpression, CallExpressionKw, DefaultParamVal, ElseIf, Expr, ExpressionStatement, FunctionExpression,
|
CallExpressionKw, DefaultParamVal, ElseIf, Expr, ExpressionStatement, FunctionExpression, Identifier, IfExpression,
|
||||||
Identifier, IfExpression, ImportItem, ImportSelector, ImportStatement, ItemVisibility, KclNone, LabelledExpression,
|
ImportItem, ImportSelector, ImportStatement, ItemVisibility, KclNone, LabelledExpression, Literal,
|
||||||
Literal, LiteralIdentifier, LiteralValue, MemberExpression, MemberObject, Name, ObjectExpression, ObjectProperty,
|
LiteralIdentifier, LiteralValue, MemberExpression, MemberObject, Name, ObjectExpression, ObjectProperty, Parameter,
|
||||||
Parameter, PipeExpression, PipeSubstitution, PrimitiveType, Program, ReturnStatement, TagDeclarator, Type,
|
PipeExpression, PipeSubstitution, PrimitiveType, Program, ReturnStatement, TagDeclarator, Type, TypeDeclaration,
|
||||||
TypeDeclaration, UnaryExpression, VariableDeclaration, VariableDeclarator, VariableKind,
|
UnaryExpression, VariableDeclaration, VariableDeclarator, VariableKind,
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Position-independent digest of the AST node.
|
/// Position-independent digest of the AST node.
|
||||||
@ -132,7 +132,6 @@ impl Expr {
|
|||||||
Expr::TagDeclarator(tag) => tag.compute_digest(),
|
Expr::TagDeclarator(tag) => tag.compute_digest(),
|
||||||
Expr::BinaryExpression(be) => be.compute_digest(),
|
Expr::BinaryExpression(be) => be.compute_digest(),
|
||||||
Expr::FunctionExpression(fe) => fe.compute_digest(),
|
Expr::FunctionExpression(fe) => fe.compute_digest(),
|
||||||
Expr::CallExpression(ce) => ce.compute_digest(),
|
|
||||||
Expr::CallExpressionKw(ce) => ce.compute_digest(),
|
Expr::CallExpressionKw(ce) => ce.compute_digest(),
|
||||||
Expr::PipeExpression(pe) => pe.compute_digest(),
|
Expr::PipeExpression(pe) => pe.compute_digest(),
|
||||||
Expr::PipeSubstitution(ps) => ps.compute_digest(),
|
Expr::PipeSubstitution(ps) => ps.compute_digest(),
|
||||||
@ -159,7 +158,6 @@ impl BinaryPart {
|
|||||||
BinaryPart::Literal(lit) => lit.compute_digest(),
|
BinaryPart::Literal(lit) => lit.compute_digest(),
|
||||||
BinaryPart::Name(id) => id.compute_digest(),
|
BinaryPart::Name(id) => id.compute_digest(),
|
||||||
BinaryPart::BinaryExpression(be) => be.compute_digest(),
|
BinaryPart::BinaryExpression(be) => be.compute_digest(),
|
||||||
BinaryPart::CallExpression(ce) => ce.compute_digest(),
|
|
||||||
BinaryPart::CallExpressionKw(ce) => ce.compute_digest(),
|
BinaryPart::CallExpressionKw(ce) => ce.compute_digest(),
|
||||||
BinaryPart::UnaryExpression(ue) => ue.compute_digest(),
|
BinaryPart::UnaryExpression(ue) => ue.compute_digest(),
|
||||||
BinaryPart::MemberExpression(me) => me.compute_digest(),
|
BinaryPart::MemberExpression(me) => me.compute_digest(),
|
||||||
@ -480,16 +478,6 @@ impl PipeExpression {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
impl CallExpression {
|
|
||||||
compute_digest!(|slf, hasher| {
|
|
||||||
hasher.update(slf.callee.compute_digest());
|
|
||||||
hasher.update(slf.arguments.len().to_ne_bytes());
|
|
||||||
for argument in slf.arguments.iter_mut() {
|
|
||||||
hasher.update(argument.compute_digest());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
impl CallExpressionKw {
|
impl CallExpressionKw {
|
||||||
compute_digest!(|slf, hasher| {
|
compute_digest!(|slf, hasher| {
|
||||||
hasher.update(slf.callee.compute_digest());
|
hasher.update(slf.callee.compute_digest());
|
||||||
|
@ -26,7 +26,6 @@ impl Expr {
|
|||||||
Expr::TagDeclarator(tag) => tag.module_id,
|
Expr::TagDeclarator(tag) => tag.module_id,
|
||||||
Expr::BinaryExpression(binary_expression) => binary_expression.module_id,
|
Expr::BinaryExpression(binary_expression) => binary_expression.module_id,
|
||||||
Expr::FunctionExpression(function_expression) => function_expression.module_id,
|
Expr::FunctionExpression(function_expression) => function_expression.module_id,
|
||||||
Expr::CallExpression(call_expression) => call_expression.module_id,
|
|
||||||
Expr::CallExpressionKw(call_expression) => call_expression.module_id,
|
Expr::CallExpressionKw(call_expression) => call_expression.module_id,
|
||||||
Expr::PipeExpression(pipe_expression) => pipe_expression.module_id,
|
Expr::PipeExpression(pipe_expression) => pipe_expression.module_id,
|
||||||
Expr::PipeSubstitution(pipe_substitution) => pipe_substitution.module_id,
|
Expr::PipeSubstitution(pipe_substitution) => pipe_substitution.module_id,
|
||||||
@ -49,7 +48,6 @@ impl BinaryPart {
|
|||||||
BinaryPart::Literal(literal) => literal.module_id,
|
BinaryPart::Literal(literal) => literal.module_id,
|
||||||
BinaryPart::Name(identifier) => identifier.module_id,
|
BinaryPart::Name(identifier) => identifier.module_id,
|
||||||
BinaryPart::BinaryExpression(binary_expression) => binary_expression.module_id,
|
BinaryPart::BinaryExpression(binary_expression) => binary_expression.module_id,
|
||||||
BinaryPart::CallExpression(call_expression) => call_expression.module_id,
|
|
||||||
BinaryPart::CallExpressionKw(call_expression) => call_expression.module_id,
|
BinaryPart::CallExpressionKw(call_expression) => call_expression.module_id,
|
||||||
BinaryPart::UnaryExpression(unary_expression) => unary_expression.module_id,
|
BinaryPart::UnaryExpression(unary_expression) => unary_expression.module_id,
|
||||||
BinaryPart::MemberExpression(member_expression) => member_expression.module_id,
|
BinaryPart::MemberExpression(member_expression) => member_expression.module_id,
|
||||||
|
@ -542,6 +542,16 @@ impl Program {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Checks if the ast has any import statements.
|
||||||
|
pub fn has_import_statements(&self) -> bool {
|
||||||
|
for item in &self.body {
|
||||||
|
if let BodyItem::ImportStatement(_) = item {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
false
|
||||||
|
}
|
||||||
|
|
||||||
pub fn in_comment(&self, pos: usize) -> bool {
|
pub fn in_comment(&self, pos: usize) -> bool {
|
||||||
// Check if its in the body.
|
// Check if its in the body.
|
||||||
if self.non_code_meta.in_comment(pos) {
|
if self.non_code_meta.in_comment(pos) {
|
||||||
@ -922,7 +932,6 @@ pub enum Expr {
|
|||||||
TagDeclarator(BoxNode<TagDeclarator>),
|
TagDeclarator(BoxNode<TagDeclarator>),
|
||||||
BinaryExpression(BoxNode<BinaryExpression>),
|
BinaryExpression(BoxNode<BinaryExpression>),
|
||||||
FunctionExpression(BoxNode<FunctionExpression>),
|
FunctionExpression(BoxNode<FunctionExpression>),
|
||||||
CallExpression(BoxNode<CallExpression>),
|
|
||||||
CallExpressionKw(BoxNode<CallExpressionKw>),
|
CallExpressionKw(BoxNode<CallExpressionKw>),
|
||||||
PipeExpression(BoxNode<PipeExpression>),
|
PipeExpression(BoxNode<PipeExpression>),
|
||||||
PipeSubstitution(BoxNode<PipeSubstitution>),
|
PipeSubstitution(BoxNode<PipeSubstitution>),
|
||||||
@ -968,7 +977,6 @@ impl Expr {
|
|||||||
Expr::MemberExpression(_mem_exp) => None,
|
Expr::MemberExpression(_mem_exp) => None,
|
||||||
Expr::Literal(_literal) => None,
|
Expr::Literal(_literal) => None,
|
||||||
Expr::FunctionExpression(_func_exp) => None,
|
Expr::FunctionExpression(_func_exp) => None,
|
||||||
Expr::CallExpression(_call_exp) => None,
|
|
||||||
Expr::CallExpressionKw(_call_exp) => None,
|
Expr::CallExpressionKw(_call_exp) => None,
|
||||||
Expr::Name(_ident) => None,
|
Expr::Name(_ident) => None,
|
||||||
Expr::TagDeclarator(_tag) => None,
|
Expr::TagDeclarator(_tag) => None,
|
||||||
@ -996,7 +1004,6 @@ impl Expr {
|
|||||||
Expr::MemberExpression(_) => {}
|
Expr::MemberExpression(_) => {}
|
||||||
Expr::Literal(_) => {}
|
Expr::Literal(_) => {}
|
||||||
Expr::FunctionExpression(ref mut func_exp) => func_exp.replace_value(source_range, new_value),
|
Expr::FunctionExpression(ref mut func_exp) => func_exp.replace_value(source_range, new_value),
|
||||||
Expr::CallExpression(ref mut call_exp) => call_exp.replace_value(source_range, new_value),
|
|
||||||
Expr::CallExpressionKw(ref mut call_exp) => call_exp.replace_value(source_range, new_value),
|
Expr::CallExpressionKw(ref mut call_exp) => call_exp.replace_value(source_range, new_value),
|
||||||
Expr::Name(_) => {}
|
Expr::Name(_) => {}
|
||||||
Expr::TagDeclarator(_) => {}
|
Expr::TagDeclarator(_) => {}
|
||||||
@ -1017,7 +1024,6 @@ impl Expr {
|
|||||||
Expr::TagDeclarator(tag) => tag.start,
|
Expr::TagDeclarator(tag) => tag.start,
|
||||||
Expr::BinaryExpression(binary_expression) => binary_expression.start,
|
Expr::BinaryExpression(binary_expression) => binary_expression.start,
|
||||||
Expr::FunctionExpression(function_expression) => function_expression.start,
|
Expr::FunctionExpression(function_expression) => function_expression.start,
|
||||||
Expr::CallExpression(call_expression) => call_expression.start,
|
|
||||||
Expr::CallExpressionKw(call_expression) => call_expression.start,
|
Expr::CallExpressionKw(call_expression) => call_expression.start,
|
||||||
Expr::PipeExpression(pipe_expression) => pipe_expression.start,
|
Expr::PipeExpression(pipe_expression) => pipe_expression.start,
|
||||||
Expr::PipeSubstitution(pipe_substitution) => pipe_substitution.start,
|
Expr::PipeSubstitution(pipe_substitution) => pipe_substitution.start,
|
||||||
@ -1040,7 +1046,6 @@ impl Expr {
|
|||||||
Expr::TagDeclarator(tag) => tag.end,
|
Expr::TagDeclarator(tag) => tag.end,
|
||||||
Expr::BinaryExpression(binary_expression) => binary_expression.end,
|
Expr::BinaryExpression(binary_expression) => binary_expression.end,
|
||||||
Expr::FunctionExpression(function_expression) => function_expression.end,
|
Expr::FunctionExpression(function_expression) => function_expression.end,
|
||||||
Expr::CallExpression(call_expression) => call_expression.end,
|
|
||||||
Expr::CallExpressionKw(call_expression) => call_expression.end,
|
Expr::CallExpressionKw(call_expression) => call_expression.end,
|
||||||
Expr::PipeExpression(pipe_expression) => pipe_expression.end,
|
Expr::PipeExpression(pipe_expression) => pipe_expression.end,
|
||||||
Expr::PipeSubstitution(pipe_substitution) => pipe_substitution.end,
|
Expr::PipeSubstitution(pipe_substitution) => pipe_substitution.end,
|
||||||
@ -1071,7 +1076,6 @@ impl Expr {
|
|||||||
binary_expression.rename_identifiers(old_name, new_name)
|
binary_expression.rename_identifiers(old_name, new_name)
|
||||||
}
|
}
|
||||||
Expr::FunctionExpression(_function_identifier) => {}
|
Expr::FunctionExpression(_function_identifier) => {}
|
||||||
Expr::CallExpression(ref mut call_expression) => call_expression.rename_identifiers(old_name, new_name),
|
|
||||||
Expr::CallExpressionKw(ref mut call_expression) => call_expression.rename_identifiers(old_name, new_name),
|
Expr::CallExpressionKw(ref mut call_expression) => call_expression.rename_identifiers(old_name, new_name),
|
||||||
Expr::PipeExpression(ref mut pipe_expression) => pipe_expression.rename_identifiers(old_name, new_name),
|
Expr::PipeExpression(ref mut pipe_expression) => pipe_expression.rename_identifiers(old_name, new_name),
|
||||||
Expr::PipeSubstitution(_) => {}
|
Expr::PipeSubstitution(_) => {}
|
||||||
@ -1100,7 +1104,6 @@ impl Expr {
|
|||||||
Expr::BinaryExpression(binary_expression) => binary_expression.get_constraint_level(),
|
Expr::BinaryExpression(binary_expression) => binary_expression.get_constraint_level(),
|
||||||
|
|
||||||
Expr::FunctionExpression(function_identifier) => function_identifier.get_constraint_level(),
|
Expr::FunctionExpression(function_identifier) => function_identifier.get_constraint_level(),
|
||||||
Expr::CallExpression(call_expression) => call_expression.get_constraint_level(),
|
|
||||||
Expr::CallExpressionKw(call_expression) => call_expression.get_constraint_level(),
|
Expr::CallExpressionKw(call_expression) => call_expression.get_constraint_level(),
|
||||||
Expr::PipeExpression(pipe_expression) => pipe_expression.get_constraint_level(),
|
Expr::PipeExpression(pipe_expression) => pipe_expression.get_constraint_level(),
|
||||||
Expr::PipeSubstitution(pipe_substitution) => ConstraintLevel::Ignore {
|
Expr::PipeSubstitution(pipe_substitution) => ConstraintLevel::Ignore {
|
||||||
@ -1118,16 +1121,6 @@ impl Expr {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn has_substitution_arg(&self) -> bool {
|
|
||||||
match self {
|
|
||||||
Expr::CallExpression(call_expression) => call_expression.has_substitution_arg(),
|
|
||||||
Expr::CallExpressionKw(call_expression) => call_expression.has_substitution_arg(),
|
|
||||||
Expr::LabelledExpression(expr) => expr.expr.has_substitution_arg(),
|
|
||||||
Expr::AscribedExpression(expr) => expr.expr.has_substitution_arg(),
|
|
||||||
_ => false,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn literal_bool(&self) -> Option<bool> {
|
pub fn literal_bool(&self) -> Option<bool> {
|
||||||
match self {
|
match self {
|
||||||
Expr::Literal(lit) => match lit.value {
|
Expr::Literal(lit) => match lit.value {
|
||||||
@ -1184,7 +1177,6 @@ impl From<&BinaryPart> for Expr {
|
|||||||
BinaryPart::Literal(literal) => Expr::Literal(literal.clone()),
|
BinaryPart::Literal(literal) => Expr::Literal(literal.clone()),
|
||||||
BinaryPart::Name(name) => Expr::Name(name.clone()),
|
BinaryPart::Name(name) => Expr::Name(name.clone()),
|
||||||
BinaryPart::BinaryExpression(binary_expression) => Expr::BinaryExpression(binary_expression.clone()),
|
BinaryPart::BinaryExpression(binary_expression) => Expr::BinaryExpression(binary_expression.clone()),
|
||||||
BinaryPart::CallExpression(call_expression) => Expr::CallExpression(call_expression.clone()),
|
|
||||||
BinaryPart::CallExpressionKw(call_expression) => Expr::CallExpressionKw(call_expression.clone()),
|
BinaryPart::CallExpressionKw(call_expression) => Expr::CallExpressionKw(call_expression.clone()),
|
||||||
BinaryPart::UnaryExpression(unary_expression) => Expr::UnaryExpression(unary_expression.clone()),
|
BinaryPart::UnaryExpression(unary_expression) => Expr::UnaryExpression(unary_expression.clone()),
|
||||||
BinaryPart::MemberExpression(member_expression) => Expr::MemberExpression(member_expression.clone()),
|
BinaryPart::MemberExpression(member_expression) => Expr::MemberExpression(member_expression.clone()),
|
||||||
@ -1251,7 +1243,6 @@ pub enum BinaryPart {
|
|||||||
Literal(BoxNode<Literal>),
|
Literal(BoxNode<Literal>),
|
||||||
Name(BoxNode<Name>),
|
Name(BoxNode<Name>),
|
||||||
BinaryExpression(BoxNode<BinaryExpression>),
|
BinaryExpression(BoxNode<BinaryExpression>),
|
||||||
CallExpression(BoxNode<CallExpression>),
|
|
||||||
CallExpressionKw(BoxNode<CallExpressionKw>),
|
CallExpressionKw(BoxNode<CallExpressionKw>),
|
||||||
UnaryExpression(BoxNode<UnaryExpression>),
|
UnaryExpression(BoxNode<UnaryExpression>),
|
||||||
MemberExpression(BoxNode<MemberExpression>),
|
MemberExpression(BoxNode<MemberExpression>),
|
||||||
@ -1277,7 +1268,6 @@ impl BinaryPart {
|
|||||||
BinaryPart::Literal(literal) => literal.get_constraint_level(),
|
BinaryPart::Literal(literal) => literal.get_constraint_level(),
|
||||||
BinaryPart::Name(identifier) => identifier.get_constraint_level(),
|
BinaryPart::Name(identifier) => identifier.get_constraint_level(),
|
||||||
BinaryPart::BinaryExpression(binary_expression) => binary_expression.get_constraint_level(),
|
BinaryPart::BinaryExpression(binary_expression) => binary_expression.get_constraint_level(),
|
||||||
BinaryPart::CallExpression(call_expression) => call_expression.get_constraint_level(),
|
|
||||||
BinaryPart::CallExpressionKw(call_expression) => call_expression.get_constraint_level(),
|
BinaryPart::CallExpressionKw(call_expression) => call_expression.get_constraint_level(),
|
||||||
BinaryPart::UnaryExpression(unary_expression) => unary_expression.get_constraint_level(),
|
BinaryPart::UnaryExpression(unary_expression) => unary_expression.get_constraint_level(),
|
||||||
BinaryPart::MemberExpression(member_expression) => member_expression.get_constraint_level(),
|
BinaryPart::MemberExpression(member_expression) => member_expression.get_constraint_level(),
|
||||||
@ -1292,9 +1282,6 @@ impl BinaryPart {
|
|||||||
BinaryPart::BinaryExpression(ref mut binary_expression) => {
|
BinaryPart::BinaryExpression(ref mut binary_expression) => {
|
||||||
binary_expression.replace_value(source_range, new_value)
|
binary_expression.replace_value(source_range, new_value)
|
||||||
}
|
}
|
||||||
BinaryPart::CallExpression(ref mut call_expression) => {
|
|
||||||
call_expression.replace_value(source_range, new_value)
|
|
||||||
}
|
|
||||||
BinaryPart::CallExpressionKw(ref mut call_expression) => {
|
BinaryPart::CallExpressionKw(ref mut call_expression) => {
|
||||||
call_expression.replace_value(source_range, new_value)
|
call_expression.replace_value(source_range, new_value)
|
||||||
}
|
}
|
||||||
@ -1311,7 +1298,6 @@ impl BinaryPart {
|
|||||||
BinaryPart::Literal(literal) => literal.start,
|
BinaryPart::Literal(literal) => literal.start,
|
||||||
BinaryPart::Name(identifier) => identifier.start,
|
BinaryPart::Name(identifier) => identifier.start,
|
||||||
BinaryPart::BinaryExpression(binary_expression) => binary_expression.start,
|
BinaryPart::BinaryExpression(binary_expression) => binary_expression.start,
|
||||||
BinaryPart::CallExpression(call_expression) => call_expression.start,
|
|
||||||
BinaryPart::CallExpressionKw(call_expression) => call_expression.start,
|
BinaryPart::CallExpressionKw(call_expression) => call_expression.start,
|
||||||
BinaryPart::UnaryExpression(unary_expression) => unary_expression.start,
|
BinaryPart::UnaryExpression(unary_expression) => unary_expression.start,
|
||||||
BinaryPart::MemberExpression(member_expression) => member_expression.start,
|
BinaryPart::MemberExpression(member_expression) => member_expression.start,
|
||||||
@ -1324,7 +1310,6 @@ impl BinaryPart {
|
|||||||
BinaryPart::Literal(literal) => literal.end,
|
BinaryPart::Literal(literal) => literal.end,
|
||||||
BinaryPart::Name(identifier) => identifier.end,
|
BinaryPart::Name(identifier) => identifier.end,
|
||||||
BinaryPart::BinaryExpression(binary_expression) => binary_expression.end,
|
BinaryPart::BinaryExpression(binary_expression) => binary_expression.end,
|
||||||
BinaryPart::CallExpression(call_expression) => call_expression.end,
|
|
||||||
BinaryPart::CallExpressionKw(call_expression) => call_expression.end,
|
BinaryPart::CallExpressionKw(call_expression) => call_expression.end,
|
||||||
BinaryPart::UnaryExpression(unary_expression) => unary_expression.end,
|
BinaryPart::UnaryExpression(unary_expression) => unary_expression.end,
|
||||||
BinaryPart::MemberExpression(member_expression) => member_expression.end,
|
BinaryPart::MemberExpression(member_expression) => member_expression.end,
|
||||||
@ -1340,9 +1325,6 @@ impl BinaryPart {
|
|||||||
BinaryPart::BinaryExpression(ref mut binary_expression) => {
|
BinaryPart::BinaryExpression(ref mut binary_expression) => {
|
||||||
binary_expression.rename_identifiers(old_name, new_name)
|
binary_expression.rename_identifiers(old_name, new_name)
|
||||||
}
|
}
|
||||||
BinaryPart::CallExpression(ref mut call_expression) => {
|
|
||||||
call_expression.rename_identifiers(old_name, new_name)
|
|
||||||
}
|
|
||||||
BinaryPart::CallExpressionKw(ref mut call_expression) => {
|
BinaryPart::CallExpressionKw(ref mut call_expression) => {
|
||||||
call_expression.rename_identifiers(old_name, new_name)
|
call_expression.rename_identifiers(old_name, new_name)
|
||||||
}
|
}
|
||||||
@ -1834,18 +1816,6 @@ pub struct ExpressionStatement {
|
|||||||
pub digest: Option<Digest>,
|
pub digest: Option<Digest>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)]
|
|
||||||
#[ts(export)]
|
|
||||||
#[serde(tag = "type")]
|
|
||||||
pub struct CallExpression {
|
|
||||||
pub callee: Node<Name>,
|
|
||||||
pub arguments: Vec<Expr>,
|
|
||||||
|
|
||||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
|
||||||
#[ts(optional)]
|
|
||||||
pub digest: Option<Digest>,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)]
|
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, ts_rs::TS, JsonSchema)]
|
||||||
#[ts(export)]
|
#[ts(export)]
|
||||||
#[serde(rename_all = "camelCase", tag = "type")]
|
#[serde(rename_all = "camelCase", tag = "type")]
|
||||||
@ -1871,37 +1841,12 @@ pub struct LabeledArg {
|
|||||||
pub arg: Expr,
|
pub arg: Expr,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<Node<CallExpression>> for Expr {
|
|
||||||
fn from(call_expression: Node<CallExpression>) -> Self {
|
|
||||||
Expr::CallExpression(Box::new(call_expression))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl From<Node<CallExpressionKw>> for Expr {
|
impl From<Node<CallExpressionKw>> for Expr {
|
||||||
fn from(call_expression: Node<CallExpressionKw>) -> Self {
|
fn from(call_expression: Node<CallExpressionKw>) -> Self {
|
||||||
Expr::CallExpressionKw(Box::new(call_expression))
|
Expr::CallExpressionKw(Box::new(call_expression))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Node<CallExpression> {
|
|
||||||
/// Return the constraint level for this call expression.
|
|
||||||
pub fn get_constraint_level(&self) -> ConstraintLevel {
|
|
||||||
if self.arguments.is_empty() {
|
|
||||||
return ConstraintLevel::Ignore {
|
|
||||||
source_ranges: vec![self.into()],
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// Iterate over the arguments and get the constraint level for each one.
|
|
||||||
let mut constraint_levels = ConstraintLevels::new();
|
|
||||||
for arg in &self.arguments {
|
|
||||||
constraint_levels.push(arg.get_constraint_level());
|
|
||||||
}
|
|
||||||
|
|
||||||
constraint_levels.get_constraint_level(self.into())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Node<CallExpressionKw> {
|
impl Node<CallExpressionKw> {
|
||||||
/// Return the constraint level for this call expression.
|
/// Return the constraint level for this call expression.
|
||||||
pub fn get_constraint_level(&self) -> ConstraintLevel {
|
pub fn get_constraint_level(&self) -> ConstraintLevel {
|
||||||
@ -1921,38 +1866,6 @@ impl Node<CallExpressionKw> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl CallExpression {
|
|
||||||
pub fn new(name: &str, arguments: Vec<Expr>) -> Result<Node<Self>, KclError> {
|
|
||||||
Ok(Node::no_src(Self {
|
|
||||||
callee: Name::new(name),
|
|
||||||
arguments,
|
|
||||||
digest: None,
|
|
||||||
}))
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Is at least one argument the '%' i.e. the substitution operator?
|
|
||||||
pub fn has_substitution_arg(&self) -> bool {
|
|
||||||
self.arguments
|
|
||||||
.iter()
|
|
||||||
.any(|arg| matches!(arg, Expr::PipeSubstitution(_)))
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn replace_value(&mut self, source_range: SourceRange, new_value: Expr) {
|
|
||||||
for arg in &mut self.arguments {
|
|
||||||
arg.replace_value(source_range, new_value.clone());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Rename all identifiers that have the old name to the new given name.
|
|
||||||
fn rename_identifiers(&mut self, old_name: &str, new_name: &str) {
|
|
||||||
self.callee.rename(old_name, new_name);
|
|
||||||
|
|
||||||
for arg in &mut self.arguments {
|
|
||||||
arg.rename_identifiers(old_name, new_name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl CallExpressionKw {
|
impl CallExpressionKw {
|
||||||
pub fn new(name: &str, unlabeled: Option<Expr>, arguments: Vec<LabeledArg>) -> Result<Node<Self>, KclError> {
|
pub fn new(name: &str, unlabeled: Option<Expr>, arguments: Vec<LabeledArg>) -> Result<Node<Self>, KclError> {
|
||||||
Ok(Node::no_src(Self {
|
Ok(Node::no_src(Self {
|
||||||
@ -1972,13 +1885,6 @@ impl CallExpressionKw {
|
|||||||
.chain(self.arguments.iter().map(|arg| (Some(&arg.label), &arg.arg)))
|
.chain(self.arguments.iter().map(|arg| (Some(&arg.label), &arg.arg)))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Is at least one argument the '%' i.e. the substitution operator?
|
|
||||||
pub fn has_substitution_arg(&self) -> bool {
|
|
||||||
self.arguments
|
|
||||||
.iter()
|
|
||||||
.any(|arg| matches!(arg.arg, Expr::PipeSubstitution(_)))
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn replace_value(&mut self, source_range: SourceRange, new_value: Expr) {
|
pub fn replace_value(&mut self, source_range: SourceRange, new_value: Expr) {
|
||||||
for arg in &mut self.arguments {
|
for arg in &mut self.arguments {
|
||||||
arg.arg.replace_value(source_range, new_value.clone());
|
arg.arg.replace_value(source_range, new_value.clone());
|
||||||
@ -4178,13 +4084,8 @@ cylinder = startSketchOn(-XZ)
|
|||||||
};
|
};
|
||||||
oe
|
oe
|
||||||
}
|
}
|
||||||
Expr::CallExpression(ce) => {
|
|
||||||
let Expr::ObjectExpression(ref oe) = (ce.arguments).first().unwrap() else {
|
other => panic!("expected a CallKw, found {other:?}"),
|
||||||
panic!("expected an object!");
|
|
||||||
};
|
|
||||||
oe
|
|
||||||
}
|
|
||||||
other => panic!("expected a Call or CallKw, found {other:?}"),
|
|
||||||
};
|
};
|
||||||
|
|
||||||
assert_eq!(oe.properties.len(), 2);
|
assert_eq!(oe.properties.len(), 2);
|
||||||
|
@ -177,18 +177,6 @@ impl NodePath {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Expr::CallExpression(node) => {
|
|
||||||
if node.callee.contains_range(&range) {
|
|
||||||
path.push(Step::CallCallee);
|
|
||||||
return Some(path);
|
|
||||||
}
|
|
||||||
for (i, arg) in node.arguments.iter().enumerate() {
|
|
||||||
if arg.contains_range(&range) {
|
|
||||||
path.push(Step::CallArg { index: i });
|
|
||||||
return Self::from_expr(arg, range, path);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Expr::CallExpressionKw(node) => {
|
Expr::CallExpressionKw(node) => {
|
||||||
if node.callee.contains_range(&range) {
|
if node.callee.contains_range(&range) {
|
||||||
path.push(Step::CallKwCallee);
|
path.push(Step::CallKwCallee);
|
||||||
|
@ -14,7 +14,7 @@ use winnow::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
ast::types::{AscribedExpression, CallExpression, ImportPath, LabelledExpression},
|
ast::types::{AscribedExpression, ImportPath, LabelledExpression},
|
||||||
token::{NumericSuffix, RESERVED_WORDS},
|
token::{NumericSuffix, RESERVED_WORDS},
|
||||||
DeprecationKind,
|
DeprecationKind,
|
||||||
};
|
};
|
||||||
@ -630,7 +630,6 @@ fn operand(i: &mut TokenSlice) -> PResult<BinaryPart> {
|
|||||||
Expr::Literal(x) => BinaryPart::Literal(x),
|
Expr::Literal(x) => BinaryPart::Literal(x),
|
||||||
Expr::Name(x) => BinaryPart::Name(x),
|
Expr::Name(x) => BinaryPart::Name(x),
|
||||||
Expr::BinaryExpression(x) => BinaryPart::BinaryExpression(x),
|
Expr::BinaryExpression(x) => BinaryPart::BinaryExpression(x),
|
||||||
Expr::CallExpression(x) => BinaryPart::CallExpression(x),
|
|
||||||
Expr::CallExpressionKw(x) => BinaryPart::CallExpressionKw(x),
|
Expr::CallExpressionKw(x) => BinaryPart::CallExpressionKw(x),
|
||||||
Expr::MemberExpression(x) => BinaryPart::MemberExpression(x),
|
Expr::MemberExpression(x) => BinaryPart::MemberExpression(x),
|
||||||
Expr::IfExpression(x) => BinaryPart::IfExpression(x),
|
Expr::IfExpression(x) => BinaryPart::IfExpression(x),
|
||||||
@ -2030,7 +2029,6 @@ fn expr_allowed_in_pipe_expr(i: &mut TokenSlice) -> PResult<Expr> {
|
|||||||
bool_value.map(Expr::Literal),
|
bool_value.map(Expr::Literal),
|
||||||
tag.map(Box::new).map(Expr::TagDeclarator),
|
tag.map(Box::new).map(Expr::TagDeclarator),
|
||||||
literal.map(Expr::Literal),
|
literal.map(Expr::Literal),
|
||||||
fn_call.map(Box::new).map(Expr::CallExpression),
|
|
||||||
fn_call_kw.map(Box::new).map(Expr::CallExpressionKw),
|
fn_call_kw.map(Box::new).map(Expr::CallExpressionKw),
|
||||||
name.map(Box::new).map(Expr::Name),
|
name.map(Box::new).map(Expr::Name),
|
||||||
array,
|
array,
|
||||||
@ -2050,7 +2048,6 @@ fn possible_operands(i: &mut TokenSlice) -> PResult<Expr> {
|
|||||||
bool_value.map(Expr::Literal),
|
bool_value.map(Expr::Literal),
|
||||||
member_expression.map(Box::new).map(Expr::MemberExpression),
|
member_expression.map(Box::new).map(Expr::MemberExpression),
|
||||||
literal.map(Expr::Literal),
|
literal.map(Expr::Literal),
|
||||||
fn_call.map(Box::new).map(Expr::CallExpression),
|
|
||||||
fn_call_kw.map(Box::new).map(Expr::CallExpressionKw),
|
fn_call_kw.map(Box::new).map(Expr::CallExpressionKw),
|
||||||
name.map(Box::new).map(Expr::Name),
|
name.map(Box::new).map(Expr::Name),
|
||||||
binary_expr_in_parens.map(Box::new).map(Expr::BinaryExpression),
|
binary_expr_in_parens.map(Box::new).map(Expr::BinaryExpression),
|
||||||
@ -2711,13 +2708,6 @@ fn pipe_sep(i: &mut TokenSlice) -> PResult<()> {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Arguments are passed into a function.
|
|
||||||
fn arguments(i: &mut TokenSlice) -> PResult<Vec<Expr>> {
|
|
||||||
separated(0.., expression, comma_sep)
|
|
||||||
.context(expected("function arguments"))
|
|
||||||
.parse_next(i)
|
|
||||||
}
|
|
||||||
|
|
||||||
fn labeled_argument(i: &mut TokenSlice) -> PResult<LabeledArg> {
|
fn labeled_argument(i: &mut TokenSlice) -> PResult<LabeledArg> {
|
||||||
separated_pair(
|
separated_pair(
|
||||||
terminated(nameable_identifier, opt(whitespace)),
|
terminated(nameable_identifier, opt(whitespace)),
|
||||||
@ -2986,11 +2976,7 @@ fn binding_name(i: &mut TokenSlice) -> PResult<Node<Identifier>> {
|
|||||||
|
|
||||||
/// Either a positional or keyword function call.
|
/// Either a positional or keyword function call.
|
||||||
fn fn_call_pos_or_kw(i: &mut TokenSlice) -> PResult<Expr> {
|
fn fn_call_pos_or_kw(i: &mut TokenSlice) -> PResult<Expr> {
|
||||||
alt((
|
alt((fn_call_kw.map(Box::new).map(Expr::CallExpressionKw),)).parse_next(i)
|
||||||
fn_call.map(Box::new).map(Expr::CallExpression),
|
|
||||||
fn_call_kw.map(Box::new).map(Expr::CallExpressionKw),
|
|
||||||
))
|
|
||||||
.parse_next(i)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn labelled_fn_call(i: &mut TokenSlice) -> PResult<Expr> {
|
fn labelled_fn_call(i: &mut TokenSlice) -> PResult<Expr> {
|
||||||
@ -3003,43 +2989,6 @@ fn labelled_fn_call(i: &mut TokenSlice) -> PResult<Expr> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn fn_call(i: &mut TokenSlice) -> PResult<Node<CallExpression>> {
|
|
||||||
let fn_name = name(i)?;
|
|
||||||
opt(whitespace).parse_next(i)?;
|
|
||||||
let _ = terminated(open_paren, opt(whitespace)).parse_next(i)?;
|
|
||||||
let args = arguments(i)?;
|
|
||||||
let end = preceded(opt(whitespace), close_paren).parse_next(i)?.end;
|
|
||||||
|
|
||||||
let result = Node::new_node(
|
|
||||||
fn_name.start,
|
|
||||||
end,
|
|
||||||
fn_name.module_id,
|
|
||||||
CallExpression {
|
|
||||||
callee: fn_name,
|
|
||||||
arguments: args,
|
|
||||||
digest: None,
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
let callee_str = result.callee.name.name.to_string();
|
|
||||||
if let Some(suggestion) = super::deprecation(&callee_str, DeprecationKind::Function) {
|
|
||||||
ParseContext::warn(
|
|
||||||
CompilationError::err(
|
|
||||||
result.as_source_range(),
|
|
||||||
format!("Calling `{}` is deprecated, prefer using `{}`.", callee_str, suggestion),
|
|
||||||
)
|
|
||||||
.with_suggestion(
|
|
||||||
format!("Replace `{}` with `{}`", callee_str, suggestion),
|
|
||||||
suggestion,
|
|
||||||
None,
|
|
||||||
Tag::Deprecated,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Ok(result)
|
|
||||||
}
|
|
||||||
|
|
||||||
fn fn_call_kw(i: &mut TokenSlice) -> PResult<Node<CallExpressionKw>> {
|
fn fn_call_kw(i: &mut TokenSlice) -> PResult<Node<CallExpressionKw>> {
|
||||||
let fn_name = name(i)?;
|
let fn_name = name(i)?;
|
||||||
opt(whitespace).parse_next(i)?;
|
opt(whitespace).parse_next(i)?;
|
||||||
@ -3231,18 +3180,6 @@ mod tests {
|
|||||||
assert_reserved("import");
|
assert_reserved("import");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn parse_args() {
|
|
||||||
for (i, (test, expected_len)) in [("someVar", 1), ("5, 3", 2), (r#""a""#, 1)].into_iter().enumerate() {
|
|
||||||
let tokens = crate::parsing::token::lex(test, ModuleId::default()).unwrap();
|
|
||||||
let actual = match arguments.parse(tokens.as_slice()) {
|
|
||||||
Ok(x) => x,
|
|
||||||
Err(e) => panic!("Failed test {i}, could not parse function arguments from \"{test}\": {e:?}"),
|
|
||||||
};
|
|
||||||
assert_eq!(actual.len(), expected_len, "failed test {i}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn parse_names() {
|
fn parse_names() {
|
||||||
for (test, expected_len) in [("someVar", 0), ("::foo", 0), ("foo::bar::baz", 2)] {
|
for (test, expected_len) in [("someVar", 0), ("::foo", 0), ("foo::bar::baz", 2)] {
|
||||||
|
@ -19,24 +19,6 @@ expression: actual
|
|||||||
"init": {
|
"init": {
|
||||||
"body": [
|
"body": [
|
||||||
{
|
{
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"abs_path": false,
|
|
||||||
"commentStart": 26,
|
|
||||||
"end": 28,
|
|
||||||
"name": {
|
|
||||||
"commentStart": 26,
|
|
||||||
"end": 28,
|
|
||||||
"name": "XY",
|
|
||||||
"start": 26,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"path": [],
|
|
||||||
"start": 26,
|
|
||||||
"type": "Name",
|
|
||||||
"type": "Name"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 12,
|
"commentStart": 12,
|
||||||
@ -55,8 +37,24 @@ expression: actual
|
|||||||
"commentStart": 12,
|
"commentStart": 12,
|
||||||
"end": 29,
|
"end": 29,
|
||||||
"start": 12,
|
"start": 12,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": {
|
||||||
|
"abs_path": false,
|
||||||
|
"commentStart": 26,
|
||||||
|
"end": 28,
|
||||||
|
"name": {
|
||||||
|
"commentStart": 26,
|
||||||
|
"end": 28,
|
||||||
|
"name": "XY",
|
||||||
|
"start": 26,
|
||||||
|
"type": "Identifier"
|
||||||
|
},
|
||||||
|
"path": [],
|
||||||
|
"start": 26,
|
||||||
|
"type": "Name",
|
||||||
|
"type": "Name"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"arguments": [
|
"arguments": [
|
||||||
|
@ -63,7 +63,6 @@ expression: actual
|
|||||||
"commentStart": 56,
|
"commentStart": 56,
|
||||||
"end": 74,
|
"end": 74,
|
||||||
"expression": {
|
"expression": {
|
||||||
"arguments": [],
|
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 56,
|
"commentStart": 56,
|
||||||
@ -82,8 +81,9 @@ expression: actual
|
|||||||
"commentStart": 56,
|
"commentStart": 56,
|
||||||
"end": 74,
|
"end": 74,
|
||||||
"start": 56,
|
"start": 56,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": null
|
||||||
},
|
},
|
||||||
"start": 56,
|
"start": 56,
|
||||||
"type": "ExpressionStatement",
|
"type": "ExpressionStatement",
|
||||||
|
@ -71,17 +71,6 @@ expression: actual
|
|||||||
"commentStart": 48,
|
"commentStart": 48,
|
||||||
"end": 60,
|
"end": 60,
|
||||||
"expression": {
|
"expression": {
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"commentStart": 54,
|
|
||||||
"end": 59,
|
|
||||||
"raw": "false",
|
|
||||||
"start": 54,
|
|
||||||
"type": "Literal",
|
|
||||||
"type": "Literal",
|
|
||||||
"value": false
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 48,
|
"commentStart": 48,
|
||||||
@ -100,8 +89,17 @@ expression: actual
|
|||||||
"commentStart": 48,
|
"commentStart": 48,
|
||||||
"end": 60,
|
"end": 60,
|
||||||
"start": 48,
|
"start": 48,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": {
|
||||||
|
"commentStart": 54,
|
||||||
|
"end": 59,
|
||||||
|
"raw": "false",
|
||||||
|
"start": 54,
|
||||||
|
"type": "Literal",
|
||||||
|
"type": "Literal",
|
||||||
|
"value": false
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"start": 48,
|
"start": 48,
|
||||||
"type": "ExpressionStatement",
|
"type": "ExpressionStatement",
|
||||||
|
@ -19,24 +19,6 @@ expression: actual
|
|||||||
"init": {
|
"init": {
|
||||||
"body": [
|
"body": [
|
||||||
{
|
{
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"abs_path": false,
|
|
||||||
"commentStart": 25,
|
|
||||||
"end": 27,
|
|
||||||
"name": {
|
|
||||||
"commentStart": 25,
|
|
||||||
"end": 27,
|
|
||||||
"name": "XY",
|
|
||||||
"start": 25,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"path": [],
|
|
||||||
"start": 25,
|
|
||||||
"type": "Name",
|
|
||||||
"type": "Name"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 11,
|
"commentStart": 11,
|
||||||
@ -55,8 +37,24 @@ expression: actual
|
|||||||
"commentStart": 11,
|
"commentStart": 11,
|
||||||
"end": 28,
|
"end": 28,
|
||||||
"start": 11,
|
"start": 11,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": {
|
||||||
|
"abs_path": false,
|
||||||
|
"commentStart": 25,
|
||||||
|
"end": 27,
|
||||||
|
"name": {
|
||||||
|
"commentStart": 25,
|
||||||
|
"end": 27,
|
||||||
|
"name": "XY",
|
||||||
|
"start": 25,
|
||||||
|
"type": "Identifier"
|
||||||
|
},
|
||||||
|
"path": [],
|
||||||
|
"start": 25,
|
||||||
|
"type": "Name",
|
||||||
|
"type": "Name"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"arguments": [
|
"arguments": [
|
||||||
@ -367,7 +365,6 @@ expression: actual
|
|||||||
"unlabeled": null
|
"unlabeled": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"arguments": [],
|
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 223,
|
"commentStart": 223,
|
||||||
@ -386,8 +383,9 @@ expression: actual
|
|||||||
"commentStart": 223,
|
"commentStart": 223,
|
||||||
"end": 230,
|
"end": 230,
|
||||||
"start": 223,
|
"start": 223,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": null
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"commentStart": 11,
|
"commentStart": 11,
|
||||||
|
@ -19,24 +19,6 @@ expression: actual
|
|||||||
"init": {
|
"init": {
|
||||||
"body": [
|
"body": [
|
||||||
{
|
{
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"abs_path": false,
|
|
||||||
"commentStart": 25,
|
|
||||||
"end": 27,
|
|
||||||
"name": {
|
|
||||||
"commentStart": 25,
|
|
||||||
"end": 27,
|
|
||||||
"name": "XY",
|
|
||||||
"start": 25,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"path": [],
|
|
||||||
"start": 25,
|
|
||||||
"type": "Name",
|
|
||||||
"type": "Name"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 11,
|
"commentStart": 11,
|
||||||
@ -55,8 +37,24 @@ expression: actual
|
|||||||
"commentStart": 11,
|
"commentStart": 11,
|
||||||
"end": 28,
|
"end": 28,
|
||||||
"start": 11,
|
"start": 11,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": {
|
||||||
|
"abs_path": false,
|
||||||
|
"commentStart": 25,
|
||||||
|
"end": 27,
|
||||||
|
"name": {
|
||||||
|
"commentStart": 25,
|
||||||
|
"end": 27,
|
||||||
|
"name": "XY",
|
||||||
|
"start": 25,
|
||||||
|
"type": "Identifier"
|
||||||
|
},
|
||||||
|
"path": [],
|
||||||
|
"start": 25,
|
||||||
|
"type": "Name",
|
||||||
|
"type": "Name"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"arguments": [
|
"arguments": [
|
||||||
@ -195,7 +193,6 @@ expression: actual
|
|||||||
"unlabeled": null
|
"unlabeled": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"arguments": [],
|
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 90,
|
"commentStart": 90,
|
||||||
@ -214,8 +211,9 @@ expression: actual
|
|||||||
"commentStart": 90,
|
"commentStart": 90,
|
||||||
"end": 97,
|
"end": 97,
|
||||||
"start": 90,
|
"start": 90,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": null
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"commentStart": 11,
|
"commentStart": 11,
|
||||||
|
@ -19,24 +19,6 @@ expression: actual
|
|||||||
"init": {
|
"init": {
|
||||||
"body": [
|
"body": [
|
||||||
{
|
{
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"abs_path": false,
|
|
||||||
"commentStart": 22,
|
|
||||||
"end": 24,
|
|
||||||
"name": {
|
|
||||||
"commentStart": 22,
|
|
||||||
"end": 24,
|
|
||||||
"name": "XY",
|
|
||||||
"start": 22,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"path": [],
|
|
||||||
"start": 22,
|
|
||||||
"type": "Name",
|
|
||||||
"type": "Name"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 8,
|
"commentStart": 8,
|
||||||
@ -55,8 +37,24 @@ expression: actual
|
|||||||
"commentStart": 8,
|
"commentStart": 8,
|
||||||
"end": 25,
|
"end": 25,
|
||||||
"start": 8,
|
"start": 8,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": {
|
||||||
|
"abs_path": false,
|
||||||
|
"commentStart": 22,
|
||||||
|
"end": 24,
|
||||||
|
"name": {
|
||||||
|
"commentStart": 22,
|
||||||
|
"end": 24,
|
||||||
|
"name": "XY",
|
||||||
|
"start": 22,
|
||||||
|
"type": "Identifier"
|
||||||
|
},
|
||||||
|
"path": [],
|
||||||
|
"start": 22,
|
||||||
|
"type": "Name",
|
||||||
|
"type": "Name"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"arguments": [
|
"arguments": [
|
||||||
|
@ -19,20 +19,6 @@ expression: actual
|
|||||||
"init": {
|
"init": {
|
||||||
"body": [
|
"body": [
|
||||||
{
|
{
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"commentStart": 10,
|
|
||||||
"end": 11,
|
|
||||||
"raw": "1",
|
|
||||||
"start": 10,
|
|
||||||
"type": "Literal",
|
|
||||||
"type": "Literal",
|
|
||||||
"value": {
|
|
||||||
"value": 1.0,
|
|
||||||
"suffix": "None"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 8,
|
"commentStart": 8,
|
||||||
@ -51,24 +37,22 @@ expression: actual
|
|||||||
"commentStart": 8,
|
"commentStart": 8,
|
||||||
"end": 12,
|
"end": 12,
|
||||||
"start": 8,
|
"start": 8,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
},
|
"unlabeled": {
|
||||||
{
|
"commentStart": 10,
|
||||||
"arguments": [
|
"end": 11,
|
||||||
{
|
"raw": "1",
|
||||||
"commentStart": 18,
|
"start": 10,
|
||||||
"end": 19,
|
|
||||||
"raw": "2",
|
|
||||||
"start": 18,
|
|
||||||
"type": "Literal",
|
"type": "Literal",
|
||||||
"type": "Literal",
|
"type": "Literal",
|
||||||
"value": {
|
"value": {
|
||||||
"value": 2.0,
|
"value": 1.0,
|
||||||
"suffix": "None"
|
"suffix": "None"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
},
|
||||||
|
{
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 16,
|
"commentStart": 16,
|
||||||
@ -87,8 +71,20 @@ expression: actual
|
|||||||
"commentStart": 16,
|
"commentStart": 16,
|
||||||
"end": 20,
|
"end": 20,
|
||||||
"start": 16,
|
"start": 16,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": {
|
||||||
|
"commentStart": 18,
|
||||||
|
"end": 19,
|
||||||
|
"raw": "2",
|
||||||
|
"start": 18,
|
||||||
|
"type": "Literal",
|
||||||
|
"type": "Literal",
|
||||||
|
"value": {
|
||||||
|
"value": 2.0,
|
||||||
|
"suffix": "None"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"commentStart": 8,
|
"commentStart": 8,
|
||||||
|
@ -19,24 +19,6 @@ expression: actual
|
|||||||
"init": {
|
"init": {
|
||||||
"body": [
|
"body": [
|
||||||
{
|
{
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"abs_path": false,
|
|
||||||
"commentStart": 22,
|
|
||||||
"end": 24,
|
|
||||||
"name": {
|
|
||||||
"commentStart": 22,
|
|
||||||
"end": 24,
|
|
||||||
"name": "XY",
|
|
||||||
"start": 22,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"path": [],
|
|
||||||
"start": 22,
|
|
||||||
"type": "Name",
|
|
||||||
"type": "Name"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 8,
|
"commentStart": 8,
|
||||||
@ -55,8 +37,24 @@ expression: actual
|
|||||||
"commentStart": 8,
|
"commentStart": 8,
|
||||||
"end": 25,
|
"end": 25,
|
||||||
"start": 8,
|
"start": 8,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": {
|
||||||
|
"abs_path": false,
|
||||||
|
"commentStart": 22,
|
||||||
|
"end": 24,
|
||||||
|
"name": {
|
||||||
|
"commentStart": 22,
|
||||||
|
"end": 24,
|
||||||
|
"name": "XY",
|
||||||
|
"start": 22,
|
||||||
|
"type": "Identifier"
|
||||||
|
},
|
||||||
|
"path": [],
|
||||||
|
"start": 22,
|
||||||
|
"type": "Name",
|
||||||
|
"type": "Name"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"arguments": [
|
"arguments": [
|
||||||
|
@ -19,24 +19,6 @@ expression: actual
|
|||||||
"init": {
|
"init": {
|
||||||
"body": [
|
"body": [
|
||||||
{
|
{
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"abs_path": false,
|
|
||||||
"commentStart": 25,
|
|
||||||
"end": 27,
|
|
||||||
"name": {
|
|
||||||
"commentStart": 25,
|
|
||||||
"end": 27,
|
|
||||||
"name": "XY",
|
|
||||||
"start": 25,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"path": [],
|
|
||||||
"start": 25,
|
|
||||||
"type": "Name",
|
|
||||||
"type": "Name"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 11,
|
"commentStart": 11,
|
||||||
@ -55,8 +37,24 @@ expression: actual
|
|||||||
"commentStart": 11,
|
"commentStart": 11,
|
||||||
"end": 28,
|
"end": 28,
|
||||||
"start": 11,
|
"start": 11,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": {
|
||||||
|
"abs_path": false,
|
||||||
|
"commentStart": 25,
|
||||||
|
"end": 27,
|
||||||
|
"name": {
|
||||||
|
"commentStart": 25,
|
||||||
|
"end": 27,
|
||||||
|
"name": "XY",
|
||||||
|
"start": 25,
|
||||||
|
"type": "Identifier"
|
||||||
|
},
|
||||||
|
"path": [],
|
||||||
|
"start": 25,
|
||||||
|
"type": "Name",
|
||||||
|
"type": "Name"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"arguments": [
|
"arguments": [
|
||||||
|
@ -8,8 +8,27 @@ expression: actual
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 12,
|
"end": 12,
|
||||||
"expression": {
|
"expression": {
|
||||||
"arguments": [
|
"callee": {
|
||||||
{
|
"abs_path": false,
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 4,
|
||||||
|
"name": {
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 4,
|
||||||
|
"name": "line",
|
||||||
|
"start": 0,
|
||||||
|
"type": "Identifier"
|
||||||
|
},
|
||||||
|
"path": [],
|
||||||
|
"start": 0,
|
||||||
|
"type": "Name"
|
||||||
|
},
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 12,
|
||||||
|
"start": 0,
|
||||||
|
"type": "CallExpressionKw",
|
||||||
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": {
|
||||||
"commentStart": 5,
|
"commentStart": 5,
|
||||||
"elements": [
|
"elements": [
|
||||||
{
|
{
|
||||||
@ -46,27 +65,6 @@ expression: actual
|
|||||||
"type": "ArrayExpression",
|
"type": "ArrayExpression",
|
||||||
"type": "ArrayExpression"
|
"type": "ArrayExpression"
|
||||||
}
|
}
|
||||||
],
|
|
||||||
"callee": {
|
|
||||||
"abs_path": false,
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 4,
|
|
||||||
"name": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 4,
|
|
||||||
"name": "line",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"path": [],
|
|
||||||
"start": 0,
|
|
||||||
"type": "Name"
|
|
||||||
},
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 12,
|
|
||||||
"start": 0,
|
|
||||||
"type": "CallExpression",
|
|
||||||
"type": "CallExpression"
|
|
||||||
},
|
},
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "ExpressionStatement",
|
"type": "ExpressionStatement",
|
||||||
|
@ -19,24 +19,6 @@ expression: actual
|
|||||||
"init": {
|
"init": {
|
||||||
"body": [
|
"body": [
|
||||||
{
|
{
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"abs_path": false,
|
|
||||||
"commentStart": 25,
|
|
||||||
"end": 27,
|
|
||||||
"name": {
|
|
||||||
"commentStart": 25,
|
|
||||||
"end": 27,
|
|
||||||
"name": "XY",
|
|
||||||
"start": 25,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"path": [],
|
|
||||||
"start": 25,
|
|
||||||
"type": "Name",
|
|
||||||
"type": "Name"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 11,
|
"commentStart": 11,
|
||||||
@ -55,8 +37,24 @@ expression: actual
|
|||||||
"commentStart": 11,
|
"commentStart": 11,
|
||||||
"end": 28,
|
"end": 28,
|
||||||
"start": 11,
|
"start": 11,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": {
|
||||||
|
"abs_path": false,
|
||||||
|
"commentStart": 25,
|
||||||
|
"end": 27,
|
||||||
|
"name": {
|
||||||
|
"commentStart": 25,
|
||||||
|
"end": 27,
|
||||||
|
"name": "XY",
|
||||||
|
"start": 25,
|
||||||
|
"type": "Identifier"
|
||||||
|
},
|
||||||
|
"path": [],
|
||||||
|
"start": 25,
|
||||||
|
"type": "Name",
|
||||||
|
"type": "Name"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"arguments": [
|
"arguments": [
|
||||||
|
@ -32,24 +32,6 @@ expression: actual
|
|||||||
{
|
{
|
||||||
"commentStart": 38,
|
"commentStart": 38,
|
||||||
"cond": {
|
"cond": {
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"abs_path": false,
|
|
||||||
"commentStart": 51,
|
|
||||||
"end": 57,
|
|
||||||
"name": {
|
|
||||||
"commentStart": 51,
|
|
||||||
"end": 57,
|
|
||||||
"name": "radius",
|
|
||||||
"start": 51,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"path": [],
|
|
||||||
"start": 51,
|
|
||||||
"type": "Name",
|
|
||||||
"type": "Name"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 46,
|
"commentStart": 46,
|
||||||
@ -68,8 +50,24 @@ expression: actual
|
|||||||
"commentStart": 46,
|
"commentStart": 46,
|
||||||
"end": 58,
|
"end": 58,
|
||||||
"start": 46,
|
"start": 46,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": {
|
||||||
|
"abs_path": false,
|
||||||
|
"commentStart": 51,
|
||||||
|
"end": 57,
|
||||||
|
"name": {
|
||||||
|
"commentStart": 51,
|
||||||
|
"end": 57,
|
||||||
|
"name": "radius",
|
||||||
|
"start": 51,
|
||||||
|
"type": "Identifier"
|
||||||
|
},
|
||||||
|
"path": [],
|
||||||
|
"start": 51,
|
||||||
|
"type": "Name",
|
||||||
|
"type": "Name"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"digest": null,
|
"digest": null,
|
||||||
"end": 84,
|
"end": 84,
|
||||||
|
@ -51,20 +51,6 @@ expression: actual
|
|||||||
"type": "BinaryExpression"
|
"type": "BinaryExpression"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"commentStart": 24,
|
|
||||||
"end": 26,
|
|
||||||
"raw": "45",
|
|
||||||
"start": 24,
|
|
||||||
"type": "Literal",
|
|
||||||
"type": "Literal",
|
|
||||||
"value": {
|
|
||||||
"value": 45.0,
|
|
||||||
"suffix": "None"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 17,
|
"commentStart": 17,
|
||||||
@ -83,8 +69,20 @@ expression: actual
|
|||||||
"commentStart": 17,
|
"commentStart": 17,
|
||||||
"end": 27,
|
"end": 27,
|
||||||
"start": 17,
|
"start": 17,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": {
|
||||||
|
"commentStart": 24,
|
||||||
|
"end": 26,
|
||||||
|
"raw": "45",
|
||||||
|
"start": 24,
|
||||||
|
"type": "Literal",
|
||||||
|
"type": "Literal",
|
||||||
|
"value": {
|
||||||
|
"value": 45.0,
|
||||||
|
"suffix": "None"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"commentStart": 8,
|
"commentStart": 8,
|
||||||
|
@ -19,24 +19,6 @@ expression: actual
|
|||||||
"init": {
|
"init": {
|
||||||
"body": [
|
"body": [
|
||||||
{
|
{
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"abs_path": false,
|
|
||||||
"commentStart": 19,
|
|
||||||
"end": 21,
|
|
||||||
"name": {
|
|
||||||
"commentStart": 19,
|
|
||||||
"end": 21,
|
|
||||||
"name": "XY",
|
|
||||||
"start": 19,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"path": [],
|
|
||||||
"start": 19,
|
|
||||||
"type": "Name",
|
|
||||||
"type": "Name"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 5,
|
"commentStart": 5,
|
||||||
@ -55,28 +37,26 @@ expression: actual
|
|||||||
"commentStart": 5,
|
"commentStart": 5,
|
||||||
"end": 22,
|
"end": 22,
|
||||||
"start": 5,
|
"start": 5,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
},
|
"unlabeled": {
|
||||||
{
|
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 39,
|
"commentStart": 19,
|
||||||
"end": 42,
|
"end": 21,
|
||||||
"name": {
|
"name": {
|
||||||
"commentStart": 39,
|
"commentStart": 19,
|
||||||
"end": 42,
|
"end": 21,
|
||||||
"name": "pos",
|
"name": "XY",
|
||||||
"start": 39,
|
"start": 19,
|
||||||
"type": "Identifier"
|
"type": "Identifier"
|
||||||
},
|
},
|
||||||
"path": [],
|
"path": [],
|
||||||
"start": 39,
|
"start": 19,
|
||||||
"type": "Name",
|
"type": "Name",
|
||||||
"type": "Name"
|
"type": "Name"
|
||||||
}
|
}
|
||||||
],
|
},
|
||||||
|
{
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 26,
|
"commentStart": 26,
|
||||||
@ -95,8 +75,24 @@ expression: actual
|
|||||||
"commentStart": 26,
|
"commentStart": 26,
|
||||||
"end": 43,
|
"end": 43,
|
||||||
"start": 26,
|
"start": 26,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": {
|
||||||
|
"abs_path": false,
|
||||||
|
"commentStart": 39,
|
||||||
|
"end": 42,
|
||||||
|
"name": {
|
||||||
|
"commentStart": 39,
|
||||||
|
"end": 42,
|
||||||
|
"name": "pos",
|
||||||
|
"start": 39,
|
||||||
|
"type": "Identifier"
|
||||||
|
},
|
||||||
|
"path": [],
|
||||||
|
"start": 39,
|
||||||
|
"type": "Name",
|
||||||
|
"type": "Name"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"commentStart": 5,
|
"commentStart": 5,
|
||||||
|
@ -19,24 +19,6 @@ expression: actual
|
|||||||
"init": {
|
"init": {
|
||||||
"body": [
|
"body": [
|
||||||
{
|
{
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"abs_path": false,
|
|
||||||
"commentStart": 19,
|
|
||||||
"end": 21,
|
|
||||||
"name": {
|
|
||||||
"commentStart": 19,
|
|
||||||
"end": 21,
|
|
||||||
"name": "XY",
|
|
||||||
"start": 19,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"path": [],
|
|
||||||
"start": 19,
|
|
||||||
"type": "Name",
|
|
||||||
"type": "Name"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 5,
|
"commentStart": 5,
|
||||||
@ -55,28 +37,26 @@ expression: actual
|
|||||||
"commentStart": 5,
|
"commentStart": 5,
|
||||||
"end": 22,
|
"end": 22,
|
||||||
"start": 5,
|
"start": 5,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
},
|
"unlabeled": {
|
||||||
{
|
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 43,
|
"commentStart": 19,
|
||||||
"end": 46,
|
"end": 21,
|
||||||
"name": {
|
"name": {
|
||||||
"commentStart": 43,
|
"commentStart": 19,
|
||||||
"end": 46,
|
"end": 21,
|
||||||
"name": "pos",
|
"name": "XY",
|
||||||
"start": 43,
|
"start": 19,
|
||||||
"type": "Identifier"
|
"type": "Identifier"
|
||||||
},
|
},
|
||||||
"path": [],
|
"path": [],
|
||||||
"start": 43,
|
"start": 19,
|
||||||
"type": "Name",
|
"type": "Name",
|
||||||
"type": "Name"
|
"type": "Name"
|
||||||
}
|
}
|
||||||
],
|
},
|
||||||
|
{
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 30,
|
"commentStart": 30,
|
||||||
@ -95,12 +75,47 @@ expression: actual
|
|||||||
"commentStart": 30,
|
"commentStart": 30,
|
||||||
"end": 47,
|
"end": 47,
|
||||||
"start": 30,
|
"start": 30,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": {
|
||||||
|
"abs_path": false,
|
||||||
|
"commentStart": 43,
|
||||||
|
"end": 46,
|
||||||
|
"name": {
|
||||||
|
"commentStart": 43,
|
||||||
|
"end": 46,
|
||||||
|
"name": "pos",
|
||||||
|
"start": 43,
|
||||||
|
"type": "Identifier"
|
||||||
|
},
|
||||||
|
"path": [],
|
||||||
|
"start": 43,
|
||||||
|
"type": "Name",
|
||||||
|
"type": "Name"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"arguments": [
|
"callee": {
|
||||||
{
|
"abs_path": false,
|
||||||
|
"commentStart": 51,
|
||||||
|
"end": 55,
|
||||||
|
"name": {
|
||||||
|
"commentStart": 51,
|
||||||
|
"end": 55,
|
||||||
|
"name": "line",
|
||||||
|
"start": 51,
|
||||||
|
"type": "Identifier"
|
||||||
|
},
|
||||||
|
"path": [],
|
||||||
|
"start": 51,
|
||||||
|
"type": "Name"
|
||||||
|
},
|
||||||
|
"commentStart": 51,
|
||||||
|
"end": 68,
|
||||||
|
"start": 51,
|
||||||
|
"type": "CallExpressionKw",
|
||||||
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": {
|
||||||
"commentStart": 56,
|
"commentStart": 56,
|
||||||
"elements": [
|
"elements": [
|
||||||
{
|
{
|
||||||
@ -145,27 +160,6 @@ expression: actual
|
|||||||
"type": "ArrayExpression",
|
"type": "ArrayExpression",
|
||||||
"type": "ArrayExpression"
|
"type": "ArrayExpression"
|
||||||
}
|
}
|
||||||
],
|
|
||||||
"callee": {
|
|
||||||
"abs_path": false,
|
|
||||||
"commentStart": 51,
|
|
||||||
"end": 55,
|
|
||||||
"name": {
|
|
||||||
"commentStart": 51,
|
|
||||||
"end": 55,
|
|
||||||
"name": "line",
|
|
||||||
"start": 51,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"path": [],
|
|
||||||
"start": 51,
|
|
||||||
"type": "Name"
|
|
||||||
},
|
|
||||||
"commentStart": 51,
|
|
||||||
"end": 68,
|
|
||||||
"start": 51,
|
|
||||||
"type": "CallExpression",
|
|
||||||
"type": "CallExpression"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"commentStart": 5,
|
"commentStart": 5,
|
||||||
|
@ -527,9 +527,6 @@ pub enum OnboardingStatus {
|
|||||||
#[serde(rename = "/export")]
|
#[serde(rename = "/export")]
|
||||||
#[display("/export")]
|
#[display("/export")]
|
||||||
Export,
|
Export,
|
||||||
#[serde(rename = "/move")]
|
|
||||||
#[display("/move")]
|
|
||||||
Move,
|
|
||||||
#[serde(rename = "/sketching")]
|
#[serde(rename = "/sketching")]
|
||||||
#[display("/sketching")]
|
#[display("/sketching")]
|
||||||
Sketching,
|
Sketching,
|
||||||
|
@ -3,10 +3,10 @@ use std::fmt::Write;
|
|||||||
use crate::parsing::{
|
use crate::parsing::{
|
||||||
ast::types::{
|
ast::types::{
|
||||||
Annotation, ArrayExpression, ArrayRangeExpression, BinaryExpression, BinaryOperator, BinaryPart, BodyItem,
|
Annotation, ArrayExpression, ArrayRangeExpression, BinaryExpression, BinaryOperator, BinaryPart, BodyItem,
|
||||||
CallExpression, CallExpressionKw, CommentStyle, DefaultParamVal, Expr, FormatOptions, FunctionExpression,
|
CallExpressionKw, CommentStyle, DefaultParamVal, Expr, FormatOptions, FunctionExpression, IfExpression,
|
||||||
IfExpression, ImportSelector, ImportStatement, ItemVisibility, LabeledArg, Literal, LiteralIdentifier,
|
ImportSelector, ImportStatement, ItemVisibility, LabeledArg, Literal, LiteralIdentifier, LiteralValue,
|
||||||
LiteralValue, MemberExpression, MemberObject, Node, NonCodeNode, NonCodeValue, ObjectExpression, Parameter,
|
MemberExpression, MemberObject, Node, NonCodeNode, NonCodeValue, ObjectExpression, Parameter, PipeExpression,
|
||||||
PipeExpression, Program, TagDeclarator, TypeDeclaration, UnaryExpression, VariableDeclaration, VariableKind,
|
Program, TagDeclarator, TypeDeclaration, UnaryExpression, VariableDeclaration, VariableKind,
|
||||||
},
|
},
|
||||||
deprecation,
|
deprecation,
|
||||||
token::NumericSuffix,
|
token::NumericSuffix,
|
||||||
@ -291,7 +291,6 @@ impl Expr {
|
|||||||
result += &func_exp.recast(options, indentation_level);
|
result += &func_exp.recast(options, indentation_level);
|
||||||
result
|
result
|
||||||
}
|
}
|
||||||
Expr::CallExpression(call_exp) => call_exp.recast(options, indentation_level, ctxt),
|
|
||||||
Expr::CallExpressionKw(call_exp) => call_exp.recast(options, indentation_level, ctxt),
|
Expr::CallExpressionKw(call_exp) => call_exp.recast(options, indentation_level, ctxt),
|
||||||
Expr::Name(name) => {
|
Expr::Name(name) => {
|
||||||
let result = name.to_string();
|
let result = name.to_string();
|
||||||
@ -342,9 +341,6 @@ impl BinaryPart {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
BinaryPart::BinaryExpression(binary_expression) => binary_expression.recast(options),
|
BinaryPart::BinaryExpression(binary_expression) => binary_expression.recast(options),
|
||||||
BinaryPart::CallExpression(call_expression) => {
|
|
||||||
call_expression.recast(options, indentation_level, ExprContext::Other)
|
|
||||||
}
|
|
||||||
BinaryPart::CallExpressionKw(call_expression) => {
|
BinaryPart::CallExpressionKw(call_expression) => {
|
||||||
call_expression.recast(options, indentation_level, ExprContext::Other)
|
call_expression.recast(options, indentation_level, ExprContext::Other)
|
||||||
}
|
}
|
||||||
@ -355,29 +351,10 @@ impl BinaryPart {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl CallExpression {
|
|
||||||
fn recast(&self, options: &FormatOptions, indentation_level: usize, ctxt: ExprContext) -> String {
|
|
||||||
format!(
|
|
||||||
"{}{}({})",
|
|
||||||
if ctxt == ExprContext::Pipe {
|
|
||||||
"".to_string()
|
|
||||||
} else {
|
|
||||||
options.get_indentation(indentation_level)
|
|
||||||
},
|
|
||||||
self.callee,
|
|
||||||
self.arguments
|
|
||||||
.iter()
|
|
||||||
.map(|arg| arg.recast(options, indentation_level, ctxt))
|
|
||||||
.collect::<Vec<String>>()
|
|
||||||
.join(", ")
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl CallExpressionKw {
|
impl CallExpressionKw {
|
||||||
fn recast_args(&self, options: &FormatOptions, indentation_level: usize, ctxt: ExprContext) -> Vec<String> {
|
fn recast_args(&self, options: &FormatOptions, indentation_level: usize, ctxt: ExprContext) -> Vec<String> {
|
||||||
let mut arg_list = if let Some(first_arg) = &self.unlabeled {
|
let mut arg_list = if let Some(first_arg) = &self.unlabeled {
|
||||||
vec![first_arg.recast(options, indentation_level, ctxt)]
|
vec![first_arg.recast(options, indentation_level, ctxt).trim().to_owned()]
|
||||||
} else {
|
} else {
|
||||||
Vec::with_capacity(self.arguments.len())
|
Vec::with_capacity(self.arguments.len())
|
||||||
};
|
};
|
||||||
@ -748,8 +725,7 @@ impl UnaryExpression {
|
|||||||
| BinaryPart::Name(_)
|
| BinaryPart::Name(_)
|
||||||
| BinaryPart::MemberExpression(_)
|
| BinaryPart::MemberExpression(_)
|
||||||
| BinaryPart::IfExpression(_)
|
| BinaryPart::IfExpression(_)
|
||||||
| BinaryPart::CallExpressionKw(_)
|
| BinaryPart::CallExpressionKw(_) => {
|
||||||
| BinaryPart::CallExpression(_) => {
|
|
||||||
format!("{}{}", &self.operator, self.argument.recast(options, 0))
|
format!("{}{}", &self.operator, self.argument.recast(options, 0))
|
||||||
}
|
}
|
||||||
BinaryPart::BinaryExpression(_) | BinaryPart::UnaryExpression(_) => {
|
BinaryPart::BinaryExpression(_) | BinaryPart::UnaryExpression(_) => {
|
||||||
@ -2584,6 +2560,58 @@ sketch002 = startSketchOn({
|
|||||||
assert_eq!(actual, input);
|
assert_eq!(actual, input);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn unparse_call_inside_function_single_line() {
|
||||||
|
let input = r#"fn foo() {
|
||||||
|
toDegrees(atan(0.5), foo = 1)
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
"#;
|
||||||
|
let ast = crate::parsing::top_level_parse(input).unwrap();
|
||||||
|
let actual = ast.recast(&FormatOptions::new(), 0);
|
||||||
|
assert_eq!(actual, input);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn unparse_call_inside_function_args_multiple_lines() {
|
||||||
|
let input = r#"fn foo() {
|
||||||
|
toDegrees(
|
||||||
|
atan(0.5),
|
||||||
|
foo = 1,
|
||||||
|
bar = 2,
|
||||||
|
baz = 3,
|
||||||
|
qux = 4,
|
||||||
|
)
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
"#;
|
||||||
|
let ast = crate::parsing::top_level_parse(input).unwrap();
|
||||||
|
let actual = ast.recast(&FormatOptions::new(), 0);
|
||||||
|
assert_eq!(actual, input);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn unparse_call_inside_function_single_arg_multiple_lines() {
|
||||||
|
let input = r#"fn foo() {
|
||||||
|
toDegrees(
|
||||||
|
[
|
||||||
|
profile0,
|
||||||
|
profile1,
|
||||||
|
profile2,
|
||||||
|
profile3,
|
||||||
|
profile4,
|
||||||
|
profile5
|
||||||
|
],
|
||||||
|
key = 1,
|
||||||
|
)
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
"#;
|
||||||
|
let ast = crate::parsing::top_level_parse(input).unwrap();
|
||||||
|
let actual = ast.recast(&FormatOptions::new(), 0);
|
||||||
|
assert_eq!(actual, input);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn recast_objects_with_comments() {
|
fn recast_objects_with_comments() {
|
||||||
use winnow::Parser;
|
use winnow::Parser;
|
||||||
|
@ -23,7 +23,6 @@ pub enum Node<'a> {
|
|||||||
Name(NodeRef<'a, types::Name>),
|
Name(NodeRef<'a, types::Name>),
|
||||||
BinaryExpression(NodeRef<'a, types::BinaryExpression>),
|
BinaryExpression(NodeRef<'a, types::BinaryExpression>),
|
||||||
FunctionExpression(NodeRef<'a, types::FunctionExpression>),
|
FunctionExpression(NodeRef<'a, types::FunctionExpression>),
|
||||||
CallExpression(NodeRef<'a, types::CallExpression>),
|
|
||||||
CallExpressionKw(NodeRef<'a, types::CallExpressionKw>),
|
CallExpressionKw(NodeRef<'a, types::CallExpressionKw>),
|
||||||
PipeExpression(NodeRef<'a, types::PipeExpression>),
|
PipeExpression(NodeRef<'a, types::PipeExpression>),
|
||||||
PipeSubstitution(NodeRef<'a, types::PipeSubstitution>),
|
PipeSubstitution(NodeRef<'a, types::PipeSubstitution>),
|
||||||
@ -64,7 +63,6 @@ impl Node<'_> {
|
|||||||
Node::Name(n) => n.digest,
|
Node::Name(n) => n.digest,
|
||||||
Node::BinaryExpression(n) => n.digest,
|
Node::BinaryExpression(n) => n.digest,
|
||||||
Node::FunctionExpression(n) => n.digest,
|
Node::FunctionExpression(n) => n.digest,
|
||||||
Node::CallExpression(n) => n.digest,
|
|
||||||
Node::CallExpressionKw(n) => n.digest,
|
Node::CallExpressionKw(n) => n.digest,
|
||||||
Node::PipeExpression(n) => n.digest,
|
Node::PipeExpression(n) => n.digest,
|
||||||
Node::PipeSubstitution(n) => n.digest,
|
Node::PipeSubstitution(n) => n.digest,
|
||||||
@ -109,7 +107,6 @@ impl Node<'_> {
|
|||||||
Node::Name(n) => *n as *const _ as *const (),
|
Node::Name(n) => *n as *const _ as *const (),
|
||||||
Node::BinaryExpression(n) => *n as *const _ as *const (),
|
Node::BinaryExpression(n) => *n as *const _ as *const (),
|
||||||
Node::FunctionExpression(n) => *n as *const _ as *const (),
|
Node::FunctionExpression(n) => *n as *const _ as *const (),
|
||||||
Node::CallExpression(n) => *n as *const _ as *const (),
|
|
||||||
Node::CallExpressionKw(n) => *n as *const _ as *const (),
|
Node::CallExpressionKw(n) => *n as *const _ as *const (),
|
||||||
Node::PipeExpression(n) => *n as *const _ as *const (),
|
Node::PipeExpression(n) => *n as *const _ as *const (),
|
||||||
Node::PipeSubstitution(n) => *n as *const _ as *const (),
|
Node::PipeSubstitution(n) => *n as *const _ as *const (),
|
||||||
@ -154,7 +151,6 @@ impl TryFrom<&Node<'_>> for SourceRange {
|
|||||||
Node::Name(n) => SourceRange::from(*n),
|
Node::Name(n) => SourceRange::from(*n),
|
||||||
Node::BinaryExpression(n) => SourceRange::from(*n),
|
Node::BinaryExpression(n) => SourceRange::from(*n),
|
||||||
Node::FunctionExpression(n) => SourceRange::from(*n),
|
Node::FunctionExpression(n) => SourceRange::from(*n),
|
||||||
Node::CallExpression(n) => SourceRange::from(*n),
|
|
||||||
Node::CallExpressionKw(n) => SourceRange::from(*n),
|
Node::CallExpressionKw(n) => SourceRange::from(*n),
|
||||||
Node::PipeExpression(n) => SourceRange::from(*n),
|
Node::PipeExpression(n) => SourceRange::from(*n),
|
||||||
Node::PipeSubstitution(n) => SourceRange::from(*n),
|
Node::PipeSubstitution(n) => SourceRange::from(*n),
|
||||||
@ -199,7 +195,6 @@ impl<'tree> From<&'tree types::Expr> for Node<'tree> {
|
|||||||
types::Expr::Name(id) => id.as_ref().into(),
|
types::Expr::Name(id) => id.as_ref().into(),
|
||||||
types::Expr::BinaryExpression(be) => be.as_ref().into(),
|
types::Expr::BinaryExpression(be) => be.as_ref().into(),
|
||||||
types::Expr::FunctionExpression(fe) => fe.as_ref().into(),
|
types::Expr::FunctionExpression(fe) => fe.as_ref().into(),
|
||||||
types::Expr::CallExpression(ce) => ce.as_ref().into(),
|
|
||||||
types::Expr::CallExpressionKw(ce) => ce.as_ref().into(),
|
types::Expr::CallExpressionKw(ce) => ce.as_ref().into(),
|
||||||
types::Expr::PipeExpression(pe) => pe.as_ref().into(),
|
types::Expr::PipeExpression(pe) => pe.as_ref().into(),
|
||||||
types::Expr::PipeSubstitution(ps) => ps.as_ref().into(),
|
types::Expr::PipeSubstitution(ps) => ps.as_ref().into(),
|
||||||
@ -222,7 +217,6 @@ impl<'tree> From<&'tree types::BinaryPart> for Node<'tree> {
|
|||||||
types::BinaryPart::Literal(lit) => lit.as_ref().into(),
|
types::BinaryPart::Literal(lit) => lit.as_ref().into(),
|
||||||
types::BinaryPart::Name(id) => id.as_ref().into(),
|
types::BinaryPart::Name(id) => id.as_ref().into(),
|
||||||
types::BinaryPart::BinaryExpression(be) => be.as_ref().into(),
|
types::BinaryPart::BinaryExpression(be) => be.as_ref().into(),
|
||||||
types::BinaryPart::CallExpression(ce) => ce.as_ref().into(),
|
|
||||||
types::BinaryPart::CallExpressionKw(ce) => ce.as_ref().into(),
|
types::BinaryPart::CallExpressionKw(ce) => ce.as_ref().into(),
|
||||||
types::BinaryPart::UnaryExpression(ue) => ue.as_ref().into(),
|
types::BinaryPart::UnaryExpression(ue) => ue.as_ref().into(),
|
||||||
types::BinaryPart::MemberExpression(me) => me.as_ref().into(),
|
types::BinaryPart::MemberExpression(me) => me.as_ref().into(),
|
||||||
@ -282,7 +276,6 @@ impl_from!(Node, Identifier);
|
|||||||
impl_from!(Node, Name);
|
impl_from!(Node, Name);
|
||||||
impl_from!(Node, BinaryExpression);
|
impl_from!(Node, BinaryExpression);
|
||||||
impl_from!(Node, FunctionExpression);
|
impl_from!(Node, FunctionExpression);
|
||||||
impl_from!(Node, CallExpression);
|
|
||||||
impl_from!(Node, CallExpressionKw);
|
impl_from!(Node, CallExpressionKw);
|
||||||
impl_from!(Node, PipeExpression);
|
impl_from!(Node, PipeExpression);
|
||||||
impl_from!(Node, PipeSubstitution);
|
impl_from!(Node, PipeSubstitution);
|
||||||
|
@ -78,19 +78,17 @@ impl<'tree> Visitable<'tree> for Node<'tree> {
|
|||||||
children.push((&n.body).into());
|
children.push((&n.body).into());
|
||||||
children
|
children
|
||||||
}
|
}
|
||||||
Node::CallExpression(n) => {
|
|
||||||
let mut children = n.arguments.iter().map(|v| v.into()).collect::<Vec<Node>>();
|
|
||||||
children.insert(0, (&n.callee).into());
|
|
||||||
children
|
|
||||||
}
|
|
||||||
Node::CallExpressionKw(n) => {
|
Node::CallExpressionKw(n) => {
|
||||||
let mut children = n.unlabeled.iter().map(|v| v.into()).collect::<Vec<Node>>();
|
let mut children: Vec<Node<'_>> =
|
||||||
|
Vec::with_capacity(1 + if n.unlabeled.is_some() { 1 } else { 0 } + n.arguments.len());
|
||||||
|
children.push((&n.callee).into());
|
||||||
|
children.extend(n.unlabeled.iter().map(Node::from));
|
||||||
|
|
||||||
// TODO: this is wrong but it's what the old walk code was doing.
|
// TODO: this is wrong but it's what the old walk code was doing.
|
||||||
// We likely need a real LabeledArg AST node, but I don't
|
// We likely need a real LabeledArg AST node, but I don't
|
||||||
// want to tango with it since it's a lot deeper than
|
// want to tango with it since it's a lot deeper than
|
||||||
// adding it to the enum.
|
// adding it to the enum.
|
||||||
children.extend(n.arguments.iter().map(|v| (&v.arg).into()).collect::<Vec<Node>>());
|
children.extend(n.arguments.iter().map(|v| Node::from(&v.arg)));
|
||||||
children
|
children
|
||||||
}
|
}
|
||||||
Node::PipeExpression(n) => n.body.iter().map(|v| v.into()).collect(),
|
Node::PipeExpression(n) => n.body.iter().map(|v| v.into()).collect(),
|
||||||
|
@ -21,8 +21,9 @@ type Dependency = (String, String);
|
|||||||
|
|
||||||
type Graph = Vec<Dependency>;
|
type Graph = Vec<Dependency>;
|
||||||
|
|
||||||
type DependencyInfo = (AstNode<ImportStatement>, ModuleId, ModulePath, ModuleRepr);
|
pub(crate) type DependencyInfo = (AstNode<ImportStatement>, ModuleId, ModulePath, ModuleRepr);
|
||||||
type Universe = HashMap<String, DependencyInfo>;
|
pub(crate) type UniverseMap = HashMap<PathBuf, AstNode<ImportStatement>>;
|
||||||
|
pub(crate) type Universe = HashMap<String, DependencyInfo>;
|
||||||
|
|
||||||
/// Process a number of programs, returning the graph of dependencies.
|
/// Process a number of programs, returning the graph of dependencies.
|
||||||
///
|
///
|
||||||
@ -184,7 +185,7 @@ pub(crate) async fn import_universe(
|
|||||||
repr: &ModuleRepr,
|
repr: &ModuleRepr,
|
||||||
out: &mut Universe,
|
out: &mut Universe,
|
||||||
exec_state: &mut ExecState,
|
exec_state: &mut ExecState,
|
||||||
) -> Result<HashMap<PathBuf, crate::parsing::ast::types::Node<ImportStatement>>, KclError> {
|
) -> Result<UniverseMap, KclError> {
|
||||||
let modules = import_dependencies(repr, ctx)?;
|
let modules = import_dependencies(repr, ctx)?;
|
||||||
let mut module_imports = HashMap::new();
|
let mut module_imports = HashMap::new();
|
||||||
for (filename, import_stmt, module_path) in modules {
|
for (filename, import_stmt, module_path) in modules {
|
||||||
|
@ -9,4 +9,4 @@ pub use ast_node::Node;
|
|||||||
pub use ast_visitor::Visitable;
|
pub use ast_visitor::Visitable;
|
||||||
pub use ast_walk::walk;
|
pub use ast_walk::walk;
|
||||||
pub use import_graph::import_graph;
|
pub use import_graph::import_graph;
|
||||||
pub(crate) use import_graph::import_universe;
|
pub(crate) use import_graph::{import_universe, Universe, UniverseMap};
|
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -20,24 +20,6 @@ description: Result of parsing angled_line.kcl
|
|||||||
"init": {
|
"init": {
|
||||||
"body": [
|
"body": [
|
||||||
{
|
{
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"abs_path": false,
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "XY",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"path": [],
|
|
||||||
"start": 0,
|
|
||||||
"type": "Name",
|
|
||||||
"type": "Name"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
@ -56,8 +38,24 @@ description: Result of parsing angled_line.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": {
|
||||||
|
"abs_path": false,
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"name": {
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"name": "XY",
|
||||||
|
"start": 0,
|
||||||
|
"type": "Identifier"
|
||||||
|
},
|
||||||
|
"path": [],
|
||||||
|
"start": 0,
|
||||||
|
"type": "Name",
|
||||||
|
"type": "Name"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"arguments": [
|
"arguments": [
|
||||||
@ -385,24 +383,6 @@ description: Result of parsing angled_line.kcl
|
|||||||
"type": "Identifier"
|
"type": "Identifier"
|
||||||
},
|
},
|
||||||
"arg": {
|
"arg": {
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"abs_path": false,
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "seg01",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"path": [],
|
|
||||||
"start": 0,
|
|
||||||
"type": "Name",
|
|
||||||
"type": "Name"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
@ -421,8 +401,24 @@ description: Result of parsing angled_line.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": {
|
||||||
|
"abs_path": false,
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"name": {
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"name": "seg01",
|
||||||
|
"start": 0,
|
||||||
|
"type": "Identifier"
|
||||||
|
},
|
||||||
|
"path": [],
|
||||||
|
"start": 0,
|
||||||
|
"type": "Name",
|
||||||
|
"type": "Name"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -547,7 +543,6 @@ description: Result of parsing angled_line.kcl
|
|||||||
"unlabeled": null
|
"unlabeled": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"arguments": [],
|
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
@ -566,8 +561,9 @@ description: Result of parsing angled_line.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"arguments": [
|
"arguments": [
|
||||||
|
@ -4,8 +4,11 @@ description: Operations executed angled_line.kcl
|
|||||||
---
|
---
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"labeledArgs": {
|
"labeledArgs": {},
|
||||||
"planeOrSolid": {
|
"name": "startSketchOn",
|
||||||
|
"sourceRange": [],
|
||||||
|
"type": "StdLibCall",
|
||||||
|
"unlabeledArg": {
|
||||||
"value": {
|
"value": {
|
||||||
"type": "Plane",
|
"type": "Plane",
|
||||||
"artifact_id": "[uuid]"
|
"artifact_id": "[uuid]"
|
||||||
@ -13,11 +16,6 @@ description: Operations executed angled_line.kcl
|
|||||||
"sourceRange": []
|
"sourceRange": []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"name": "startSketchOn",
|
|
||||||
"sourceRange": [],
|
|
||||||
"type": "StdLibCall",
|
|
||||||
"unlabeledArg": null
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"labeledArgs": {
|
"labeledArgs": {
|
||||||
"length": {
|
"length": {
|
||||||
|
@ -84,24 +84,6 @@ description: Result of parsing array_elem_pop.kcl
|
|||||||
"type": "Identifier"
|
"type": "Identifier"
|
||||||
},
|
},
|
||||||
"init": {
|
"init": {
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"abs_path": false,
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "arr",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"path": [],
|
|
||||||
"start": 0,
|
|
||||||
"type": "Name",
|
|
||||||
"type": "Name"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
@ -120,8 +102,24 @@ description: Result of parsing array_elem_pop.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": {
|
||||||
|
"abs_path": false,
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"name": {
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"name": "arr",
|
||||||
|
"start": 0,
|
||||||
|
"type": "Identifier"
|
||||||
|
},
|
||||||
|
"path": [],
|
||||||
|
"start": 0,
|
||||||
|
"type": "Name",
|
||||||
|
"type": "Name"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "VariableDeclarator"
|
"type": "VariableDeclarator"
|
||||||
@ -145,24 +143,6 @@ description: Result of parsing array_elem_pop.kcl
|
|||||||
"type": "Identifier"
|
"type": "Identifier"
|
||||||
},
|
},
|
||||||
"init": {
|
"init": {
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"abs_path": false,
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "new_arr1",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"path": [],
|
|
||||||
"start": 0,
|
|
||||||
"type": "Name",
|
|
||||||
"type": "Name"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
@ -181,8 +161,24 @@ description: Result of parsing array_elem_pop.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": {
|
||||||
|
"abs_path": false,
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"name": {
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"name": "new_arr1",
|
||||||
|
"start": 0,
|
||||||
|
"type": "Identifier"
|
||||||
|
},
|
||||||
|
"path": [],
|
||||||
|
"start": 0,
|
||||||
|
"type": "Name",
|
||||||
|
"type": "Name"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "VariableDeclarator"
|
"type": "VariableDeclarator"
|
||||||
@ -206,24 +202,6 @@ description: Result of parsing array_elem_pop.kcl
|
|||||||
"type": "Identifier"
|
"type": "Identifier"
|
||||||
},
|
},
|
||||||
"init": {
|
"init": {
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"abs_path": false,
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "new_arr2",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"path": [],
|
|
||||||
"start": 0,
|
|
||||||
"type": "Name",
|
|
||||||
"type": "Name"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
@ -242,8 +220,24 @@ description: Result of parsing array_elem_pop.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": {
|
||||||
|
"abs_path": false,
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"name": {
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"name": "new_arr2",
|
||||||
|
"start": 0,
|
||||||
|
"type": "Identifier"
|
||||||
|
},
|
||||||
|
"path": [],
|
||||||
|
"start": 0,
|
||||||
|
"type": "Name",
|
||||||
|
"type": "Name"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "VariableDeclarator"
|
"type": "VariableDeclarator"
|
||||||
|
@ -47,24 +47,6 @@ description: Result of parsing array_elem_pop_empty_fail.kcl
|
|||||||
"type": "Identifier"
|
"type": "Identifier"
|
||||||
},
|
},
|
||||||
"init": {
|
"init": {
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"abs_path": false,
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "arr",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"path": [],
|
|
||||||
"start": 0,
|
|
||||||
"type": "Name",
|
|
||||||
"type": "Name"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
@ -83,8 +65,24 @@ description: Result of parsing array_elem_pop_empty_fail.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": {
|
||||||
|
"abs_path": false,
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"name": {
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"name": "arr",
|
||||||
|
"start": 0,
|
||||||
|
"type": "Identifier"
|
||||||
|
},
|
||||||
|
"path": [],
|
||||||
|
"start": 0,
|
||||||
|
"type": "Name",
|
||||||
|
"type": "Name"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "VariableDeclarator"
|
"type": "VariableDeclarator"
|
||||||
|
@ -84,24 +84,6 @@ description: Result of parsing array_elem_pop_fail.kcl
|
|||||||
"type": "Identifier"
|
"type": "Identifier"
|
||||||
},
|
},
|
||||||
"init": {
|
"init": {
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"abs_path": false,
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "arr",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"path": [],
|
|
||||||
"start": 0,
|
|
||||||
"type": "Name",
|
|
||||||
"type": "Name"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
@ -120,8 +102,24 @@ description: Result of parsing array_elem_pop_fail.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": {
|
||||||
|
"abs_path": false,
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"name": {
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"name": "arr",
|
||||||
|
"start": 0,
|
||||||
|
"type": "Identifier"
|
||||||
|
},
|
||||||
|
"path": [],
|
||||||
|
"start": 0,
|
||||||
|
"type": "Name",
|
||||||
|
"type": "Name"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "VariableDeclarator"
|
"type": "VariableDeclarator"
|
||||||
|
@ -20,24 +20,6 @@ description: Result of parsing artifact_graph_example_code1.kcl
|
|||||||
"init": {
|
"init": {
|
||||||
"body": [
|
"body": [
|
||||||
{
|
{
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"abs_path": false,
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "XY",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"path": [],
|
|
||||||
"start": 0,
|
|
||||||
"type": "Name",
|
|
||||||
"type": "Name"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
@ -56,8 +38,24 @@ description: Result of parsing artifact_graph_example_code1.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": {
|
||||||
|
"abs_path": false,
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"name": {
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"name": "XY",
|
||||||
|
"start": 0,
|
||||||
|
"type": "Identifier"
|
||||||
|
},
|
||||||
|
"path": [],
|
||||||
|
"start": 0,
|
||||||
|
"type": "Name",
|
||||||
|
"type": "Name"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"arguments": [
|
"arguments": [
|
||||||
@ -406,15 +404,6 @@ description: Result of parsing artifact_graph_example_code1.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"elements": [
|
"elements": [
|
||||||
{
|
{
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"start": 0,
|
|
||||||
"type": "PipeSubstitution",
|
|
||||||
"type": "PipeSubstitution"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
@ -433,19 +422,17 @@ description: Result of parsing artifact_graph_example_code1.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
},
|
"unlabeled": {
|
||||||
{
|
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "PipeSubstitution",
|
"type": "PipeSubstitution",
|
||||||
"type": "PipeSubstitution"
|
"type": "PipeSubstitution"
|
||||||
}
|
}
|
||||||
],
|
},
|
||||||
|
{
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
@ -464,8 +451,15 @@ description: Result of parsing artifact_graph_example_code1.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": {
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"start": 0,
|
||||||
|
"type": "PipeSubstitution",
|
||||||
|
"type": "PipeSubstitution"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"end": 0,
|
"end": 0,
|
||||||
@ -498,7 +492,6 @@ description: Result of parsing artifact_graph_example_code1.kcl
|
|||||||
"unlabeled": null
|
"unlabeled": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"arguments": [],
|
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
@ -517,8 +510,9 @@ description: Result of parsing artifact_graph_example_code1.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": null
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
@ -1041,15 +1035,6 @@ description: Result of parsing artifact_graph_example_code1.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"elements": [
|
"elements": [
|
||||||
{
|
{
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"start": 0,
|
|
||||||
"type": "PipeSubstitution",
|
|
||||||
"type": "PipeSubstitution"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
@ -1068,19 +1053,17 @@ description: Result of parsing artifact_graph_example_code1.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
},
|
"unlabeled": {
|
||||||
{
|
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "PipeSubstitution",
|
"type": "PipeSubstitution",
|
||||||
"type": "PipeSubstitution"
|
"type": "PipeSubstitution"
|
||||||
}
|
}
|
||||||
],
|
},
|
||||||
|
{
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
@ -1099,8 +1082,15 @@ description: Result of parsing artifact_graph_example_code1.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": {
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"start": 0,
|
||||||
|
"type": "PipeSubstitution",
|
||||||
|
"type": "PipeSubstitution"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"end": 0,
|
"end": 0,
|
||||||
@ -1133,7 +1123,6 @@ description: Result of parsing artifact_graph_example_code1.kcl
|
|||||||
"unlabeled": null
|
"unlabeled": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"arguments": [],
|
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
@ -1152,8 +1141,9 @@ description: Result of parsing artifact_graph_example_code1.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": null
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
|
@ -4,8 +4,11 @@ description: Operations executed artifact_graph_example_code1.kcl
|
|||||||
---
|
---
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"labeledArgs": {
|
"labeledArgs": {},
|
||||||
"planeOrSolid": {
|
"name": "startSketchOn",
|
||||||
|
"sourceRange": [],
|
||||||
|
"type": "StdLibCall",
|
||||||
|
"unlabeledArg": {
|
||||||
"value": {
|
"value": {
|
||||||
"type": "Plane",
|
"type": "Plane",
|
||||||
"artifact_id": "[uuid]"
|
"artifact_id": "[uuid]"
|
||||||
@ -13,11 +16,6 @@ description: Operations executed artifact_graph_example_code1.kcl
|
|||||||
"sourceRange": []
|
"sourceRange": []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"name": "startSketchOn",
|
|
||||||
"sourceRange": [],
|
|
||||||
"type": "StdLibCall",
|
|
||||||
"unlabeledArg": null
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"labeledArgs": {
|
"labeledArgs": {
|
||||||
"length": {
|
"length": {
|
||||||
|
@ -20,24 +20,6 @@ description: Result of parsing artifact_graph_example_code_no_3d.kcl
|
|||||||
"init": {
|
"init": {
|
||||||
"body": [
|
"body": [
|
||||||
{
|
{
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"abs_path": false,
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "YZ",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"path": [],
|
|
||||||
"start": 0,
|
|
||||||
"type": "Name",
|
|
||||||
"type": "Name"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
@ -56,8 +38,24 @@ description: Result of parsing artifact_graph_example_code_no_3d.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": {
|
||||||
|
"abs_path": false,
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"name": {
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"name": "YZ",
|
||||||
|
"start": 0,
|
||||||
|
"type": "Identifier"
|
||||||
|
},
|
||||||
|
"path": [],
|
||||||
|
"start": 0,
|
||||||
|
"type": "Name",
|
||||||
|
"type": "Name"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"arguments": [
|
"arguments": [
|
||||||
@ -229,24 +227,6 @@ description: Result of parsing artifact_graph_example_code_no_3d.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"left": {
|
"left": {
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"abs_path": false,
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "rectangleSegmentA001",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"path": [],
|
|
||||||
"start": 0,
|
|
||||||
"type": "Name",
|
|
||||||
"type": "Name"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
@ -265,8 +245,24 @@ description: Result of parsing artifact_graph_example_code_no_3d.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": {
|
||||||
|
"abs_path": false,
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"name": {
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"name": "rectangleSegmentA001",
|
||||||
|
"start": 0,
|
||||||
|
"type": "Identifier"
|
||||||
|
},
|
||||||
|
"path": [],
|
||||||
|
"start": 0,
|
||||||
|
"type": "Name",
|
||||||
|
"type": "Name"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"operator": "-",
|
"operator": "-",
|
||||||
"right": {
|
"right": {
|
||||||
@ -361,24 +357,6 @@ description: Result of parsing artifact_graph_example_code_no_3d.kcl
|
|||||||
"type": "Identifier"
|
"type": "Identifier"
|
||||||
},
|
},
|
||||||
"arg": {
|
"arg": {
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"abs_path": false,
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "rectangleSegmentA001",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"path": [],
|
|
||||||
"start": 0,
|
|
||||||
"type": "Name",
|
|
||||||
"type": "Name"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
@ -397,23 +375,9 @@ description: Result of parsing artifact_graph_example_code_no_3d.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
}
|
"unlabeled": {
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "LabeledArg",
|
|
||||||
"label": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "length",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"arg": {
|
|
||||||
"argument": {
|
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
@ -429,7 +393,19 @@ description: Result of parsing artifact_graph_example_code_no_3d.kcl
|
|||||||
"type": "Name",
|
"type": "Name",
|
||||||
"type": "Name"
|
"type": "Name"
|
||||||
}
|
}
|
||||||
],
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "LabeledArg",
|
||||||
|
"label": {
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"name": "length",
|
||||||
|
"start": 0,
|
||||||
|
"type": "Identifier"
|
||||||
|
},
|
||||||
|
"arg": {
|
||||||
|
"argument": {
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
@ -448,8 +424,24 @@ description: Result of parsing artifact_graph_example_code_no_3d.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": {
|
||||||
|
"abs_path": false,
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"name": {
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"name": "rectangleSegmentA001",
|
||||||
|
"start": 0,
|
||||||
|
"type": "Identifier"
|
||||||
|
},
|
||||||
|
"path": [],
|
||||||
|
"start": 0,
|
||||||
|
"type": "Name",
|
||||||
|
"type": "Name"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
@ -515,15 +507,6 @@ description: Result of parsing artifact_graph_example_code_no_3d.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"elements": [
|
"elements": [
|
||||||
{
|
{
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"start": 0,
|
|
||||||
"type": "PipeSubstitution",
|
|
||||||
"type": "PipeSubstitution"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
@ -542,19 +525,17 @@ description: Result of parsing artifact_graph_example_code_no_3d.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
},
|
"unlabeled": {
|
||||||
{
|
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "PipeSubstitution",
|
"type": "PipeSubstitution",
|
||||||
"type": "PipeSubstitution"
|
"type": "PipeSubstitution"
|
||||||
}
|
}
|
||||||
],
|
},
|
||||||
|
{
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
@ -573,8 +554,15 @@ description: Result of parsing artifact_graph_example_code_no_3d.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": {
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"start": 0,
|
||||||
|
"type": "PipeSubstitution",
|
||||||
|
"type": "PipeSubstitution"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"end": 0,
|
"end": 0,
|
||||||
@ -607,7 +595,6 @@ description: Result of parsing artifact_graph_example_code_no_3d.kcl
|
|||||||
"unlabeled": null
|
"unlabeled": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"arguments": [],
|
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
@ -626,8 +613,9 @@ description: Result of parsing artifact_graph_example_code_no_3d.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": null
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
@ -660,8 +648,27 @@ description: Result of parsing artifact_graph_example_code_no_3d.kcl
|
|||||||
"init": {
|
"init": {
|
||||||
"body": [
|
"body": [
|
||||||
{
|
{
|
||||||
"arguments": [
|
"callee": {
|
||||||
{
|
"abs_path": false,
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"name": {
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"name": "startSketchOn",
|
||||||
|
"start": 0,
|
||||||
|
"type": "Identifier"
|
||||||
|
},
|
||||||
|
"path": [],
|
||||||
|
"start": 0,
|
||||||
|
"type": "Name"
|
||||||
|
},
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"start": 0,
|
||||||
|
"type": "CallExpressionKw",
|
||||||
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": {
|
||||||
"argument": {
|
"argument": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
@ -685,27 +692,6 @@ description: Result of parsing artifact_graph_example_code_no_3d.kcl
|
|||||||
"type": "UnaryExpression",
|
"type": "UnaryExpression",
|
||||||
"type": "UnaryExpression"
|
"type": "UnaryExpression"
|
||||||
}
|
}
|
||||||
],
|
|
||||||
"callee": {
|
|
||||||
"abs_path": false,
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "startSketchOn",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"path": [],
|
|
||||||
"start": 0,
|
|
||||||
"type": "Name"
|
|
||||||
},
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"start": 0,
|
|
||||||
"type": "CallExpression",
|
|
||||||
"type": "CallExpression"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"arguments": [
|
"arguments": [
|
||||||
|
@ -4,8 +4,11 @@ description: Operations executed artifact_graph_example_code_no_3d.kcl
|
|||||||
---
|
---
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"labeledArgs": {
|
"labeledArgs": {},
|
||||||
"planeOrSolid": {
|
"name": "startSketchOn",
|
||||||
|
"sourceRange": [],
|
||||||
|
"type": "StdLibCall",
|
||||||
|
"unlabeledArg": {
|
||||||
"value": {
|
"value": {
|
||||||
"type": "Plane",
|
"type": "Plane",
|
||||||
"artifact_id": "[uuid]"
|
"artifact_id": "[uuid]"
|
||||||
@ -13,24 +16,17 @@ description: Operations executed artifact_graph_example_code_no_3d.kcl
|
|||||||
"sourceRange": []
|
"sourceRange": []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"name": "startSketchOn",
|
|
||||||
"sourceRange": [],
|
|
||||||
"type": "StdLibCall",
|
|
||||||
"unlabeledArg": null
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"labeledArgs": {
|
"labeledArgs": {},
|
||||||
"planeOrSolid": {
|
"name": "startSketchOn",
|
||||||
|
"sourceRange": [],
|
||||||
|
"type": "StdLibCall",
|
||||||
|
"unlabeledArg": {
|
||||||
"value": {
|
"value": {
|
||||||
"type": "Plane",
|
"type": "Plane",
|
||||||
"artifact_id": "[uuid]"
|
"artifact_id": "[uuid]"
|
||||||
},
|
},
|
||||||
"sourceRange": []
|
"sourceRange": []
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"name": "startSketchOn",
|
|
||||||
"sourceRange": [],
|
|
||||||
"type": "StdLibCall",
|
|
||||||
"unlabeledArg": null
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -277,24 +277,6 @@ description: Result of parsing artifact_graph_example_code_offset_planes.kcl
|
|||||||
"init": {
|
"init": {
|
||||||
"body": [
|
"body": [
|
||||||
{
|
{
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"abs_path": false,
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "offsetPlane001",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"path": [],
|
|
||||||
"start": 0,
|
|
||||||
"type": "Name",
|
|
||||||
"type": "Name"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
@ -313,8 +295,24 @@ description: Result of parsing artifact_graph_example_code_offset_planes.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": {
|
||||||
|
"abs_path": false,
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"name": {
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"name": "offsetPlane001",
|
||||||
|
"start": 0,
|
||||||
|
"type": "Identifier"
|
||||||
|
},
|
||||||
|
"path": [],
|
||||||
|
"start": 0,
|
||||||
|
"type": "Name",
|
||||||
|
"type": "Name"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"arguments": [
|
"arguments": [
|
||||||
|
@ -94,18 +94,16 @@ description: Operations executed artifact_graph_example_code_offset_planes.kcl
|
|||||||
"sourceRange": []
|
"sourceRange": []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"labeledArgs": {
|
"labeledArgs": {},
|
||||||
"planeOrSolid": {
|
"name": "startSketchOn",
|
||||||
|
"sourceRange": [],
|
||||||
|
"type": "StdLibCall",
|
||||||
|
"unlabeledArg": {
|
||||||
"value": {
|
"value": {
|
||||||
"type": "Plane",
|
"type": "Plane",
|
||||||
"artifact_id": "[uuid]"
|
"artifact_id": "[uuid]"
|
||||||
},
|
},
|
||||||
"sourceRange": []
|
"sourceRange": []
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"name": "startSketchOn",
|
|
||||||
"sourceRange": [],
|
|
||||||
"type": "StdLibCall",
|
|
||||||
"unlabeledArg": null
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -20,24 +20,6 @@ description: Result of parsing artifact_graph_sketch_on_face_etc.kcl
|
|||||||
"init": {
|
"init": {
|
||||||
"body": [
|
"body": [
|
||||||
{
|
{
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"abs_path": false,
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "XZ",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"path": [],
|
|
||||||
"start": 0,
|
|
||||||
"type": "Name",
|
|
||||||
"type": "Name"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
@ -56,8 +38,24 @@ description: Result of parsing artifact_graph_sketch_on_face_etc.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": {
|
||||||
|
"abs_path": false,
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"name": {
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"name": "XZ",
|
||||||
|
"start": 0,
|
||||||
|
"type": "Identifier"
|
||||||
|
},
|
||||||
|
"path": [],
|
||||||
|
"start": 0,
|
||||||
|
"type": "Name",
|
||||||
|
"type": "Name"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"arguments": [
|
"arguments": [
|
||||||
@ -304,15 +302,6 @@ description: Result of parsing artifact_graph_sketch_on_face_etc.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"elements": [
|
"elements": [
|
||||||
{
|
{
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"start": 0,
|
|
||||||
"type": "PipeSubstitution",
|
|
||||||
"type": "PipeSubstitution"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
@ -331,19 +320,17 @@ description: Result of parsing artifact_graph_sketch_on_face_etc.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
},
|
"unlabeled": {
|
||||||
{
|
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "PipeSubstitution",
|
"type": "PipeSubstitution",
|
||||||
"type": "PipeSubstitution"
|
"type": "PipeSubstitution"
|
||||||
}
|
}
|
||||||
],
|
},
|
||||||
|
{
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
@ -362,8 +349,15 @@ description: Result of parsing artifact_graph_sketch_on_face_etc.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": {
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"start": 0,
|
||||||
|
"type": "PipeSubstitution",
|
||||||
|
"type": "PipeSubstitution"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"end": 0,
|
"end": 0,
|
||||||
@ -396,7 +390,6 @@ description: Result of parsing artifact_graph_sketch_on_face_etc.kcl
|
|||||||
"unlabeled": null
|
"unlabeled": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"arguments": [],
|
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
@ -415,8 +408,9 @@ description: Result of parsing artifact_graph_sketch_on_face_etc.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": null
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
@ -832,15 +826,6 @@ description: Result of parsing artifact_graph_sketch_on_face_etc.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"elements": [
|
"elements": [
|
||||||
{
|
{
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"start": 0,
|
|
||||||
"type": "PipeSubstitution",
|
|
||||||
"type": "PipeSubstitution"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
@ -859,19 +844,17 @@ description: Result of parsing artifact_graph_sketch_on_face_etc.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
},
|
"unlabeled": {
|
||||||
{
|
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "PipeSubstitution",
|
"type": "PipeSubstitution",
|
||||||
"type": "PipeSubstitution"
|
"type": "PipeSubstitution"
|
||||||
}
|
}
|
||||||
],
|
},
|
||||||
|
{
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
@ -890,8 +873,15 @@ description: Result of parsing artifact_graph_sketch_on_face_etc.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": {
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"start": 0,
|
||||||
|
"type": "PipeSubstitution",
|
||||||
|
"type": "PipeSubstitution"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"end": 0,
|
"end": 0,
|
||||||
@ -924,7 +914,6 @@ description: Result of parsing artifact_graph_sketch_on_face_etc.kcl
|
|||||||
"unlabeled": null
|
"unlabeled": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"arguments": [],
|
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
@ -943,8 +932,9 @@ description: Result of parsing artifact_graph_sketch_on_face_etc.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": null
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
@ -1363,15 +1353,6 @@ description: Result of parsing artifact_graph_sketch_on_face_etc.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"elements": [
|
"elements": [
|
||||||
{
|
{
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"start": 0,
|
|
||||||
"type": "PipeSubstitution",
|
|
||||||
"type": "PipeSubstitution"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
@ -1390,19 +1371,17 @@ description: Result of parsing artifact_graph_sketch_on_face_etc.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
},
|
"unlabeled": {
|
||||||
{
|
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "PipeSubstitution",
|
"type": "PipeSubstitution",
|
||||||
"type": "PipeSubstitution"
|
"type": "PipeSubstitution"
|
||||||
}
|
}
|
||||||
],
|
},
|
||||||
|
{
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
@ -1421,8 +1400,15 @@ description: Result of parsing artifact_graph_sketch_on_face_etc.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": {
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"start": 0,
|
||||||
|
"type": "PipeSubstitution",
|
||||||
|
"type": "PipeSubstitution"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"end": 0,
|
"end": 0,
|
||||||
@ -1455,7 +1441,6 @@ description: Result of parsing artifact_graph_sketch_on_face_etc.kcl
|
|||||||
"unlabeled": null
|
"unlabeled": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"arguments": [],
|
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
@ -1474,8 +1459,9 @@ description: Result of parsing artifact_graph_sketch_on_face_etc.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": null
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
@ -1891,15 +1877,6 @@ description: Result of parsing artifact_graph_sketch_on_face_etc.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"elements": [
|
"elements": [
|
||||||
{
|
{
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"start": 0,
|
|
||||||
"type": "PipeSubstitution",
|
|
||||||
"type": "PipeSubstitution"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
@ -1918,19 +1895,17 @@ description: Result of parsing artifact_graph_sketch_on_face_etc.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
},
|
"unlabeled": {
|
||||||
{
|
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "PipeSubstitution",
|
"type": "PipeSubstitution",
|
||||||
"type": "PipeSubstitution"
|
"type": "PipeSubstitution"
|
||||||
}
|
}
|
||||||
],
|
},
|
||||||
|
{
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
@ -1949,8 +1924,15 @@ description: Result of parsing artifact_graph_sketch_on_face_etc.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": {
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"start": 0,
|
||||||
|
"type": "PipeSubstitution",
|
||||||
|
"type": "PipeSubstitution"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"end": 0,
|
"end": 0,
|
||||||
@ -1983,7 +1965,6 @@ description: Result of parsing artifact_graph_sketch_on_face_etc.kcl
|
|||||||
"unlabeled": null
|
"unlabeled": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"arguments": [],
|
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
@ -2002,8 +1983,9 @@ description: Result of parsing artifact_graph_sketch_on_face_etc.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": null
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
|
@ -4,8 +4,11 @@ description: Operations executed artifact_graph_sketch_on_face_etc.kcl
|
|||||||
---
|
---
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"labeledArgs": {
|
"labeledArgs": {},
|
||||||
"planeOrSolid": {
|
"name": "startSketchOn",
|
||||||
|
"sourceRange": [],
|
||||||
|
"type": "StdLibCall",
|
||||||
|
"unlabeledArg": {
|
||||||
"value": {
|
"value": {
|
||||||
"type": "Plane",
|
"type": "Plane",
|
||||||
"artifact_id": "[uuid]"
|
"artifact_id": "[uuid]"
|
||||||
@ -13,11 +16,6 @@ description: Operations executed artifact_graph_sketch_on_face_etc.kcl
|
|||||||
"sourceRange": []
|
"sourceRange": []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"name": "startSketchOn",
|
|
||||||
"sourceRange": [],
|
|
||||||
"type": "StdLibCall",
|
|
||||||
"unlabeledArg": null
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"labeledArgs": {
|
"labeledArgs": {
|
||||||
"length": {
|
"length": {
|
||||||
|
@ -1,27 +1,27 @@
|
|||||||
```mermaid
|
```mermaid
|
||||||
flowchart LR
|
flowchart LR
|
||||||
subgraph path3 [Path]
|
subgraph path3 [Path]
|
||||||
3["Path<br>[74, 114, 8]"]
|
3["Path<br>[74, 114, 1]"]
|
||||||
5["Segment<br>[120, 137, 8]"]
|
5["Segment<br>[120, 137, 1]"]
|
||||||
6["Segment<br>[143, 161, 8]"]
|
6["Segment<br>[143, 161, 1]"]
|
||||||
7["Segment<br>[167, 185, 8]"]
|
7["Segment<br>[167, 185, 1]"]
|
||||||
8["Segment<br>[191, 247, 8]"]
|
8["Segment<br>[191, 247, 1]"]
|
||||||
9["Segment<br>[253, 260, 8]"]
|
9["Segment<br>[253, 260, 1]"]
|
||||||
15[Solid2d]
|
15[Solid2d]
|
||||||
end
|
end
|
||||||
subgraph path4 [Path]
|
subgraph path4 [Path]
|
||||||
4["Path<br>[74, 112, 9]"]
|
4["Path<br>[74, 112, 2]"]
|
||||||
10["Segment<br>[118, 135, 9]"]
|
10["Segment<br>[118, 135, 2]"]
|
||||||
11["Segment<br>[141, 159, 9]"]
|
11["Segment<br>[141, 159, 2]"]
|
||||||
12["Segment<br>[165, 183, 9]"]
|
12["Segment<br>[165, 183, 2]"]
|
||||||
13["Segment<br>[189, 245, 9]"]
|
13["Segment<br>[189, 245, 2]"]
|
||||||
14["Segment<br>[251, 258, 9]"]
|
14["Segment<br>[251, 258, 2]"]
|
||||||
16[Solid2d]
|
16[Solid2d]
|
||||||
end
|
end
|
||||||
1["Plane<br>[47, 64, 8]"]
|
1["Plane<br>[47, 64, 1]"]
|
||||||
2["Plane<br>[47, 64, 9]"]
|
2["Plane<br>[47, 64, 2]"]
|
||||||
17["Sweep Extrusion<br>[266, 288, 8]"]
|
17["Sweep Extrusion<br>[266, 288, 1]"]
|
||||||
18["Sweep Extrusion<br>[264, 286, 9]"]
|
18["Sweep Extrusion<br>[264, 286, 2]"]
|
||||||
19[Wall]
|
19[Wall]
|
||||||
20[Wall]
|
20[Wall]
|
||||||
21[Wall]
|
21[Wall]
|
||||||
@ -66,44 +66,44 @@ flowchart LR
|
|||||||
4 --- 14
|
4 --- 14
|
||||||
4 --- 16
|
4 --- 16
|
||||||
4 ---- 18
|
4 ---- 18
|
||||||
5 --- 24
|
5 --- 25
|
||||||
5 x--> 27
|
5 x--> 28
|
||||||
5 --- 37
|
5 --- 36
|
||||||
5 --- 46
|
5 --- 43
|
||||||
6 --- 25
|
6 --- 24
|
||||||
6 x--> 27
|
6 x--> 28
|
||||||
6 --- 35
|
6 --- 37
|
||||||
6 --- 45
|
6 --- 45
|
||||||
7 --- 26
|
7 --- 23
|
||||||
7 x--> 27
|
7 x--> 28
|
||||||
7 --- 36
|
7 --- 35
|
||||||
7 --- 44
|
7 --- 44
|
||||||
8 --- 23
|
8 --- 26
|
||||||
8 x--> 27
|
8 x--> 28
|
||||||
8 --- 38
|
8 --- 38
|
||||||
8 --- 43
|
8 --- 46
|
||||||
10 --- 19
|
10 --- 19
|
||||||
10 x--> 28
|
10 x--> 27
|
||||||
10 --- 31
|
10 --- 31
|
||||||
10 --- 39
|
10 --- 40
|
||||||
11 --- 22
|
11 --- 22
|
||||||
11 x--> 28
|
11 x--> 27
|
||||||
11 --- 34
|
11 --- 33
|
||||||
11 --- 41
|
11 --- 41
|
||||||
12 --- 21
|
12 --- 21
|
||||||
12 x--> 28
|
12 x--> 27
|
||||||
12 --- 32
|
12 --- 32
|
||||||
12 --- 42
|
12 --- 39
|
||||||
13 --- 20
|
13 --- 20
|
||||||
13 x--> 28
|
13 x--> 27
|
||||||
13 --- 33
|
13 --- 34
|
||||||
13 --- 40
|
13 --- 42
|
||||||
17 --- 23
|
17 --- 23
|
||||||
17 --- 24
|
17 --- 24
|
||||||
17 --- 25
|
17 --- 25
|
||||||
17 --- 26
|
17 --- 26
|
||||||
17 --- 27
|
17 --- 28
|
||||||
17 --- 29
|
17 --- 30
|
||||||
17 --- 35
|
17 --- 35
|
||||||
17 --- 36
|
17 --- 36
|
||||||
17 --- 37
|
17 --- 37
|
||||||
@ -116,8 +116,8 @@ flowchart LR
|
|||||||
18 --- 20
|
18 --- 20
|
||||||
18 --- 21
|
18 --- 21
|
||||||
18 --- 22
|
18 --- 22
|
||||||
18 --- 28
|
18 --- 27
|
||||||
18 --- 30
|
18 --- 29
|
||||||
18 --- 31
|
18 --- 31
|
||||||
18 --- 32
|
18 --- 32
|
||||||
18 --- 33
|
18 --- 33
|
||||||
@ -127,35 +127,35 @@ flowchart LR
|
|||||||
18 --- 41
|
18 --- 41
|
||||||
18 --- 42
|
18 --- 42
|
||||||
31 <--x 19
|
31 <--x 19
|
||||||
39 <--x 19
|
|
||||||
40 <--x 19
|
40 <--x 19
|
||||||
33 <--x 20
|
42 <--x 19
|
||||||
40 <--x 20
|
34 <--x 20
|
||||||
|
39 <--x 20
|
||||||
42 <--x 20
|
42 <--x 20
|
||||||
32 <--x 21
|
32 <--x 21
|
||||||
|
39 <--x 21
|
||||||
41 <--x 21
|
41 <--x 21
|
||||||
42 <--x 21
|
33 <--x 22
|
||||||
34 <--x 22
|
40 <--x 22
|
||||||
39 <--x 22
|
|
||||||
41 <--x 22
|
41 <--x 22
|
||||||
38 <--x 23
|
35 <--x 23
|
||||||
43 <--x 23
|
|
||||||
44 <--x 23
|
44 <--x 23
|
||||||
|
45 <--x 23
|
||||||
37 <--x 24
|
37 <--x 24
|
||||||
43 <--x 24
|
43 <--x 24
|
||||||
46 <--x 24
|
45 <--x 24
|
||||||
35 <--x 25
|
36 <--x 25
|
||||||
45 <--x 25
|
43 <--x 25
|
||||||
46 <--x 25
|
46 <--x 25
|
||||||
36 <--x 26
|
38 <--x 26
|
||||||
44 <--x 26
|
44 <--x 26
|
||||||
45 <--x 26
|
46 <--x 26
|
||||||
35 <--x 29
|
31 <--x 29
|
||||||
36 <--x 29
|
32 <--x 29
|
||||||
37 <--x 29
|
33 <--x 29
|
||||||
38 <--x 29
|
34 <--x 29
|
||||||
31 <--x 30
|
35 <--x 30
|
||||||
32 <--x 30
|
36 <--x 30
|
||||||
33 <--x 30
|
37 <--x 30
|
||||||
34 <--x 30
|
38 <--x 30
|
||||||
```
|
```
|
||||||
|
@ -5,10 +5,10 @@ description: Variables in memory after executing assembly_mixed_units_cubes.kcl
|
|||||||
{
|
{
|
||||||
"cubeIn": {
|
"cubeIn": {
|
||||||
"type": "Module",
|
"type": "Module",
|
||||||
"value": 8
|
"value": 1
|
||||||
},
|
},
|
||||||
"cubeMm": {
|
"cubeMm": {
|
||||||
"type": "Module",
|
"type": "Module",
|
||||||
"value": 9
|
"value": 2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,21 +1,21 @@
|
|||||||
```mermaid
|
```mermaid
|
||||||
flowchart LR
|
flowchart LR
|
||||||
subgraph path3 [Path]
|
subgraph path3 [Path]
|
||||||
3["Path<br>[195, 230, 8]"]
|
3["Path<br>[195, 230, 1]"]
|
||||||
5["Segment<br>[195, 230, 8]"]
|
5["Segment<br>[195, 230, 1]"]
|
||||||
7[Solid2d]
|
|
||||||
end
|
|
||||||
subgraph path4 [Path]
|
|
||||||
4["Path<br>[111, 146, 10]"]
|
|
||||||
6["Segment<br>[111, 146, 10]"]
|
|
||||||
8[Solid2d]
|
8[Solid2d]
|
||||||
end
|
end
|
||||||
1["Plane<br>[172, 189, 8]"]
|
subgraph path4 [Path]
|
||||||
2["Plane<br>[88, 105, 10]"]
|
4["Path<br>[111, 146, 3]"]
|
||||||
|
6["Segment<br>[111, 146, 3]"]
|
||||||
|
7[Solid2d]
|
||||||
|
end
|
||||||
|
1["Plane<br>[172, 189, 1]"]
|
||||||
|
2["Plane<br>[88, 105, 3]"]
|
||||||
1 --- 3
|
1 --- 3
|
||||||
2 --- 4
|
2 --- 4
|
||||||
3 --- 5
|
3 --- 5
|
||||||
3 --- 7
|
3 --- 8
|
||||||
4 --- 6
|
4 --- 6
|
||||||
4 --- 8
|
4 --- 7
|
||||||
```
|
```
|
||||||
|
@ -5,10 +5,10 @@ description: Variables in memory after executing assembly_non_default_units.kcl
|
|||||||
{
|
{
|
||||||
"other1": {
|
"other1": {
|
||||||
"type": "Module",
|
"type": "Module",
|
||||||
"value": 8
|
"value": 1
|
||||||
},
|
},
|
||||||
"other2": {
|
"other2": {
|
||||||
"type": "Module",
|
"type": "Module",
|
||||||
"value": 10
|
"value": 3
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -162,24 +162,6 @@ description: Result of parsing bad_units_in_annotation.kcl
|
|||||||
"argument": {
|
"argument": {
|
||||||
"body": [
|
"body": [
|
||||||
{
|
{
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"abs_path": false,
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "XY",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"path": [],
|
|
||||||
"start": 0,
|
|
||||||
"type": "Name",
|
|
||||||
"type": "Name"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
@ -198,8 +180,24 @@ description: Result of parsing bad_units_in_annotation.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": {
|
||||||
|
"abs_path": false,
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"name": {
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"name": "XY",
|
||||||
|
"start": 0,
|
||||||
|
"type": "Identifier"
|
||||||
|
},
|
||||||
|
"path": [],
|
||||||
|
"start": 0,
|
||||||
|
"type": "Name",
|
||||||
|
"type": "Name"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"arguments": [
|
"arguments": [
|
||||||
@ -560,10 +558,48 @@ description: Result of parsing bad_units_in_annotation.kcl
|
|||||||
},
|
},
|
||||||
"operator": "*",
|
"operator": "*",
|
||||||
"right": {
|
"right": {
|
||||||
"arguments": [
|
"callee": {
|
||||||
{
|
"abs_path": false,
|
||||||
"arguments": [
|
"commentStart": 0,
|
||||||
{
|
"end": 0,
|
||||||
|
"name": {
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"name": "cos",
|
||||||
|
"start": 0,
|
||||||
|
"type": "Identifier"
|
||||||
|
},
|
||||||
|
"path": [],
|
||||||
|
"start": 0,
|
||||||
|
"type": "Name"
|
||||||
|
},
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"start": 0,
|
||||||
|
"type": "CallExpressionKw",
|
||||||
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": {
|
||||||
|
"callee": {
|
||||||
|
"abs_path": false,
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"name": {
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"name": "toRadians",
|
||||||
|
"start": 0,
|
||||||
|
"type": "Identifier"
|
||||||
|
},
|
||||||
|
"path": [],
|
||||||
|
"start": 0,
|
||||||
|
"type": "Name"
|
||||||
|
},
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"start": 0,
|
||||||
|
"type": "CallExpressionKw",
|
||||||
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": {
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"left": {
|
"left": {
|
||||||
@ -599,49 +635,7 @@ description: Result of parsing bad_units_in_annotation.kcl
|
|||||||
"type": "BinaryExpression",
|
"type": "BinaryExpression",
|
||||||
"type": "BinaryExpression"
|
"type": "BinaryExpression"
|
||||||
}
|
}
|
||||||
],
|
|
||||||
"callee": {
|
|
||||||
"abs_path": false,
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "toRadians",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"path": [],
|
|
||||||
"start": 0,
|
|
||||||
"type": "Name"
|
|
||||||
},
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"start": 0,
|
|
||||||
"type": "CallExpression",
|
|
||||||
"type": "CallExpression"
|
|
||||||
}
|
}
|
||||||
],
|
|
||||||
"callee": {
|
|
||||||
"abs_path": false,
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "cos",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"path": [],
|
|
||||||
"start": 0,
|
|
||||||
"type": "Name"
|
|
||||||
},
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"start": 0,
|
|
||||||
"type": "CallExpression",
|
|
||||||
"type": "CallExpression"
|
|
||||||
},
|
},
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "BinaryExpression",
|
"type": "BinaryExpression",
|
||||||
@ -694,10 +688,48 @@ description: Result of parsing bad_units_in_annotation.kcl
|
|||||||
},
|
},
|
||||||
"operator": "*",
|
"operator": "*",
|
||||||
"right": {
|
"right": {
|
||||||
"arguments": [
|
"callee": {
|
||||||
{
|
"abs_path": false,
|
||||||
"arguments": [
|
"commentStart": 0,
|
||||||
{
|
"end": 0,
|
||||||
|
"name": {
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"name": "sin",
|
||||||
|
"start": 0,
|
||||||
|
"type": "Identifier"
|
||||||
|
},
|
||||||
|
"path": [],
|
||||||
|
"start": 0,
|
||||||
|
"type": "Name"
|
||||||
|
},
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"start": 0,
|
||||||
|
"type": "CallExpressionKw",
|
||||||
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": {
|
||||||
|
"callee": {
|
||||||
|
"abs_path": false,
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"name": {
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"name": "toRadians",
|
||||||
|
"start": 0,
|
||||||
|
"type": "Identifier"
|
||||||
|
},
|
||||||
|
"path": [],
|
||||||
|
"start": 0,
|
||||||
|
"type": "Name"
|
||||||
|
},
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"start": 0,
|
||||||
|
"type": "CallExpressionKw",
|
||||||
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": {
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"left": {
|
"left": {
|
||||||
@ -733,49 +765,7 @@ description: Result of parsing bad_units_in_annotation.kcl
|
|||||||
"type": "BinaryExpression",
|
"type": "BinaryExpression",
|
||||||
"type": "BinaryExpression"
|
"type": "BinaryExpression"
|
||||||
}
|
}
|
||||||
],
|
|
||||||
"callee": {
|
|
||||||
"abs_path": false,
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "toRadians",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"path": [],
|
|
||||||
"start": 0,
|
|
||||||
"type": "Name"
|
|
||||||
},
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"start": 0,
|
|
||||||
"type": "CallExpression",
|
|
||||||
"type": "CallExpression"
|
|
||||||
}
|
}
|
||||||
],
|
|
||||||
"callee": {
|
|
||||||
"abs_path": false,
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "sin",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"path": [],
|
|
||||||
"start": 0,
|
|
||||||
"type": "Name"
|
|
||||||
},
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"start": 0,
|
|
||||||
"type": "CallExpression",
|
|
||||||
"type": "CallExpression"
|
|
||||||
},
|
},
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "BinaryExpression",
|
"type": "BinaryExpression",
|
||||||
|
@ -20,24 +20,6 @@ description: Result of parsing basic_fillet_cube_close_opposite.kcl
|
|||||||
"init": {
|
"init": {
|
||||||
"body": [
|
"body": [
|
||||||
{
|
{
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"abs_path": false,
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "XY",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"path": [],
|
|
||||||
"start": 0,
|
|
||||||
"type": "Name",
|
|
||||||
"type": "Name"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
@ -56,8 +38,24 @@ description: Result of parsing basic_fillet_cube_close_opposite.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": {
|
||||||
|
"abs_path": false,
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"name": {
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"name": "XY",
|
||||||
|
"start": 0,
|
||||||
|
"type": "Identifier"
|
||||||
|
},
|
||||||
|
"path": [],
|
||||||
|
"start": 0,
|
||||||
|
"type": "Name",
|
||||||
|
"type": "Name"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"arguments": [
|
"arguments": [
|
||||||
@ -518,24 +516,6 @@ description: Result of parsing basic_fillet_cube_close_opposite.kcl
|
|||||||
"type": "Name"
|
"type": "Name"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"abs_path": false,
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "thing3",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"path": [],
|
|
||||||
"start": 0,
|
|
||||||
"type": "Name",
|
|
||||||
"type": "Name"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
@ -554,8 +534,24 @@ description: Result of parsing basic_fillet_cube_close_opposite.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": {
|
||||||
|
"abs_path": false,
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"name": {
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"name": "thing3",
|
||||||
|
"start": 0,
|
||||||
|
"type": "Identifier"
|
||||||
|
},
|
||||||
|
"path": [],
|
||||||
|
"start": 0,
|
||||||
|
"type": "Name",
|
||||||
|
"type": "Name"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"end": 0,
|
"end": 0,
|
||||||
|
@ -4,8 +4,11 @@ description: Operations executed basic_fillet_cube_close_opposite.kcl
|
|||||||
---
|
---
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"labeledArgs": {
|
"labeledArgs": {},
|
||||||
"planeOrSolid": {
|
"name": "startSketchOn",
|
||||||
|
"sourceRange": [],
|
||||||
|
"type": "StdLibCall",
|
||||||
|
"unlabeledArg": {
|
||||||
"value": {
|
"value": {
|
||||||
"type": "Plane",
|
"type": "Plane",
|
||||||
"artifact_id": "[uuid]"
|
"artifact_id": "[uuid]"
|
||||||
@ -13,11 +16,6 @@ description: Operations executed basic_fillet_cube_close_opposite.kcl
|
|||||||
"sourceRange": []
|
"sourceRange": []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"name": "startSketchOn",
|
|
||||||
"sourceRange": [],
|
|
||||||
"type": "StdLibCall",
|
|
||||||
"unlabeledArg": null
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"labeledArgs": {
|
"labeledArgs": {
|
||||||
"length": {
|
"length": {
|
||||||
|
@ -20,24 +20,6 @@ description: Result of parsing basic_fillet_cube_end.kcl
|
|||||||
"init": {
|
"init": {
|
||||||
"body": [
|
"body": [
|
||||||
{
|
{
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"abs_path": false,
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "XY",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"path": [],
|
|
||||||
"start": 0,
|
|
||||||
"type": "Name",
|
|
||||||
"type": "Name"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
@ -56,8 +38,24 @@ description: Result of parsing basic_fillet_cube_end.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": {
|
||||||
|
"abs_path": false,
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"name": {
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"name": "XY",
|
||||||
|
"start": 0,
|
||||||
|
"type": "Identifier"
|
||||||
|
},
|
||||||
|
"path": [],
|
||||||
|
"start": 0,
|
||||||
|
"type": "Name",
|
||||||
|
"type": "Name"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"arguments": [
|
"arguments": [
|
||||||
@ -376,15 +374,6 @@ description: Result of parsing basic_fillet_cube_end.kcl
|
|||||||
"unlabeled": null
|
"unlabeled": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"start": 0,
|
|
||||||
"type": "PipeSubstitution",
|
|
||||||
"type": "PipeSubstitution"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
@ -403,8 +392,15 @@ description: Result of parsing basic_fillet_cube_end.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": {
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"start": 0,
|
||||||
|
"type": "PipeSubstitution",
|
||||||
|
"type": "PipeSubstitution"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"arguments": [
|
"arguments": [
|
||||||
@ -506,24 +502,6 @@ description: Result of parsing basic_fillet_cube_end.kcl
|
|||||||
"type": "Name"
|
"type": "Name"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"abs_path": false,
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "thing",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"path": [],
|
|
||||||
"start": 0,
|
|
||||||
"type": "Name",
|
|
||||||
"type": "Name"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
@ -542,8 +520,24 @@ description: Result of parsing basic_fillet_cube_end.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": {
|
||||||
|
"abs_path": false,
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"name": {
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"name": "thing",
|
||||||
|
"start": 0,
|
||||||
|
"type": "Identifier"
|
||||||
|
},
|
||||||
|
"path": [],
|
||||||
|
"start": 0,
|
||||||
|
"type": "Name",
|
||||||
|
"type": "Name"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"end": 0,
|
"end": 0,
|
||||||
|
@ -4,8 +4,11 @@ description: Operations executed basic_fillet_cube_end.kcl
|
|||||||
---
|
---
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"labeledArgs": {
|
"labeledArgs": {},
|
||||||
"planeOrSolid": {
|
"name": "startSketchOn",
|
||||||
|
"sourceRange": [],
|
||||||
|
"type": "StdLibCall",
|
||||||
|
"unlabeledArg": {
|
||||||
"value": {
|
"value": {
|
||||||
"type": "Plane",
|
"type": "Plane",
|
||||||
"artifact_id": "[uuid]"
|
"artifact_id": "[uuid]"
|
||||||
@ -13,11 +16,6 @@ description: Operations executed basic_fillet_cube_end.kcl
|
|||||||
"sourceRange": []
|
"sourceRange": []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"name": "startSketchOn",
|
|
||||||
"sourceRange": [],
|
|
||||||
"type": "StdLibCall",
|
|
||||||
"unlabeledArg": null
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"labeledArgs": {
|
"labeledArgs": {
|
||||||
"length": {
|
"length": {
|
||||||
|
@ -20,24 +20,6 @@ description: Result of parsing basic_fillet_cube_next_adjacent.kcl
|
|||||||
"init": {
|
"init": {
|
||||||
"body": [
|
"body": [
|
||||||
{
|
{
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"abs_path": false,
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "XY",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"path": [],
|
|
||||||
"start": 0,
|
|
||||||
"type": "Name",
|
|
||||||
"type": "Name"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
@ -56,8 +38,24 @@ description: Result of parsing basic_fillet_cube_next_adjacent.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": {
|
||||||
|
"abs_path": false,
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"name": {
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"name": "XY",
|
||||||
|
"start": 0,
|
||||||
|
"type": "Identifier"
|
||||||
|
},
|
||||||
|
"path": [],
|
||||||
|
"start": 0,
|
||||||
|
"type": "Name",
|
||||||
|
"type": "Name"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"arguments": [
|
"arguments": [
|
||||||
@ -520,24 +518,6 @@ description: Result of parsing basic_fillet_cube_next_adjacent.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"elements": [
|
"elements": [
|
||||||
{
|
{
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"abs_path": false,
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "thing3",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"path": [],
|
|
||||||
"start": 0,
|
|
||||||
"type": "Name",
|
|
||||||
"type": "Name"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
@ -556,8 +536,24 @@ description: Result of parsing basic_fillet_cube_next_adjacent.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": {
|
||||||
|
"abs_path": false,
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"name": {
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"name": "thing3",
|
||||||
|
"start": 0,
|
||||||
|
"type": "Identifier"
|
||||||
|
},
|
||||||
|
"path": [],
|
||||||
|
"start": 0,
|
||||||
|
"type": "Name",
|
||||||
|
"type": "Name"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"end": 0,
|
"end": 0,
|
||||||
|
@ -4,8 +4,11 @@ description: Operations executed basic_fillet_cube_next_adjacent.kcl
|
|||||||
---
|
---
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"labeledArgs": {
|
"labeledArgs": {},
|
||||||
"planeOrSolid": {
|
"name": "startSketchOn",
|
||||||
|
"sourceRange": [],
|
||||||
|
"type": "StdLibCall",
|
||||||
|
"unlabeledArg": {
|
||||||
"value": {
|
"value": {
|
||||||
"type": "Plane",
|
"type": "Plane",
|
||||||
"artifact_id": "[uuid]"
|
"artifact_id": "[uuid]"
|
||||||
@ -13,11 +16,6 @@ description: Operations executed basic_fillet_cube_next_adjacent.kcl
|
|||||||
"sourceRange": []
|
"sourceRange": []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"name": "startSketchOn",
|
|
||||||
"sourceRange": [],
|
|
||||||
"type": "StdLibCall",
|
|
||||||
"unlabeledArg": null
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"labeledArgs": {
|
"labeledArgs": {
|
||||||
"length": {
|
"length": {
|
||||||
|
@ -20,24 +20,6 @@ description: Result of parsing basic_fillet_cube_previous_adjacent.kcl
|
|||||||
"init": {
|
"init": {
|
||||||
"body": [
|
"body": [
|
||||||
{
|
{
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"abs_path": false,
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "XY",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"path": [],
|
|
||||||
"start": 0,
|
|
||||||
"type": "Name",
|
|
||||||
"type": "Name"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
@ -56,8 +38,24 @@ description: Result of parsing basic_fillet_cube_previous_adjacent.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": {
|
||||||
|
"abs_path": false,
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"name": {
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"name": "XY",
|
||||||
|
"start": 0,
|
||||||
|
"type": "Identifier"
|
||||||
|
},
|
||||||
|
"path": [],
|
||||||
|
"start": 0,
|
||||||
|
"type": "Name",
|
||||||
|
"type": "Name"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"arguments": [
|
"arguments": [
|
||||||
@ -520,24 +518,6 @@ description: Result of parsing basic_fillet_cube_previous_adjacent.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"elements": [
|
"elements": [
|
||||||
{
|
{
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"abs_path": false,
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "thing3",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"path": [],
|
|
||||||
"start": 0,
|
|
||||||
"type": "Name",
|
|
||||||
"type": "Name"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
@ -556,8 +536,24 @@ description: Result of parsing basic_fillet_cube_previous_adjacent.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": {
|
||||||
|
"abs_path": false,
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"name": {
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"name": "thing3",
|
||||||
|
"start": 0,
|
||||||
|
"type": "Identifier"
|
||||||
|
},
|
||||||
|
"path": [],
|
||||||
|
"start": 0,
|
||||||
|
"type": "Name",
|
||||||
|
"type": "Name"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"end": 0,
|
"end": 0,
|
||||||
|
@ -4,8 +4,11 @@ description: Operations executed basic_fillet_cube_previous_adjacent.kcl
|
|||||||
---
|
---
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"labeledArgs": {
|
"labeledArgs": {},
|
||||||
"planeOrSolid": {
|
"name": "startSketchOn",
|
||||||
|
"sourceRange": [],
|
||||||
|
"type": "StdLibCall",
|
||||||
|
"unlabeledArg": {
|
||||||
"value": {
|
"value": {
|
||||||
"type": "Plane",
|
"type": "Plane",
|
||||||
"artifact_id": "[uuid]"
|
"artifact_id": "[uuid]"
|
||||||
@ -13,11 +16,6 @@ description: Operations executed basic_fillet_cube_previous_adjacent.kcl
|
|||||||
"sourceRange": []
|
"sourceRange": []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"name": "startSketchOn",
|
|
||||||
"sourceRange": [],
|
|
||||||
"type": "StdLibCall",
|
|
||||||
"unlabeledArg": null
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"labeledArgs": {
|
"labeledArgs": {
|
||||||
"length": {
|
"length": {
|
||||||
|
@ -20,24 +20,6 @@ description: Result of parsing basic_fillet_cube_start.kcl
|
|||||||
"init": {
|
"init": {
|
||||||
"body": [
|
"body": [
|
||||||
{
|
{
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"abs_path": false,
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "XY",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"path": [],
|
|
||||||
"start": 0,
|
|
||||||
"type": "Name",
|
|
||||||
"type": "Name"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
@ -56,8 +38,24 @@ description: Result of parsing basic_fillet_cube_start.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": {
|
||||||
|
"abs_path": false,
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"name": {
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"name": "XY",
|
||||||
|
"start": 0,
|
||||||
|
"type": "Identifier"
|
||||||
|
},
|
||||||
|
"path": [],
|
||||||
|
"start": 0,
|
||||||
|
"type": "Name",
|
||||||
|
"type": "Name"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"arguments": [
|
"arguments": [
|
||||||
@ -376,15 +374,6 @@ description: Result of parsing basic_fillet_cube_start.kcl
|
|||||||
"unlabeled": null
|
"unlabeled": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"start": 0,
|
|
||||||
"type": "PipeSubstitution",
|
|
||||||
"type": "PipeSubstitution"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
@ -403,8 +392,15 @@ description: Result of parsing basic_fillet_cube_start.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": {
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"start": 0,
|
||||||
|
"type": "PipeSubstitution",
|
||||||
|
"type": "PipeSubstitution"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"arguments": [
|
"arguments": [
|
||||||
|
@ -4,8 +4,11 @@ description: Operations executed basic_fillet_cube_start.kcl
|
|||||||
---
|
---
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"labeledArgs": {
|
"labeledArgs": {},
|
||||||
"planeOrSolid": {
|
"name": "startSketchOn",
|
||||||
|
"sourceRange": [],
|
||||||
|
"type": "StdLibCall",
|
||||||
|
"unlabeledArg": {
|
||||||
"value": {
|
"value": {
|
||||||
"type": "Plane",
|
"type": "Plane",
|
||||||
"artifact_id": "[uuid]"
|
"artifact_id": "[uuid]"
|
||||||
@ -13,11 +16,6 @@ description: Operations executed basic_fillet_cube_start.kcl
|
|||||||
"sourceRange": []
|
"sourceRange": []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"name": "startSketchOn",
|
|
||||||
"sourceRange": [],
|
|
||||||
"type": "StdLibCall",
|
|
||||||
"unlabeledArg": null
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"labeledArgs": {
|
"labeledArgs": {
|
||||||
"length": {
|
"length": {
|
||||||
|
@ -1,432 +0,0 @@
|
|||||||
---
|
|
||||||
source: kcl-lib/src/simulation_tests.rs
|
|
||||||
description: Result of parsing big_number_angle_to_match_length_x.kcl
|
|
||||||
---
|
|
||||||
{
|
|
||||||
"Ok": {
|
|
||||||
"body": [
|
|
||||||
{
|
|
||||||
"commentStart": 0,
|
|
||||||
"declaration": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"id": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "part001",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"init": {
|
|
||||||
"body": [
|
|
||||||
{
|
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"raw": "'XY'",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Literal",
|
|
||||||
"type": "Literal",
|
|
||||||
"value": "XY"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
|
||||||
"abs_path": false,
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "startSketchOn",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"path": [],
|
|
||||||
"start": 0,
|
|
||||||
"type": "Name"
|
|
||||||
},
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"start": 0,
|
|
||||||
"type": "CallExpression",
|
|
||||||
"type": "CallExpression"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"type": "LabeledArg",
|
|
||||||
"label": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "at",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"arg": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"elements": [
|
|
||||||
{
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"raw": "0",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Literal",
|
|
||||||
"type": "Literal",
|
|
||||||
"value": {
|
|
||||||
"value": 0.0,
|
|
||||||
"suffix": "None"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"raw": "0",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Literal",
|
|
||||||
"type": "Literal",
|
|
||||||
"value": {
|
|
||||||
"value": 0.0,
|
|
||||||
"suffix": "None"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"end": 0,
|
|
||||||
"start": 0,
|
|
||||||
"type": "ArrayExpression",
|
|
||||||
"type": "ArrayExpression"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
|
||||||
"abs_path": false,
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "startProfile",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"path": [],
|
|
||||||
"start": 0,
|
|
||||||
"type": "Name"
|
|
||||||
},
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"start": 0,
|
|
||||||
"type": "CallExpressionKw",
|
|
||||||
"type": "CallExpressionKw",
|
|
||||||
"unlabeled": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"type": "LabeledArg",
|
|
||||||
"label": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "end",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"arg": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"elements": [
|
|
||||||
{
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"raw": "1",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Literal",
|
|
||||||
"type": "Literal",
|
|
||||||
"value": {
|
|
||||||
"value": 1.0,
|
|
||||||
"suffix": "None"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"raw": "3.82",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Literal",
|
|
||||||
"type": "Literal",
|
|
||||||
"value": {
|
|
||||||
"value": 3.82,
|
|
||||||
"suffix": "None"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"end": 0,
|
|
||||||
"start": 0,
|
|
||||||
"type": "ArrayExpression",
|
|
||||||
"type": "ArrayExpression"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "LabeledArg",
|
|
||||||
"label": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "tag",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"arg": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"start": 0,
|
|
||||||
"type": "TagDeclarator",
|
|
||||||
"type": "TagDeclarator",
|
|
||||||
"value": "seg01"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
|
||||||
"abs_path": false,
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "line",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"path": [],
|
|
||||||
"start": 0,
|
|
||||||
"type": "Name"
|
|
||||||
},
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"start": 0,
|
|
||||||
"type": "CallExpressionKw",
|
|
||||||
"type": "CallExpressionKw",
|
|
||||||
"unlabeled": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"type": "LabeledArg",
|
|
||||||
"label": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "angle",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"arg": {
|
|
||||||
"argument": {
|
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"abs_path": false,
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "seg01",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"path": [],
|
|
||||||
"start": 0,
|
|
||||||
"type": "Name",
|
|
||||||
"type": "Name"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"raw": "3",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Literal",
|
|
||||||
"type": "Literal",
|
|
||||||
"value": {
|
|
||||||
"value": 3.0,
|
|
||||||
"suffix": "None"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"start": 0,
|
|
||||||
"type": "PipeSubstitution",
|
|
||||||
"type": "PipeSubstitution"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
|
||||||
"abs_path": false,
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "angleToMatchLengthX",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"path": [],
|
|
||||||
"start": 0,
|
|
||||||
"type": "Name"
|
|
||||||
},
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"start": 0,
|
|
||||||
"type": "CallExpression",
|
|
||||||
"type": "CallExpression"
|
|
||||||
},
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"operator": "-",
|
|
||||||
"start": 0,
|
|
||||||
"type": "UnaryExpression",
|
|
||||||
"type": "UnaryExpression"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "LabeledArg",
|
|
||||||
"label": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "endAbsoluteX",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"arg": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"raw": "3",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Literal",
|
|
||||||
"type": "Literal",
|
|
||||||
"value": {
|
|
||||||
"value": 3.0,
|
|
||||||
"suffix": "None"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
|
||||||
"abs_path": false,
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "angledLine",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"path": [],
|
|
||||||
"start": 0,
|
|
||||||
"type": "Name"
|
|
||||||
},
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"start": 0,
|
|
||||||
"type": "CallExpressionKw",
|
|
||||||
"type": "CallExpressionKw",
|
|
||||||
"unlabeled": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"start": 0,
|
|
||||||
"type": "PipeSubstitution",
|
|
||||||
"type": "PipeSubstitution"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
|
||||||
"abs_path": false,
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "close",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"path": [],
|
|
||||||
"start": 0,
|
|
||||||
"type": "Name"
|
|
||||||
},
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"start": 0,
|
|
||||||
"type": "CallExpression",
|
|
||||||
"type": "CallExpression"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"type": "LabeledArg",
|
|
||||||
"label": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "length",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"arg": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"raw": "10",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Literal",
|
|
||||||
"type": "Literal",
|
|
||||||
"value": {
|
|
||||||
"value": 10.0,
|
|
||||||
"suffix": "None"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
|
||||||
"abs_path": false,
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "extrude",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"path": [],
|
|
||||||
"start": 0,
|
|
||||||
"type": "Name"
|
|
||||||
},
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"start": 0,
|
|
||||||
"type": "CallExpressionKw",
|
|
||||||
"type": "CallExpressionKw",
|
|
||||||
"unlabeled": null
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"start": 0,
|
|
||||||
"type": "PipeExpression",
|
|
||||||
"type": "PipeExpression"
|
|
||||||
},
|
|
||||||
"start": 0,
|
|
||||||
"type": "VariableDeclarator"
|
|
||||||
},
|
|
||||||
"end": 0,
|
|
||||||
"kind": "const",
|
|
||||||
"start": 0,
|
|
||||||
"type": "VariableDeclaration",
|
|
||||||
"type": "VariableDeclaration"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"start": 0
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,6 +0,0 @@
|
|||||||
part001 = startSketchOn(XY)
|
|
||||||
|> startProfile(at = [0, 0])
|
|
||||||
|> line(end = [1, 3.82], tag = $seg01)
|
|
||||||
|> angledLine(angle = -angleToMatchLengthX(seg01, 3, %), endAbsoluteX = 3)
|
|
||||||
|> close(%)
|
|
||||||
|> extrude(length = 10)
|
|
@ -1,10 +0,0 @@
|
|||||||
---
|
|
||||||
source: kcl-lib/src/simulation_tests.rs
|
|
||||||
description: Result of unparsing big_number_angle_to_match_length_x.kcl
|
|
||||||
---
|
|
||||||
part001 = startSketchOn(XY)
|
|
||||||
|> startProfile(at = [0, 0])
|
|
||||||
|> line(end = [1, 3.82], tag = $seg01)
|
|
||||||
|> angledLine(angle = -angleToMatchLengthX(seg01, 3, %), endAbsoluteX = 3)
|
|
||||||
|> close(%)
|
|
||||||
|> extrude(length = 10)
|
|
@ -1,432 +0,0 @@
|
|||||||
---
|
|
||||||
source: kcl-lib/src/simulation_tests.rs
|
|
||||||
description: Result of parsing big_number_angle_to_match_length_y.kcl
|
|
||||||
---
|
|
||||||
{
|
|
||||||
"Ok": {
|
|
||||||
"body": [
|
|
||||||
{
|
|
||||||
"commentStart": 0,
|
|
||||||
"declaration": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"id": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "part001",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"init": {
|
|
||||||
"body": [
|
|
||||||
{
|
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"raw": "'XY'",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Literal",
|
|
||||||
"type": "Literal",
|
|
||||||
"value": "XY"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
|
||||||
"abs_path": false,
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "startSketchOn",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"path": [],
|
|
||||||
"start": 0,
|
|
||||||
"type": "Name"
|
|
||||||
},
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"start": 0,
|
|
||||||
"type": "CallExpression",
|
|
||||||
"type": "CallExpression"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"type": "LabeledArg",
|
|
||||||
"label": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "at",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"arg": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"elements": [
|
|
||||||
{
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"raw": "0",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Literal",
|
|
||||||
"type": "Literal",
|
|
||||||
"value": {
|
|
||||||
"value": 0.0,
|
|
||||||
"suffix": "None"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"raw": "0",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Literal",
|
|
||||||
"type": "Literal",
|
|
||||||
"value": {
|
|
||||||
"value": 0.0,
|
|
||||||
"suffix": "None"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"end": 0,
|
|
||||||
"start": 0,
|
|
||||||
"type": "ArrayExpression",
|
|
||||||
"type": "ArrayExpression"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
|
||||||
"abs_path": false,
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "startProfile",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"path": [],
|
|
||||||
"start": 0,
|
|
||||||
"type": "Name"
|
|
||||||
},
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"start": 0,
|
|
||||||
"type": "CallExpressionKw",
|
|
||||||
"type": "CallExpressionKw",
|
|
||||||
"unlabeled": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"type": "LabeledArg",
|
|
||||||
"label": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "end",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"arg": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"elements": [
|
|
||||||
{
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"raw": "1",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Literal",
|
|
||||||
"type": "Literal",
|
|
||||||
"value": {
|
|
||||||
"value": 1.0,
|
|
||||||
"suffix": "None"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"raw": "3.82",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Literal",
|
|
||||||
"type": "Literal",
|
|
||||||
"value": {
|
|
||||||
"value": 3.82,
|
|
||||||
"suffix": "None"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"end": 0,
|
|
||||||
"start": 0,
|
|
||||||
"type": "ArrayExpression",
|
|
||||||
"type": "ArrayExpression"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "LabeledArg",
|
|
||||||
"label": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "tag",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"arg": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"start": 0,
|
|
||||||
"type": "TagDeclarator",
|
|
||||||
"type": "TagDeclarator",
|
|
||||||
"value": "seg01"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
|
||||||
"abs_path": false,
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "line",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"path": [],
|
|
||||||
"start": 0,
|
|
||||||
"type": "Name"
|
|
||||||
},
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"start": 0,
|
|
||||||
"type": "CallExpressionKw",
|
|
||||||
"type": "CallExpressionKw",
|
|
||||||
"unlabeled": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"type": "LabeledArg",
|
|
||||||
"label": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "angle",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"arg": {
|
|
||||||
"argument": {
|
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"abs_path": false,
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "seg01",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"path": [],
|
|
||||||
"start": 0,
|
|
||||||
"type": "Name",
|
|
||||||
"type": "Name"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"raw": "3",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Literal",
|
|
||||||
"type": "Literal",
|
|
||||||
"value": {
|
|
||||||
"value": 3.0,
|
|
||||||
"suffix": "None"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"start": 0,
|
|
||||||
"type": "PipeSubstitution",
|
|
||||||
"type": "PipeSubstitution"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
|
||||||
"abs_path": false,
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "angleToMatchLengthY",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"path": [],
|
|
||||||
"start": 0,
|
|
||||||
"type": "Name"
|
|
||||||
},
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"start": 0,
|
|
||||||
"type": "CallExpression",
|
|
||||||
"type": "CallExpression"
|
|
||||||
},
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"operator": "-",
|
|
||||||
"start": 0,
|
|
||||||
"type": "UnaryExpression",
|
|
||||||
"type": "UnaryExpression"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "LabeledArg",
|
|
||||||
"label": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "endAbsoluteX",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"arg": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"raw": "3",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Literal",
|
|
||||||
"type": "Literal",
|
|
||||||
"value": {
|
|
||||||
"value": 3.0,
|
|
||||||
"suffix": "None"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
|
||||||
"abs_path": false,
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "angledLine",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"path": [],
|
|
||||||
"start": 0,
|
|
||||||
"type": "Name"
|
|
||||||
},
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"start": 0,
|
|
||||||
"type": "CallExpressionKw",
|
|
||||||
"type": "CallExpressionKw",
|
|
||||||
"unlabeled": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"start": 0,
|
|
||||||
"type": "PipeSubstitution",
|
|
||||||
"type": "PipeSubstitution"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
|
||||||
"abs_path": false,
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "close",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"path": [],
|
|
||||||
"start": 0,
|
|
||||||
"type": "Name"
|
|
||||||
},
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"start": 0,
|
|
||||||
"type": "CallExpression",
|
|
||||||
"type": "CallExpression"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"type": "LabeledArg",
|
|
||||||
"label": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "length",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"arg": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"raw": "10",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Literal",
|
|
||||||
"type": "Literal",
|
|
||||||
"value": {
|
|
||||||
"value": 10.0,
|
|
||||||
"suffix": "None"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
|
||||||
"abs_path": false,
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "extrude",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"path": [],
|
|
||||||
"start": 0,
|
|
||||||
"type": "Name"
|
|
||||||
},
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"start": 0,
|
|
||||||
"type": "CallExpressionKw",
|
|
||||||
"type": "CallExpressionKw",
|
|
||||||
"unlabeled": null
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"start": 0,
|
|
||||||
"type": "PipeExpression",
|
|
||||||
"type": "PipeExpression"
|
|
||||||
},
|
|
||||||
"start": 0,
|
|
||||||
"type": "VariableDeclarator"
|
|
||||||
},
|
|
||||||
"end": 0,
|
|
||||||
"kind": "const",
|
|
||||||
"start": 0,
|
|
||||||
"type": "VariableDeclaration",
|
|
||||||
"type": "VariableDeclaration"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"start": 0
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,6 +0,0 @@
|
|||||||
part001 = startSketchOn(XY)
|
|
||||||
|> startProfile(at = [0, 0])
|
|
||||||
|> line(end = [1, 3.82], tag = $seg01)
|
|
||||||
|> angledLine(angle = -angleToMatchLengthY(seg01, 3, %), endAbsoluteX = 3)
|
|
||||||
|> close(%)
|
|
||||||
|> extrude(length = 10)
|
|
@ -1,10 +0,0 @@
|
|||||||
---
|
|
||||||
source: kcl-lib/src/simulation_tests.rs
|
|
||||||
description: Result of unparsing big_number_angle_to_match_length_y.kcl
|
|
||||||
---
|
|
||||||
part001 = startSketchOn(XY)
|
|
||||||
|> startProfile(at = [0, 0])
|
|
||||||
|> line(end = [1, 3.82], tag = $seg01)
|
|
||||||
|> angledLine(angle = -angleToMatchLengthY(seg01, 3, %), endAbsoluteX = 3)
|
|
||||||
|> close(%)
|
|
||||||
|> extrude(length = 10)
|
|
@ -20,24 +20,6 @@ description: Result of parsing circle_three_point.kcl
|
|||||||
"init": {
|
"init": {
|
||||||
"body": [
|
"body": [
|
||||||
{
|
{
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"abs_path": false,
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "XY",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"path": [],
|
|
||||||
"start": 0,
|
|
||||||
"type": "Name",
|
|
||||||
"type": "Name"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
@ -56,8 +38,24 @@ description: Result of parsing circle_three_point.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": {
|
||||||
|
"abs_path": false,
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"name": {
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"name": "XY",
|
||||||
|
"start": 0,
|
||||||
|
"type": "Identifier"
|
||||||
|
},
|
||||||
|
"path": [],
|
||||||
|
"start": 0,
|
||||||
|
"type": "Name",
|
||||||
|
"type": "Name"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"arguments": [
|
"arguments": [
|
||||||
|
@ -4,8 +4,11 @@ description: Operations executed circle_three_point.kcl
|
|||||||
---
|
---
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"labeledArgs": {
|
"labeledArgs": {},
|
||||||
"planeOrSolid": {
|
"name": "startSketchOn",
|
||||||
|
"sourceRange": [],
|
||||||
|
"type": "StdLibCall",
|
||||||
|
"unlabeledArg": {
|
||||||
"value": {
|
"value": {
|
||||||
"type": "Plane",
|
"type": "Plane",
|
||||||
"artifact_id": "[uuid]"
|
"artifact_id": "[uuid]"
|
||||||
@ -13,11 +16,6 @@ description: Operations executed circle_three_point.kcl
|
|||||||
"sourceRange": []
|
"sourceRange": []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"name": "startSketchOn",
|
|
||||||
"sourceRange": [],
|
|
||||||
"type": "StdLibCall",
|
|
||||||
"unlabeledArg": null
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"labeledArgs": {
|
"labeledArgs": {
|
||||||
"length": {
|
"length": {
|
||||||
|
@ -20,24 +20,6 @@ description: Result of parsing circular_pattern3d_a_pattern.kcl
|
|||||||
"init": {
|
"init": {
|
||||||
"body": [
|
"body": [
|
||||||
{
|
{
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"abs_path": false,
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": {
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"name": "XZ",
|
|
||||||
"start": 0,
|
|
||||||
"type": "Identifier"
|
|
||||||
},
|
|
||||||
"path": [],
|
|
||||||
"start": 0,
|
|
||||||
"type": "Name",
|
|
||||||
"type": "Name"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
@ -56,8 +38,24 @@ description: Result of parsing circular_pattern3d_a_pattern.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": {
|
||||||
|
"abs_path": false,
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"name": {
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"name": "XZ",
|
||||||
|
"start": 0,
|
||||||
|
"type": "Identifier"
|
||||||
|
},
|
||||||
|
"path": [],
|
||||||
|
"start": 0,
|
||||||
|
"type": "Name",
|
||||||
|
"type": "Name"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"arguments": [
|
"arguments": [
|
||||||
@ -340,15 +338,6 @@ description: Result of parsing circular_pattern3d_a_pattern.kcl
|
|||||||
"unlabeled": null
|
"unlabeled": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"arguments": [
|
|
||||||
{
|
|
||||||
"commentStart": 0,
|
|
||||||
"end": 0,
|
|
||||||
"start": 0,
|
|
||||||
"type": "PipeSubstitution",
|
|
||||||
"type": "PipeSubstitution"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"callee": {
|
"callee": {
|
||||||
"abs_path": false,
|
"abs_path": false,
|
||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
@ -367,8 +356,15 @@ description: Result of parsing circular_pattern3d_a_pattern.kcl
|
|||||||
"commentStart": 0,
|
"commentStart": 0,
|
||||||
"end": 0,
|
"end": 0,
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"type": "CallExpression",
|
"type": "CallExpressionKw",
|
||||||
"type": "CallExpression"
|
"type": "CallExpressionKw",
|
||||||
|
"unlabeled": {
|
||||||
|
"commentStart": 0,
|
||||||
|
"end": 0,
|
||||||
|
"start": 0,
|
||||||
|
"type": "PipeSubstitution",
|
||||||
|
"type": "PipeSubstitution"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"arguments": [
|
"arguments": [
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user