functional sketch working (#26)
* functional sketch working With old sketch block still there * get all version of lines working with add line and update line * remove old ui state types * some clean up * rename some things * add todo for multi cursor * shorten useStore repitition * small type improvement * big overhaul to group sketch function and they ast modifying helpers together * unneeded tweak * ruthlessly rip out sketch logic * clean up path keyword * getting sketch on face working again with all the new sketch line types * add a bunch of tests and re-arrage file structure
This commit is contained in:
@ -5,14 +5,13 @@ import { abstractSyntaxTree, getNodeFromPath } from './abstractSyntaxTree'
|
||||
describe('testing getNodePathFromSourceRange', () => {
|
||||
it('test it gets the right path for a `lineTo` CallExpression within a SketchExpression', () => {
|
||||
const code = `
|
||||
const myVar = 5
|
||||
sketch sk3 {
|
||||
lineTo(1, 2)
|
||||
path yo = lineTo(3, 4)
|
||||
close()
|
||||
}
|
||||
`
|
||||
const subStr = 'lineTo(3, 4)'
|
||||
const myVar = 5
|
||||
const sk3 = startSketchAt([0, 0])
|
||||
|> lineTo([1, 2], %)
|
||||
|> lineTo({ to: [3, 4], tag: 'yo' }, %)
|
||||
|> close(%)
|
||||
`
|
||||
const subStr = "lineTo({ to: [3, 4], tag: 'yo' }, %)"
|
||||
const lineToSubstringIndex = code.indexOf(subStr)
|
||||
const sourceRange: [number, number] = [
|
||||
lineToSubstringIndex,
|
||||
|
Reference in New Issue
Block a user