@@ -25,7 +25,7 @@ export interface ValidationResult {
2525 code : number
2626 severity : "error" | "warning"
2727 nodeId ?: NodeFunction [ "id" ]
28- parameterIndex ?: number
28+ parameterIndex ?: number | null
2929 } > ;
3030}
3131
@@ -142,7 +142,7 @@ export function generateFlowSourceCode(
142142 return isForInference ? `/* @pos ${ nodeId } ${ paramIdx } */ ({} as any)` : `/* @pos ${ nodeId } ${ paramIdx } */ undefined` ;
143143 } ) . join ( ", " ) ;
144144
145- const funcName = `fn_${ node . functionDefinition . identifier . replace ( / : : / g, '_' ) } ` ;
145+ const funcName = `/* @pos ${ nodeId } null */ fn_${ node . functionDefinition . identifier . replace ( / : : / g, '_' ) } ` ;
146146 const call = `${ funcName } (${ args } )` ;
147147 // Add position comment only for nested calls (when called from within an argument)
148148 if ( parentNodeId !== undefined && parentParamIndex !== undefined ) {
@@ -214,7 +214,7 @@ export function generateFlowSourceCode(
214214 const funcName = `fn_${ node ?. functionDefinition ?. identifier ?. replace ( / : : / g, '_' ) } ` ;
215215 const needsAnyCast = args . includes ( "undefined" ) ;
216216 const isReturnNode = node . functionDefinition . identifier === "std::control::return" ;
217- let code = `${ indent } ${ isReturnNode ? "return " : `const ${ varName } = ` } ${ funcName } (${ args } )${ needsAnyCast ? "" : "" } ;\n` ;
217+ let code = `${ indent } ${ isReturnNode ? "return " : `const ${ varName } = ` } /* @pos ${ nodeId } null */ ${ funcName } (${ args } )${ needsAnyCast ? "" : "" } ;\n` ;
218218 if ( node . nextNodeId ) code += generateNodeCode ( node . nextNodeId , indent ) ;
219219 return code ;
220220 } ;
@@ -229,7 +229,7 @@ export function generateFlowSourceCode(
229229 if ( p ?. value ?. __typename === "NodeFunctionIdWrapper" && p . value . id ) subTreeIds . add ( p . value . id ) ;
230230 } ) ) ;
231231
232- const flowCode = flow ? `const flow_${ sanitizeId ( flow . id ?? "" ) } = flow(${ flow . settings ?. nodes ?. map ( ( setting , index ) => `/* @pos undefined ${ index } */ ${ stringify ( setting ?. value ) } ` ) . join ( ", " ) ?? "" } );` : ""
232+ const flowCode = flow ? `const flow_${ sanitizeId ( flow . id ?? "" ) } = /* @pos null null */ flow(${ flow . settings ?. nodes ?. map ( ( setting , index ) => `/* @pos null ${ index } */ ${ stringify ( setting ?. value ) } ` ) . join ( ", " ) ?? "" } );` : ""
233233
234234 const executionCode = nodes
235235 . filter ( n => n ?. id && ! nextNodeIds . has ( n . id ) && ! subTreeIds . has ( n . id ) )
0 commit comments