update
This commit is contained in:
parent
b8a121aae5
commit
ffc7a2d0fc
2 changed files with 23 additions and 3 deletions
|
|
@ -6,7 +6,7 @@
|
||||||
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
|
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/05/28 13:18:44 by maiboyer #+# #+# */
|
/* Created: 2024/05/28 13:18:44 by maiboyer #+# #+# */
|
||||||
/* Updated: 2024/05/29 13:41:57 by maiboyer ### ########.fr */
|
/* Updated: 2024/05/29 22:48:00 by maiboyer ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
|
@ -184,6 +184,26 @@ t_not *build_not(t_node *node, t_usize size)
|
||||||
return (ptr);
|
return (ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
t_command *build_command(t_node *node, t_usize size)
|
||||||
|
{
|
||||||
|
t_command *ptr;
|
||||||
|
|
||||||
|
(void)(size);
|
||||||
|
if (node == NULL || size == 0 ||
|
||||||
|
(node->kind != sym_redirected_statement && node->kind != sym_command &&
|
||||||
|
node->kind != sym_test_command &&
|
||||||
|
node->kind != sym_declaration_command &&
|
||||||
|
node->kind != sym_unset_command))
|
||||||
|
me_abort("Invalid arguments to build ast!");
|
||||||
|
ptr = (void *)alloc_node(TY_COMMAND);
|
||||||
|
if (node->kind == sym_redirected_statement)
|
||||||
|
ptr->inner.simple_command = NULL;
|
||||||
|
|
||||||
|
return (ptr);
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
*/
|
||||||
|
|
||||||
t_ast_node *from_node(t_node *node)
|
t_ast_node *from_node(t_node *node)
|
||||||
{
|
{
|
||||||
if (node == NULL)
|
if (node == NULL)
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/03/28 14:40:38 by rparodi #+# #+# */
|
/* Created: 2024/03/28 14:40:38 by rparodi #+# #+# */
|
||||||
/* Updated: 2024/05/29 16:40:26 by maiboyer ### ########.fr */
|
/* Updated: 2024/05/29 22:30:42 by maiboyer ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
|
@ -220,5 +220,5 @@ t_i32 main(t_i32 argc, t_str argv[], t_str envp[])
|
||||||
"\001\x1B[0m\002"
|
"\001\x1B[0m\002"
|
||||||
"$ ";
|
"$ ";
|
||||||
ft_take_args(&utils);
|
ft_take_args(&utils);
|
||||||
// (void)from_node(NULL);
|
(void)from_node(NULL);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue