aboutsummaryrefslogtreecommitdiff
path: root/src/debug.c
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2020-09-16 16:19:22 +0200
committerCharles Cabergs <me@cacharle.xyz>2020-09-16 16:19:22 +0200
commite439b71d807529734f04ce9d78b98c12022e7c72 (patch)
tree59125ee91455ac607aa064965073c0eed20b3573 /src/debug.c
parent0a8f2cf987a55d6e1c4b210f0f99a1a1e4e4460a (diff)
downloadminishell-e439b71d807529734f04ce9d78b98c12022e7c72.tar.gz
minishell-e439b71d807529734f04ce9d78b98c12022e7c72.tar.bz2
minishell-e439b71d807529734f04ce9d78b98c12022e7c72.zip
Refactoring main, all setup code in setup.c, disabled -c and -l flags if not tested
Diffstat (limited to 'src/debug.c')
-rw-r--r--src/debug.c28
1 files changed, 26 insertions, 2 deletions
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 <me@cacharle.xyz> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2020/09/16 15:58:35 by charles #+# #+# */
+/* Updated: 2020/09/16 16:18:11 by charles ### ########.fr */
+/* */
+/* ************************************************************************** */
#include <stdio.h>
+
#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; */