From 3b869b94124eb775568e48b87f0577adb3b5cb80 Mon Sep 17 00:00:00 2001 From: Raphael Date: Fri, 4 Oct 2024 17:48:43 +0200 Subject: [PATCH] feat: adding global value of whitespace --- parser/src/passes/fold_whitespace.c | 8 +++++++- parser/src/passes/template_file.c | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/parser/src/passes/fold_whitespace.c b/parser/src/passes/fold_whitespace.c index 73a0afa3..a78c7970 100644 --- a/parser/src/passes/fold_whitespace.c +++ b/parser/src/passes/fold_whitespace.c @@ -6,7 +6,7 @@ /* By: maiboyer +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/10/02 19:04:32 by maiboyer #+# #+# */ -/* Updated: 2024/10/04 17:41:40 by rparodi ### ########.fr */ +/* Updated: 2024/10/04 17:47:32 by rparodi ### ########.fr */ /* */ /* ************************************************************************** */ @@ -25,6 +25,7 @@ /// thus it shouldn't be freed in case of error /// - the output tokens may not be direct copy of the input tokens, /// but need to be cloned (different allocations for stuff) + t_error ts_fold_whitespace(t_vec_token input, t_vec_token *output) { t_vec_token out; @@ -46,3 +47,8 @@ t_error ts_fold_whitespace(t_vec_token input, t_vec_token *output) vec_token_free(input); return (*output = out, NO_ERROR); } + +static const struct s_ts_pass_def g_ts_dq_passes[] = {\ + {ts_do_fuck_all, "does nothing lol"}, \ + {ts_fold_whitespace, "fold whitespace"}, +}; diff --git a/parser/src/passes/template_file.c b/parser/src/passes/template_file.c index f225b477..132f7e62 100644 --- a/parser/src/passes/template_file.c +++ b/parser/src/passes/template_file.c @@ -6,7 +6,7 @@ /* By: maiboyer +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/10/02 19:04:32 by maiboyer #+# #+# */ -/* Updated: 2024/10/03 22:23:40 by maiboyer ### ########.fr */ +/* Updated: 2024/10/04 17:46:43 by rparodi ### ########.fr */ /* */ /* ************************************************************************** */ @@ -25,6 +25,7 @@ /// thus it shouldn't be freed in case of error /// - the output tokens may not be direct copy of the input tokens, /// but need to be cloned (different allocations for stuff) + t_error ts_do_fuck_all(t_vec_token input, t_vec_token *output) { t_vec_token out;