Fix default memory so its always initialized in one place -> rust (#1395)
* initial redo Signed-off-by: Jess Frazelle <github@jessfraz.com> * default memory Signed-off-by: Jess Frazelle <github@jessfraz.com> * rename values * find tricky case * fix test Signed-off-by: Jess Frazelle <github@jessfraz.com> --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch>
This commit is contained in:
@ -42,6 +42,7 @@ import {
|
||||
PipeExpression,
|
||||
Program,
|
||||
ProgramMemory,
|
||||
programMemoryInit,
|
||||
recast,
|
||||
SketchGroup,
|
||||
VariableDeclaration,
|
||||
@ -49,7 +50,7 @@ import {
|
||||
} from 'lang/wasm'
|
||||
import { kclManager } from 'lang/KclSingleton'
|
||||
import { getNodeFromPath, getNodePathFromSourceRange } from 'lang/queryAst'
|
||||
import { defaultProgramMemory, executeAst } from 'useStore'
|
||||
import { executeAst } from 'useStore'
|
||||
import { engineCommandManager } from 'lang/std/engineConnection'
|
||||
import {
|
||||
createArcGeometry,
|
||||
@ -869,10 +870,7 @@ function prepareTruncatedMemoryAndAst(
|
||||
..._ast,
|
||||
body: [JSON.parse(JSON.stringify(_ast.body[bodyIndex]))],
|
||||
}
|
||||
const programMemoryOverride: ProgramMemory = {
|
||||
root: defaultProgramMemory(),
|
||||
return: null,
|
||||
}
|
||||
const programMemoryOverride: ProgramMemory = programMemoryInit()
|
||||
for (let i = 0; i < bodyIndex; i++) {
|
||||
const node = _ast.body[i]
|
||||
if (node.type !== 'VariableDeclaration') {
|
||||
|
Reference in New Issue
Block a user