tree-sitter/spec/runtime/helpers/log_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

20 lines
432 B
C++

#include "tree_sitter/runtime.h"
#include <stdio.h>
static void log_debug(void *data, TSDebugType type, const char *msg) {
switch (type) {
case TSDebugTypeParse:
fprintf(stderr, "* %s\n", msg);
break;
case TSDebugTypeLex:
fprintf(stderr, " %s\n", msg);
break;
}
}
TSDebugger log_debugger_make() {
TSDebugger result;
result.payload = NULL;
result.debug_fn = log_debug;
return result;
}