a bit of code cleaning on the parser

This commit is contained in:
Mthandazo Ndhlovu
2019-04-30 12:06:58 +02:00
parent a51c8ad81d
commit ee59b79e75
14 changed files with 30 additions and 39 deletions

View File

@@ -6,7 +6,7 @@
/* By: mndhlovu <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/04/04 09:24:45 by mndhlovu #+# #+# */
/* Updated: 2019/04/29 12:05:40 by mndhlovu ### ########.fr */
/* Updated: 2019/04/30 08:16:49 by mndhlovu ### ########.fr */
/* */
/* ************************************************************************** */
@@ -61,22 +61,23 @@ void lm_get_cmd_vert(int count, t_syntax *synt
}
}
void lm_get_vert_link(int count, t_syntax *synt
, t_lmdata *ldata, t_holder *holder, char *line)
void lm_get_vert_link(int count, t_lmdata *ldata
, t_syntax *syntax, t_holder *holder, char *line)
{
if (count > 0 && (count != synt->s_vert && count != synt->e_vert)
&& (count != synt->s_pos
&& count != synt->e_pos && line != NULL))
if (count > 0 && (count != syntax->s_vert
&& count != syntax->e_vert)
&& (count != syntax->s_pos
&& count != syntax->e_pos && line != NULL))
{
if (lm_check_forbiden_chars(line, 0))
{
if (!(lm_add_vertex(ldata, line, 'v', synt)))
synt->v_error = 1;
if (!(lm_add_vertex(ldata, line, 'v', syntax)))
syntax->v_error = 1;
}
if (lm_check_forbiden_chars(line, 3))
{
if (!(lm_ext_conn(holder, ldata, line)))
synt->l_error = 1;
syntax->l_error = 1;
}
}
}