fmt
This commit is contained in:
@ -108,7 +108,11 @@ export const executor = (
|
|||||||
return _programMemory.root[arg.name]
|
return _programMemory.root[arg.name]
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
if ('lineTo' === functionName || 'close' === functionName || 'base' === functionName) {
|
if (
|
||||||
|
'lineTo' === functionName ||
|
||||||
|
'close' === functionName ||
|
||||||
|
'base' === functionName
|
||||||
|
) {
|
||||||
if (options.bodyType !== 'sketch') {
|
if (options.bodyType !== 'sketch') {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`Cannot call ${functionName} outside of a sketch declaration`
|
`Cannot call ${functionName} outside of a sketch declaration`
|
||||||
|
@ -50,8 +50,7 @@ log(5, myVar)`
|
|||||||
expect(recasted).toBe(code.trim())
|
expect(recasted).toBe(code.trim())
|
||||||
})
|
})
|
||||||
it('function declaration with call', () => {
|
it('function declaration with call', () => {
|
||||||
const code =
|
const code = [
|
||||||
[
|
|
||||||
'fn funcN = (a, b) => {',
|
'fn funcN = (a, b) => {',
|
||||||
' return a + b',
|
' return a + b',
|
||||||
'}',
|
'}',
|
||||||
|
@ -92,7 +92,8 @@ function getCoordsFromPaths(paths: Path[], index = 0): Coords2d {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const sketchFns = {
|
export const sketchFns = {
|
||||||
base: (programMemory: ProgramMemory,
|
base: (
|
||||||
|
programMemory: ProgramMemory,
|
||||||
name: string = '',
|
name: string = '',
|
||||||
sourceRange: SourceRange,
|
sourceRange: SourceRange,
|
||||||
...args: any[]
|
...args: any[]
|
||||||
|
@ -299,7 +299,6 @@ describe('testing lexer', () => {
|
|||||||
"whitespace ' ' from 6 to 7",
|
"whitespace ' ' from 6 to 7",
|
||||||
"number '2.5' from 7 to 10",
|
"number '2.5' from 7 to 10",
|
||||||
])
|
])
|
||||||
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user