parser.c - make LOG_LOKAHEAD simpler according to disscussion in PR
ts_parser__log(self); \
}
-#define LOG_LOOKAHEAD(symbol_name, size, ...) \
+#define LOG_LOOKAHEAD(symbol_name, size) \
if (self->lexer.logger.log || self->dot_graph_file) { \
char *buf = self->lexer.debug_buffer; \
const char *symbol = symbol_name; \
default: buf[off++] = symbol[i]; break; \
} \
} \
- off += snprintf( \
+ snprintf( \
buf + off, \
TREE_SITTER_SERIALIZATION_BUFFER_SIZE - off, \
", size:%u", \
size \
); \
- if (sizeof( (char[]){#__VA_ARGS__} ) == 1) \
- snprintf( \
- buf + off, \
- TREE_SITTER_SERIALIZATION_BUFFER_SIZE - off, \
- ", " __VA_ARGS__ \
- ); \
ts_parser__log(self); \
}
@@ -514,9 +508,7 @@ static Subtree ts_parser__lex(
LOG_LOOKAHEAD(
SYM_NAME(ts_subtree_symbol(result)),
- ts_subtree_total_size(result).bytes,
- "character:'%c'",
- first_error_character
+ ts_subtree_total_size(result).bytes
);
} else {
if (self->lexer.token_end_position.bytes < self->lexer.token_start_position.bytes) {
