update: added folding into expansion node if possible

This commit is contained in:
maix0 2024-10-03 22:52:01 +02:00
parent 09dbd2de91
commit 142ac9c9e1
11 changed files with 278 additions and 41 deletions

View file

@ -6,7 +6,7 @@
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/10/02 18:43:41 by maiboyer #+# #+# */
/* Updated: 2024/10/03 21:32:32 by maiboyer ### ########.fr */
/* Updated: 2024/10/03 22:31:21 by maiboyer ### ########.fr */
/* */
/* ************************************************************************** */
@ -17,19 +17,26 @@
#include "me/vec/vec_token.h"
#include "parser/token.h"
typedef t_error (*t_ts_pass)(t_vec_token input, t_vec_token *output);
typedef t_error (*t_ts_pass)(t_vec_token input, t_vec_token *output);
struct s_ts_pass_def
{
t_ts_pass fn;
t_const_str name;
t_const_str name;
};
t_error ts_apply_passes(t_vec_token ts, t_vec_token *out);
// This function is to apply stuff on doublequote meta token
// You shouldn't have to use it !
// It *may* disapear/change/whatever
t_error ts_dq_apply_passes(t_vec_token ts, t_vec_token *out);
// list passes function here
// this is a example one, does absolutly nothing lol
t_error do_fuck_all(t_vec_token input, t_vec_token *output);
t_error ts_do_fuck_all(t_vec_token input, t_vec_token *output);
t_error ts_fold_expension(t_vec_token input, t_vec_token *output);
t_error ts_double_string_pass(t_vec_token input, t_vec_token *output);
#endif /* PASSES_H */

View file

@ -6,7 +6,7 @@
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/09/26 17:59:23 by maiboyer #+# #+# */
/* Updated: 2024/10/03 21:33:14 by maiboyer ### ########.fr */
/* Updated: 2024/10/03 22:30:42 by maiboyer ### ########.fr */
/* */
/* ************************************************************************** */
@ -26,7 +26,7 @@ enum e_token
TOK_DOLLAR, // dollar == $
TOK_DQUOTE, // double quote string
TOK_DRCARRET, // double right carret == >>
TOK_EXPENSION, // an expension == $<no_quote_word>
TOK_EXPENSION, // an expension == $<no_quote_word>; the $ is not in .string
TOK_LCARRET, // left carret == <
TOK_LPAREN, // left parenthesis == (
TOK_NQUOTE, // no quote string