tree-sitter/spec/runtime/helpers/spy_debugger.cc
Max Brunsfeld ebd60213d9 Drop release functions from callback structs
The caller can just as easily take care of the cleanup explicitly
2015-09-08 23:24:33 -07:00

22 lines
481 B
C++

#include "runtime/helpers/spy_debugger.h"
#include <string>
#include <vector>
using std::string;
using std::vector;
static void spy_debug(void *data, TSDebugType type, const char *msg) {
SpyDebugger *debugger = static_cast<SpyDebugger *>(data);
debugger->messages.push_back(msg);
}
TSDebugger SpyDebugger::debugger() {
TSDebugger result;
result.payload = (void *)this;
result.debug_fn = spy_debug;
return result;
}
void SpyDebugger::clear() {
messages.clear();
}