fixed: splitting

This commit is contained in:
Maieul BOYER 2024-10-14 15:20:58 +02:00
parent ca8e484183
commit 135a6429ee
No known key found for this signature in database
14 changed files with 117 additions and 66 deletions

View file

@ -6,7 +6,7 @@
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/07/03 20:38:29 by maiboyer #+# #+# */
/* Updated: 2024/10/12 17:51:13 by rparodi ### ########.fr */
/* Updated: 2024/10/14 14:12:42 by maiboyer ### ########.fr */
/* */
/* ************************************************************************** */
@ -87,7 +87,7 @@ static inline void ast_print_block2(t_ast_node self)
if (self->kind == AST_FUNCTION_DEFINITION)
return (ast_print_node_function_definition(self));
if (self->kind == AST_HEREDOC_REDIRECTION)
return (ast_print_notdone(self));
return (ast_print_node_heredoc_redirection(self));
if (self->kind == AST_IF)
return (ast_print_notdone(self));
if (self->kind == AST_LIST)

View file

@ -6,7 +6,7 @@
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/07/03 20:38:29 by maiboyer #+# #+# */
/* Updated: 2024/10/12 17:51:13 by rparodi ### ########.fr */
/* Updated: 2024/10/14 14:15:06 by maiboyer ### ########.fr */
/* */
/* ************************************************************************** */
@ -61,8 +61,9 @@ void ast_print_node_command(t_ast_node self)
i = 0;
while (i < self->data.command.prefixes.len)
{
printf(" _");
ast_print(self->data.command.prefixes.buffer[i++]);
printf(" ");
printf("_ ");
}
return (ast_print_node_command_helper(self));
}

View file

@ -6,7 +6,7 @@
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/07/26 13:34:09 by rparodi #+# #+# */
/* Updated: 2024/10/12 17:51:14 by rparodi ### ########.fr */
/* Updated: 2024/10/14 14:14:36 by maiboyer ### ########.fr */
/* */
/* ************************************************************************** */
@ -26,7 +26,7 @@ void ast_print_node_raw_string(t_ast_node self)
return ;
if (self->kind != AST_RAW_STRING)
return ;
printf("%s", self->data.raw_string.str);
printf("{%s}", self->data.raw_string.str);
}
void ast_print_node_regex(t_ast_node self)

View file

@ -6,7 +6,7 @@
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/07/26 13:07:12 by rparodi #+# #+# */
/* Updated: 2024/10/12 17:51:15 by rparodi ### ########.fr */
/* Updated: 2024/10/14 14:12:49 by maiboyer ### ########.fr */
/* */
/* ************************************************************************** */
@ -49,3 +49,8 @@ void ast_print_node_file_redirection(t_ast_node self)
ast_print(self->data.file_redirection.output);
return ((void) ast_print_node_file_redirection_heredoc(self));
}
void ast_print_node_heredoc_redirection(t_ast_node self)
{
printf("<<%s", self->data.heredoc_redirection.delimiter);
}

View file

@ -6,7 +6,7 @@
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/07/26 13:27:30 by rparodi #+# #+# */
/* Updated: 2024/10/12 17:51:15 by rparodi ### ########.fr */
/* Updated: 2024/10/14 14:22:39 by maiboyer ### ########.fr */
/* */
/* ************************************************************************** */
@ -100,8 +100,12 @@ void ast_print_node_word(t_ast_node self)
if (self->data.word.kind == AST_WORD_DOUBLE_QUOTE)
quote_type = "\"";
i = 0;
printf("<=");
printf("%s", quote_type);
while (i < self->data.word.inner.len)
{
ast_print(self->data.word.inner.buffer[i++]);
}
printf("%s", quote_type);
printf("=>");
}