/* ************************************************************************** */
/* */
/* ::: :::::::: */
-/* categorization_step.c :+: :+: :+: */
+/* token_categorize.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: lnikolov <lnikolov@student.42prague.com +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/06/21 16:34:43 by ljiriste #+# #+# */
-/* Updated: 2024/08/31 15:53:33 by lnikolov ### ########.fr */
+/* Updated: 2024/08/31 18:56:37 by ljiriste ### ########.fr */
/* */
/* ************************************************************************** */
{
int res;
+ res = 0;
if (is_operator_start(current_token->vec, current_token->size)
&& can_expand_operator(current_token, line[*i]))
res = (ft_vec_append(current_token, line + (*i)++) != success);
!= success;
++*i;
}
- else if (current_token->size > 0)
- res = ft_vec_append(current_token, line + (*i)++) != success;
else
res = ft_vec_append(current_token, line + (*i)++) != success;
return (res);
/* By: lnikolov <lnikolov@student.42prague.com +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/08/31 15:08:00 by lnikolov #+# #+# */
-/* Updated: 2024/08/31 15:42:59 by lnikolov ### ########.fr */
+/* Updated: 2024/08/31 18:56:53 by ljiriste ### ########.fr */
/* */
/* ************************************************************************** */
i = 0;
while (line[i] && res == 0)
{
- if (line[i] == '#')
+ if (line[i] == '#' && (i == 0 || ft_isspace(line[i - 1])))
break ;
res = categorization_step(line, &i, ¤t_token, tokens);
}