update: parser now uses tokens from lexer

fixes pending:
 - some functions are longer than norminette allows
 - find solution to a list of commands being returned, even though a
syntax error is found when processing tokens (maybe delegate some work
to the lexer and return only a syntax-valid list?)
This commit is contained in:
2026-02-11 02:51:30 +01:00
parent 1715f2dd40
commit c493979a18
7 changed files with 475 additions and 289 deletions

30
src/errors/errors.c Normal file
View File

@@ -0,0 +1,30 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* errors.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: sede-san <sede-san@student.42madrid.com +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2026/02/10 22:22:06 by sede-san #+# #+# */
/* Updated: 2026/02/11 02:30:32 by sede-san ### ########.fr */
/* */
/* ************************************************************************** */
#include "errors.h"
void syntax_error_unexpected_token(
t_token *token
)
{
char *cause;
cause = token->value;
if (token == NULL)
cause = "newline";
ft_eprintf("minishell: syntax error near unexpected token `%s'\n", cause);
}
void malloc_error(void)
{
ft_eprintf("minishell: %s\n", strerror(ENOMEM));
}