normed: includes

This commit is contained in:
maix0 2024-10-12 15:38:33 +02:00
parent 43d394ba32
commit 7bb95e24a6
3 changed files with 42 additions and 46 deletions

View file

@ -6,7 +6,7 @@
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */ /* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/05/02 15:49:56 by maiboyer #+# #+# */ /* Created: 2024/05/02 15:49:56 by maiboyer #+# #+# */
/* Updated: 2024/10/06 14:20:09 by maiboyer ### ########.fr */ /* Updated: 2024/10/12 15:35:52 by maiboyer ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -22,13 +22,12 @@ typedef struct s_state t_state;
struct s_state struct s_state
{ {
t_ast_node ast;
t_const_str prompt; t_const_str prompt;
t_str str_input;
t_hashmap_env *env; t_hashmap_env *env;
t_hashmap_env *tmp_var; t_hashmap_env *tmp_var;
void *parser;
t_ast_node ast;
t_i32 last_exit; t_i32 last_exit;
t_str str_input;
}; };
#endif /* STATE_H */ #endif /* STATE_H */

View file

@ -6,7 +6,7 @@
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */ /* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/10/02 18:43:41 by maiboyer #+# #+# */ /* Created: 2024/10/02 18:43:41 by maiboyer #+# #+# */
/* Updated: 2024/10/10 15:27:32 by maiboyer ### ########.fr */ /* Updated: 2024/10/12 15:38:12 by maiboyer ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -34,9 +34,6 @@ t_error ts_dq_apply_passes(t_vec_token ts, t_vec_token *out);
// list passes function here // list passes function here
// this is a example one, does absolutly nothing lol
t_error ts_do_fuck_all(t_vec_token input, t_vec_token *output);
t_error ts_double_amp(t_vec_token input, t_vec_token *output); t_error ts_double_amp(t_vec_token input, t_vec_token *output);
t_error ts_double_lcarret(t_vec_token input, t_vec_token *output); t_error ts_double_lcarret(t_vec_token input, t_vec_token *output);
t_error ts_double_lparen(t_vec_token input, t_vec_token *output); t_error ts_double_lparen(t_vec_token input, t_vec_token *output);

View file

@ -6,7 +6,7 @@
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */ /* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/09/26 17:59:23 by maiboyer #+# #+# */ /* Created: 2024/09/26 17:59:23 by maiboyer #+# #+# */
/* Updated: 2024/10/07 16:45:34 by maiboyer ### ########.fr */ /* Updated: 2024/10/12 15:37:11 by maiboyer ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -18,32 +18,32 @@
enum e_token enum e_token
{ {
TOK_AEXP, // a meta token, artih expansion TOK_AEXP,
TOK_AMP, // ampersand == & TOK_AMP,
TOK_AND, // and == && TOK_AND,
TOK_CARRET, // any carret == < > << >> TOK_CARRET,
TOK_CMD, // a meta token, which contains subtokens TOK_CMD,
TOK_DLCARRET, // double left carret == << TOK_DLCARRET,
TOK_DLPAREN, // double left parenthesis '((' TOK_DLPAREN,
TOK_DOLLAR, // dollar == $ TOK_DOLLAR,
TOK_DQUOTE, // double quote string TOK_DQUOTE,
TOK_DRCARRET, // double right carret == >> TOK_DRCARRET,
TOK_DRPAREN, // double right parenthesis '))' TOK_DRPAREN,
TOK_EXPENSION, // an expension == $<no_quote_word>; the $ is not in .string TOK_EXPENSION,
TOK_LCARRET, // left carret == < TOK_LCARRET,
TOK_LPAREN, // left parenthesis == ( TOK_LPAREN,
TOK_NALPHANUM, // a non alphanumeric character, used in the expansion folding, then folded back into NQUOTE TOK_NALPHANUM,
TOK_NONE, // NO TOKEN TYPE == INVALID / INEXISTANT TOKEN TOK_NONE,
TOK_NQUOTE, // no quote string TOK_NQUOTE,
TOK_OR, // or == || TOK_OR,
TOK_PIPE, // pipe == | TOK_PIPE,
TOK_RCARRET, // right carret == > TOK_RCARRET,
TOK_REDIR, // a meta token, which contains <OPERATOR> being an [D](L|R)CARRET and the arg being a WORD TOK_REDIR,
TOK_RPAREN, // right parenthesis == ) TOK_RPAREN,
TOK_SEMICOLON, // semicolor == ; TOK_SEMICOLON,
TOK_SQUOTE, // single quote string TOK_SQUOTE,
TOK_WHITESPACE, // whitespace outside of quoted strings TOK_WHITESPACE,
TOK_WORD, // a meta token, which contains subtokens TOK_WORD,
}; };
typedef struct s_token typedef struct s_token