tag as top level part 2 (#2773)

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fmt

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* unit tests pass

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* playwright

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* format

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* format

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* more literals gone

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fixes

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* remove console log

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fixes

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* remove only

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix some recast shit

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* last

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
Jess Frazelle
2024-06-24 22:39:04 -07:00
committed by GitHub
parent ad5bfa1a29
commit da6cd5cf9f
44 changed files with 720 additions and 536 deletions

View File

@ -19,6 +19,7 @@ import {
createPipeSubstitution,
} from './modifyAst'
import { err } from 'lib/trap'
import { warn } from 'node:console'
beforeAll(async () => {
await initPromise
@ -412,15 +413,15 @@ describe('Testing findUsesOfTagInPipe', () => {
const exampleCode = `const part001 = startSketchOn('-XZ')
|> startProfileAt([68.12, 156.65], %)
|> line([306.21, 198.82], %)
|> line([306.21, 198.85], %, 'seg01')
|> angledLine([-65, segLen('seg01', %)], %)
|> line([306.21, 198.85], %, $seg01)
|> angledLine([-65, segLen(seg01, %)], %)
|> line([306.21, 198.87], %)
|> angledLine([65, segLen('seg01', %)], %)`
|> angledLine([65, segLen(seg01, %)], %)`
it('finds the current segment', async () => {
const ast = parse(exampleCode)
if (err(ast)) throw ast
const lineOfInterest = `198.85], %, 'seg01'`
const lineOfInterest = `198.85], %, $seg01`
const characterIndex =
exampleCode.indexOf(lineOfInterest) + lineOfInterest.length
const pathToNode = getNodePathFromSourceRange(ast, [
@ -455,7 +456,7 @@ describe('Testing hasSketchPipeBeenExtruded', () => {
|> line([2.48, 2.44], %)
|> line([2.66, 1.17], %)
|> line([3.75, 0.46], %)
|> line([4.99, -0.46], %, 'seg01')
|> line([4.99, -0.46], %, $seg01)
|> line([3.3, -2.12], %)
|> line([2.16, -3.33], %)
|> line([0.85, -3.08], %)
@ -464,7 +465,7 @@ describe('Testing hasSketchPipeBeenExtruded', () => {
|> line([-17.67, 0.85], %)
|> close(%)
const extrude001 = extrude(10, sketch001)
const sketch002 = startSketchOn(extrude001, 'seg01')
const sketch002 = startSketchOn(extrude001, $seg01)
|> startProfileAt([-12.94, 6.6], %)
|> line([2.45, -0.2], %)
|> line([-2, -1.25], %)
@ -474,7 +475,7 @@ const sketch002 = startSketchOn(extrude001, 'seg01')
it('finds sketch001 pipe to be extruded', async () => {
const ast = parse(exampleCode)
if (err(ast)) throw ast
const lineOfInterest = `line([4.99, -0.46], %, 'seg01')`
const lineOfInterest = `line([4.99, -0.46], %, $seg01)`
const characterIndex =
exampleCode.indexOf(lineOfInterest) + lineOfInterest.length
const extruded = hasSketchPipeBeenExtruded(
@ -512,7 +513,7 @@ describe('Testing hasExtrudableGeometry', () => {
|> line([-17.67, 0.85], %)
|> close(%)
const extrude001 = extrude(10, sketch001)
const sketch002 = startSketchOn(extrude001, 'seg01')
const sketch002 = startSketchOn(extrude001, $seg01)
|> startProfileAt([-12.94, 6.6], %)
|> line([2.45, -0.2], %)
|> line([-2, -1.25], %)