From 8ee70e735ed6bb849a85ab5d061f96aeeec552f0 Mon Sep 17 00:00:00 2001 From: Nikita Ivanov Date: Sat, 11 Jun 2022 13:22:45 +0500 Subject: [PATCH] Print values in debug mode --- src/config.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/config.c b/src/config.c index 5543023..6329bdc 100644 --- a/src/config.c +++ b/src/config.c @@ -261,7 +261,18 @@ static int parse(void) next_token(); if (token.type == TOK_EOF) break; - printf("%s\n", lexer_token_type_str(token.type)); + printf("%s", lexer_token_type_str(token.type)); + switch (token.type) { + case TOK_INT: + printf(": %d\n", token.val.i); + break; + case TOK_STR: + printf(": %s\n", token.val.s); + break; + default: + puts(""); + break; + } } #endif