| 110 | } |
| 111 | |
| 112 | function 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 | |
| 131 | function parseLine(line) { |
| 132 | const argStart = line.lastIndexOf('(') |