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:
30
src/errors/errors.c
Normal file
30
src/errors/errors.c
Normal 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));
|
||||
}
|
||||
Reference in New Issue
Block a user