| 125 | } |
| 126 | |
| 127 | export interface NodeParseContext { |
| 128 | nodes: string[]; |
| 129 | nodeTypes: { [key: string]: string }; |
| 130 | nodeLineNumbers: { [key: string]: number }; |
| 131 | variableToNodeName: { [variable: string]: string }; |
| 132 | nodePullKeys: { [key: string]: { [key: string]: string } | null | 'empty' }; |
| 133 | nodePushKeys: { [key: string]: { [key: string]: string } | null | 'empty' }; |
| 134 | nodeAttributes: { [key: string]: { [key: string]: any } | null }; |
| 135 | subgraphParents?: { [key: string]: string }; |
| 136 | // build_func parameter info for nodes (new feature) |
| 137 | nodeBuildFuncs?: { [nodeName: string]: BuildFuncInfo }; |
| 138 | // Local NodeTemplate registry (for resolving template base kinds in declarative graphs) |
| 139 | templates?: { [name: string]: ParsedNodeTemplate }; |
| 140 | // Best-effort literal bindings for declarative graphs (e.g., sub_nodes = [...], sub_edges = [...]) |
| 141 | // Used to resolve identifier references inside nodes=[...] / edges=[...] literals. |
| 142 | literalValues?: { [name: string]: TSNode }; |
| 143 | // Local class inheritance graph for resolving Graph-vs-Loop custom classes. |
| 144 | localClassBases?: { [name: string]: string[] }; |
| 145 | // Best-effort resolver for template-like expressions beyond direct NodeTemplate(...), |
| 146 | // such as `.clone(...)` and factory functions returning NodeTemplate instances. |
| 147 | resolveTemplateAssignment?: ( |
| 148 | leftText: string, |
| 149 | callNode: TSNode, |
| 150 | code: string, |
| 151 | templates?: { [name: string]: ParsedNodeTemplate }, |
| 152 | literalValues?: { [name: string]: TSNode } |
| 153 | ) => ParsedNodeTemplate | null; |
| 154 | // Line offset for reparsed code (used in builder function parsing) |
| 155 | lineOffset?: number; |
| 156 | /** |
| 157 | * Parser feature flags (optional) for forward compatibility. |
| 158 | * New parsing behaviors should be guarded behind flags with safe defaults. |
| 159 | */ |
| 160 | features?: ParserFeatures; |
| 161 | } |
| 162 | |
| 163 | function getPositionalArgs(args: TSNode[]): TSNode[] { |
| 164 | return args.filter(arg => arg.type !== 'keyword_argument' && arg.type !== 'comment'); |
nothing calls this directly
no outgoing calls
no test coverage detected