From e439b71d807529734f04ce9d78b98c12022e7c72 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Wed, 16 Sep 2020 16:19:22 +0200 Subject: Refactoring main, all setup code in setup.c, disabled -c and -l flags if not tested --- src/debug.c | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'src/debug.c') diff --git a/src/debug.c b/src/debug.c index 8759252..3fe7784 100644 --- a/src/debug.c +++ b/src/debug.c @@ -1,16 +1,40 @@ - +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* debug.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: charles +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/09/16 15:58:35 by charles #+# #+# */ +/* Updated: 2020/09/16 16:18:11 by charles ### ########.fr */ +/* */ +/* ************************************************************************** */ #include + #include "lexer.h" -void tok_lst_debug(t_tok_lst *tokens) +void debug_tok_lst(t_tok_lst *tokens) { while (tokens != NULL) { + // FIXME libft for safer correction printf("[%#06x] |%s|%s\n", tokens->tag, tokens->content, tokens->tag & TAG_STICK ? " STICK" : ""); tokens = tokens->next; } } +int debug_lexer(char *input) +{ + int status; + t_tok_lst *out; + + status = lexer(input, &out); + if (status != 0) + return (status); + debug_tok_lst(out); + return (status); +} + /* void token_debug(void *v) */ /* { */ /* t_token *t; */ -- cgit