MCPcopy Create free account
hub / github.com/ceifa/wasmoon / parseNamedSymbol

Function parseNamedSymbol

utils/create-bindings.js:112–129  ·  view source on GitHub ↗
(symbol)

Source from the content-addressed store, hash-verified

110}
111
112function parseNamedSymbol(symbol) {
113 const isPointer = symbol.includes('*')
114
115 const [type, name] = symbol
116 .replaceAll('const', '')
117 .replaceAll('unsigned', '')
118 .replaceAll('*', '')
119 .split(' ')
120 .map((val) => val.trim())
121 .filter((val) => !!val)
122 if (functionPointerTypes.includes(type)) {
123 return { type: 'void*', name }
124 }
125 const saneType = isPointer ? `${type}*` : type
126 types.push(saneType)
127
128 return { type: saneType, name }
129}
130
131function parseLine(line) {
132 const argStart = line.lastIndexOf('(')

Callers 1

parseLineFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected