Norming the ast/from_node
This commit is contained in:
parent
00546417ff
commit
4f66a053a3
1 changed files with 18 additions and 14 deletions
|
|
@ -6,7 +6,7 @@
|
||||||
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/08/09 15:07:10 by rparodi #+# #+# */
|
/* Created: 2024/08/09 15:07:10 by rparodi #+# #+# */
|
||||||
/* Updated: 2024/08/14 17:28:46 by maiboyer ### ########.fr */
|
/* Updated: 2024/09/02 11:35:32 by rparodi ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
|
|
@ -20,7 +20,8 @@
|
||||||
#include "parser/api.h"
|
#include "parser/api.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
t_error build_sym_negated_command(t_parse_node self, t_const_str input, t_ast_node *out)
|
t_error build_sym_negated_command(\
|
||||||
|
t_parse_node self, t_const_str input, t_ast_node *out)
|
||||||
{
|
{
|
||||||
t_ast_node ret;
|
t_ast_node ret;
|
||||||
|
|
||||||
|
|
@ -39,7 +40,8 @@ t_error build_sym_negated_command(t_parse_node self, t_const_str input, t_ast_no
|
||||||
return (*out = ret, NO_ERROR);
|
return (*out = ret, NO_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
t_error build_sym_pipeline(t_parse_node self, t_const_str input, t_ast_node *out)
|
t_error build_sym_pipeline(\
|
||||||
|
t_parse_node self, t_const_str input, t_ast_node *out)
|
||||||
{
|
{
|
||||||
t_ast_node ret;
|
t_ast_node ret;
|
||||||
t_ast_node tmp;
|
t_ast_node tmp;
|
||||||
|
|
@ -87,7 +89,8 @@ t_error build_sym_comment(t_parse_node self, t_const_str input, t_ast_node *out)
|
||||||
return (NO_ERROR);
|
return (NO_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
t_error build_sym_variable_assignment(t_parse_node self, t_const_str input, t_ast_node *out)
|
t_error build_sym_variable_assignment(\
|
||||||
|
t_parse_node self, t_const_str input, t_ast_node *out)
|
||||||
{
|
{
|
||||||
t_ast_node ret;
|
t_ast_node ret;
|
||||||
t_parse_node temp_ast;
|
t_parse_node temp_ast;
|
||||||
|
|
@ -109,7 +112,8 @@ t_error build_sym_variable_assignment(t_parse_node self, t_const_str input, t_as
|
||||||
}
|
}
|
||||||
if (ts_node_child_count(self) > 2)
|
if (ts_node_child_count(self) > 2)
|
||||||
{
|
{
|
||||||
if (ast_from_node(ts_node_child(self, 2), input, &ret->data.variable_assignment.value))
|
if (ast_from_node(ts_node_child(\
|
||||||
|
self, 2), input, &ret->data.variable_assignment.value))
|
||||||
return (ast_free(ret), ERROR);
|
return (ast_free(ret), ERROR);
|
||||||
}
|
}
|
||||||
return (*out = ret, NO_ERROR);
|
return (*out = ret, NO_ERROR);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue