src/error_handling.c
/*
**	This function will check for most errors in one go. It verifies the
**	instruction is valid, checks if label definitions are using the allowed
**	alphabet, and verifies the correct amount of labels and the right types of
**	labels.
*/
This function will check for most errors in one go. It verifies the
instruction is valid, checks if label definitions are using the allowed
alphabet, and verifies the correct amount of labels and the right types of
labels.
This function will check for most errors in one go . It verifies the instruction is valid checks if label definitions are using the allowed alphabet and verifies the correct amount of labels and the right types of labels .
void			check_error(int ln, char *line)
{
	int		linetype;
	char	*clean_line;
	clean_line = ft_strdup(line);
	clean_line = format_line(clean_line);
	linetype = identify_line(clean_line);
	if (linetype == 0 || linetype == 6)
		error(ln, line, "Invalid instruction");
	else if (linetype == 7)
		error(ln, line, "Label using invalid alphabet");
	else if (linetype == 4)
		return ;
	verify_params_num(ln, line, clean_line);
	verify_params_type(ln, line, clean_line);
	ft_strdel(&clean_line);
}
void check_error ( int ln , char * line ) { int linetype ; char * clean_line ; clean_line = ft_strdup ( line ) ; clean_line = format_line ( clean_line ) ; linetype = identify_line ( clean_line ) ; if ( linetype == 0 || linetype == 6 ) error ( ln , line , " " ) ; else if ( linetype == 7 ) error ( ln , line , " " ) ; else if ( linetype == 4 ) return ; verify_params_num ( ln , line , clean_line ) ; verify_params_type ( ln , line , clean_line ) ; ft_strdel ( & clean_line ) ; }
This function will check for most errors in one go.
This function will check for most errors in one go .