MCPcopy Create free account
hub / github.com/d1ll0n/stack-packer / parseContract

Function parseContract

src/parser/parser.ts:148–161  ·  view source on GitHub ↗
(contractNode: ContractDefinition)

Source from the content-addressed store, hash-verified

146export { parseSubNode }
147
148export function parseContract(contractNode: ContractDefinition): DefinedType[] {
149 let structs = [];
150 const { subNodes, name } = contractNode;
151 for (let subNode of subNodes) {
152 const node = subNode as StructDefinition | EnumDefinition;
153 try {
154 const parsed = parseSubNode(name, node, /* false */);
155 if (parsed) structs.push(parsed);
156 } catch(err) {
157 console.log(`Failed to parse subNode ${node.name} in ${name}: \n\t${err.message}`)
158 }
159 }
160 return structs;
161}
162
163const isSupportedNode = (x: ASTNode): x is SubNodeType => {
164 return SubNodeTypeStrings.includes(x.type);

Callers

nothing calls this directly

Calls 1

parseSubNodeFunction · 0.85

Tested by

no test coverage detected