Make parsing return 0 only when input is accepted
authorLukas Jiriste <ljiriste@student.42prague.com>
Thu, 1 Aug 2024 14:15:18 +0000 (16:15 +0200)
committerLukas Jiriste <ljiriste@student.42prague.com>
Fri, 2 Aug 2024 12:37:35 +0000 (14:37 +0200)
src/parsing.c

index a350de55c4767be14e768f293730eefc3299f94a..935780b1a3e5e812608ff13a3f5ff0ddcb4cafb5 100644 (file)
@@ -6,7 +6,7 @@
 /*   By: ljiriste <marvin@42.fr>                    +#+  +:+       +#+        */
 /*                                                +#+#+#+#+#+   +#+           */
 /*   Created: 2024/05/03 15:58:55 by ljiriste          #+#    #+#             */
-/*   Updated: 2024/08/01 16:10:45 by ljiriste         ###   ########.fr       */
+/*   Updated: 2024/08/02 10:25:42 by ljiriste         ###   ########.fr       */
 /*                                                                            */
 /* ************************************************************************** */
 
@@ -22,5 +22,5 @@ int   parse(t_vec *tokens, t_tree **parse_tree)
        ft_parsing_table_load(&table, "shell_parsing_table", "shell_rules");
        *parse_tree = ft_parse(tokens, &table);
        ft_parsing_table_free(&table);
-       return (0);
+       return (parse_tree == NULL);
 }