MCPcopy Create free account
hub / github.com/BUPT-GAMMA/MASFactory / getKeywordArgMap

Function getKeywordArgMap

masfactory-visualizer/src/parser/nodeParser.ts:167–181  ·  view source on GitHub ↗
(
    args: TSNode[],
    code: string
)

Source from the content-addressed store, hash-verified

165}
166
167function getKeywordArgMap(
168 args: TSNode[],
169 code: string
170): Map<string, TSNode> {
171 const map = new Map<string, TSNode>();
172 for (const arg of args) {
173 if (arg.type !== 'keyword_argument') {continue;}
174 const argNameNode = arg.childForFieldName('name');
175 const argValueNode = arg.childForFieldName('value');
176 if (!argNameNode || !argValueNode) {continue;}
177 const argName = getNodeText(argNameNode, code);
178 map.set(argName, argValueNode);
179 }
180 return map;
181}
182
183function getExpandedDictNode(
184 arg: TSNode,

Callers 1

Calls 1

getNodeTextFunction · 0.90

Tested by

no test coverage detected