code cleaning done on 80 percent of the parser functions, whats left is to re structure the syntax struct and do furthure tests to eliminate level 0 errors
This commit is contained in:
@@ -6,40 +6,40 @@
|
||||
/* By: mndhlovu <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2019/04/05 06:35:40 by mndhlovu #+# #+# */
|
||||
/* Updated: 2019/04/23 11:01:37 by tmaze ### ########.fr */
|
||||
/* Updated: 2019/04/29 12:06:18 by mndhlovu ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "lem_in.h"
|
||||
|
||||
t_rdata *lm_new_raw_line(char *raw)
|
||||
t_rdata *lm_new_raw_line(char *raw)
|
||||
{
|
||||
t_rdata *line;
|
||||
t_rdata *line;
|
||||
|
||||
if (!(line = (t_rdata *)malloc(sizeof(t_rdata))))
|
||||
return (NULL);
|
||||
line->line = ft_strdup(raw);
|
||||
line->next = NULL;
|
||||
return (line);
|
||||
if (!(line = (t_rdata *)malloc(sizeof(t_rdata))))
|
||||
return (NULL);
|
||||
line->line = ft_strdup(raw);
|
||||
line->next = NULL;
|
||||
return (line);
|
||||
}
|
||||
|
||||
void lm_append_line(t_rdata **line, char *raw)
|
||||
void lm_append_line(t_rdata **line, char *raw)
|
||||
{
|
||||
if (*line)
|
||||
{
|
||||
if((*line)->next)
|
||||
lm_append_line(&(*line)->next, raw);
|
||||
else
|
||||
(*line)->next = lm_new_raw_line(raw);
|
||||
}
|
||||
else
|
||||
*line = lm_new_raw_line(raw);
|
||||
if (*line)
|
||||
{
|
||||
if ((*line)->next)
|
||||
lm_append_line(&(*line)->next, raw);
|
||||
else
|
||||
(*line)->next = lm_new_raw_line(raw);
|
||||
}
|
||||
else
|
||||
*line = lm_new_raw_line(raw);
|
||||
}
|
||||
|
||||
void lm_clean_data(t_lmdata *data)
|
||||
void lm_clean_data(t_lmdata *data)
|
||||
{
|
||||
t_node *tmp;
|
||||
int i;
|
||||
t_node *tmp;
|
||||
int i;
|
||||
|
||||
while (data->nodes_data)
|
||||
{
|
||||
|
Reference in New Issue
Block a user