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

Function parseLine

utils/create-bindings.js:131–144  ·  view source on GitHub ↗
(line)

Source from the content-addressed store, hash-verified

129}
130
131function parseLine(line) {
132 const argStart = line.lastIndexOf('(')
133 if (argStart < 0) {
134 console.warn('Cannot find parameters on line', line)
135 return undefined
136 }
137 const starter = line.substring(0, argStart)
138 const retPlusSymbol = starter.substring(line.indexOf(' ')).replaceAll('(', ' ').replaceAll(')', '')
139 const rawArgs = line.substring(argStart).substring(1).split(')')[0].split(',')
140 return {
141 definition: parseNamedSymbol(retPlusSymbol),
142 args: rawArgs.map((arg) => parseNamedSymbol(arg)).filter((arg) => arg.type !== 'void'),
143 }
144}
145
146rl.on('line', (file) => {
147 const rawFile = fs.readFileSync(file).toString()

Callers 1

create-bindings.jsFile · 0.85

Calls 1

parseNamedSymbolFunction · 0.85

Tested by

no test coverage detected