#include "output_helpers.h"

#ifdef DEBUG_TOKENS
int debug_output_stack_depth = 0;

inline void output_change_stack(int stack_effect) {
	debug_output_stack_depth += stack_effect;
}

void output_debug(const char* msg, int stack_effect, bool with_newline) {
	if (stack_effect<0) output_change_stack(stack_effect);

	for (int i=0;i<debug_output_stack_depth;++i) {
		printf("  ");
	}
	printf("%s",msg);
	if (with_newline) printf("\n");

	if (stack_effect>0) output_change_stack(stack_effect);
}
void output_debug(string msg, int stack_effect, bool with_newline) {
	output_debug(msg.c_str(),stack_effect,with_newline);
}
#endif