diff --git a/ast/src/ast_free/ast_free.c b/ast/src/ast_free/ast_free.c index 348be53f..a09c1b70 100644 --- a/ast/src/ast_free/ast_free.c +++ b/ast/src/ast_free/ast_free.c @@ -6,7 +6,7 @@ /* By: rparodi +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/07/30 14:29:42 by rparodi #+# #+# */ -/* Updated: 2024/10/08 15:26:40 by maiboyer ### ########.fr */ +/* Updated: 2024/10/09 13:18:53 by maiboyer ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/exec/include/exec/_run_ast.h b/exec/include/exec/_run_ast.h index 66972015..4cd3f6af 100644 --- a/exec/include/exec/_run_ast.h +++ b/exec/include/exec/_run_ast.h @@ -6,7 +6,7 @@ /* By: rparodi +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/08/14 17:57:57 by rparodi #+# #+# */ -/* Updated: 2024/09/18 22:18:11 by maiboyer ### ########.fr */ +/* Updated: 2024/10/09 15:37:28 by maiboyer ### ########.fr */ /* */ /* ************************************************************************** */ @@ -138,8 +138,7 @@ t_error _ast_get_str__command_substitution(\ t_ast_node elem, t_word_iterator *state, t_vec_estr *out); t_error _ast_get_str__expansion(\ t_ast_node elem, t_word_iterator *state, t_vec_estr *out); -t_error _ast_get_str__raw(\ - t_ast_node elem, t_word_iterator *state, t_vec_estr *out); +t_error _ast_get_str__raw(t_ast_node elem, t_word_iterator *state, t_vec_estr *out); t_error _ast_get_str__raw__double_quote(\ t_ast_node elem, t_word_iterator *state, t_vec_estr *out); t_error _ast_get_str__raw__no_quote(\ @@ -176,8 +175,12 @@ t_error _run_get_exit_code(\ t_ast_node self, t_state *state, int *out); t_error _spawn_cmd_and_run(t_vec_str args, t_redirections redirs, \ t_state *state, t_command_result *out); -t_error _word_into_str(\ - t_ast_node self, t_state *state, t_vec_str *append); + + +t_error _word_into_str(t_ast_node self, t_state *state, t_vec_str *append); + + + t_error run_command(\ t_ast_command *command, t_state *state, t_cmd_pipe cmd_pipe, \ t_command_result *out); diff --git a/parser/src/yarn/ast_cmd.c b/parser/src/yarn/ast_cmd.c index 70160538..ca4936f4 100644 --- a/parser/src/yarn/ast_cmd.c +++ b/parser/src/yarn/ast_cmd.c @@ -6,7 +6,7 @@ /* By: maiboyer +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/10/09 12:44:53 by maiboyer #+# #+# */ -/* Updated: 2024/10/09 21:55:35 by maiboyer ### ########.fr */ +/* Updated: 2024/10/10 15:16:38 by maiboyer ### ########.fr */ /* */ /* ************************************************************************** */ @@ -55,21 +55,24 @@ t_const_str _token_to_string(t_token *arg) if (arg == NULL || arg->type == TOK_NONE) return (NULL); + s = string_new(16); if (arg->string.buf != NULL) - return (str_clone(arg->string.buf)); + { + if (arg->type == TOK_EXPENSION) + string_push_char(&s, '$'); + string_push(&s, arg->string.buf); + } else if (arg->subtokens.buffer != NULL) { i = 0; - s = string_new(16); while (i < arg->subtokens.len) { tmp = _token_to_string(&arg->subtokens.buffer[i++]); string_push(&s, tmp); str_free((t_str)tmp); } - return (s.buf); } - return (NULL); + return (s.buf); } static t_error _ast_set_redir_arg(t_ast_node node, t_token *arg)