<commit_before>#include <printer.h>

#include <lsp_assert.h>

#include <assert.h>
#include <string.h>

void printer_print( printer_type * printer, expr_type * expr, FILE * out ) {
	(void) printer;
	switch( expr->type_code ) {
		case EXPR_TYPE_NIL: {
			fprintf( out, "n" );
			return;
		}
		case EXPR_TYPE_SYMBOL: {
			// For now, the only symbol is 'exit'
			assert( strcmp( expr_get_symbol( expr ), "exit" ) == 0 );
			fprintf( out, "exit" );
			return;
		}
		case EXPR_TYPE_INT: {
			fprintf( out, "%d", expr_get_int( expr ) );
			return;
		}
		case EXPR_TYPE_EOF: {
			fprintf( out, "<EOF>" );
			return;
		}
		default: {
			// fall-through
		}
	}
	LSP_ABORT( "Unknown expr type" );
}
<commit_msg>Adding support for string values to the printer<commit_after>#include <printer.h>

#include <lsp_assert.h>

#include <assert.h>
#include <string.h>

void printer_print( printer_type * printer, expr_type * expr, FILE * out ) {
	(void) printer;
	switch( expr->type_code ) {
		case EXPR_TYPE_NIL: {
			fprintf( out, "n\n" );
			return;
		}
		case EXPR_TYPE_INT: {
			fprintf( out, "%d\n", expr_get_int( expr ) );
			return;
		}
		case EXPR_TYPE_STRING: {
			fprintf( out, "\"%s\"\n", expr_get_string( expr ) );
			return;
		}
		case EXPR_TYPE_SYMBOL: {
			fprintf( out, "%s\n", expr_get_symbol( expr ) );
			return;
		}
		case EXPR_TYPE_EOF: {
			fprintf( out, "<EOF>\n" );
			return;
		}
		default: {
			// fall-through
		}
	}
	LSP_ABORT( "Unknown expr type" );
}

{'fraction_non_alphanumeric': 0.15857826384142173, 'fraction_numerical': 0.000683526999316473, 'mean_word_length': 3.23121387283237, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5344317', 'n_tokens_mistral': 652, 'n_tokens_neox': 592, 'n_words': 134}