| 113 | ErrorType parse(nbind::Buffer chunk); |
| 114 | |
| 115 | void setCodeBuffer(nbind::Buffer tokenBuffer, nbind::cbFunction &flushTokens) { |
| 116 | this->flushTokens = std::unique_ptr<nbind::cbFunction>(new nbind::cbFunction(flushTokens)); |
| 117 | this->tokenBuffer = tokenBuffer; |
| 118 | |
| 119 | tokenList = reinterpret_cast<uint32_t *>(tokenBuffer.data()); |
| 120 | tokenBufferEnd = tokenList + tokenBuffer.length() / 4; |
| 121 | |
| 122 | flushTokens.reset(); |
| 123 | } |
| 124 | |
| 125 | inline void flush(uint32_t *&tokenPtr) { |
| 126 | (*flushTokens)(); |