aboutsummaryrefslogtreecommitdiff
path: root/src/parse/ast.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/parse/ast.c')
-rw-r--r--src/parse/ast.c72
1 files changed, 36 insertions, 36 deletions
diff --git a/src/parse/ast.c b/src/parse/ast.c
index f566832..44a36cd 100644
--- a/src/parse/ast.c
+++ b/src/parse/ast.c
@@ -11,18 +11,18 @@
** \return The allocated node
*/
-t_ast *ms_ast_new(t_tag tag)
-{
- t_ast *ast;
-
- if ((ast = (t_ast*)malloc(sizeof(t_ast))) == NULL)
- return (NULL);
- ast->tag = tag;
- ast->content = NULL;
- ast->children_num = 0;
- ast->children = NULL;
- return (ast);
-}
+/* t_ast *ms_ast_new(t_ast_tag tag) */
+/* { */
+/* t_ast *ast; */
+/* */
+/* if ((ast = (t_ast*)malloc(sizeof(t_ast))) == NULL) */
+/* return (NULL); */
+/* ast->tag = tag; */
+/* ast->content = NULL; */
+/* ast->children_num = 0; */
+/* ast->children = NULL; */
+/* return (ast); */
+/* } */
/**
** \brief Destroy an allocated AST
@@ -30,19 +30,19 @@ t_ast *ms_ast_new(t_tag tag)
** \param ast AST to destroy
*/
-void ms_ast_destroy(t_ast *ast)
-{
- int i;
-
- if (ast == NULL)
- return ;
- i = -1;
- while (++i < ast->children_num)
- ms_ast_destroy(ast->children[i]);
- free(ast->children);
- free(ast->content);
- free(ast);
-}
+/* void ms_ast_destroy(t_ast *ast) */
+/* { */
+/* int i; */
+/* */
+/* if (ast == NULL) */
+/* return ; */
+/* i = -1; */
+/* while (++i < ast->children_num) */
+/* ms_ast_destroy(ast->children[i]); */
+/* free(ast->children); */
+/* free(ast->content); */
+/* free(ast); */
+/* } */
/**
** \brief Iterate over an AST node's childs
@@ -50,14 +50,14 @@ void ms_ast_destroy(t_ast *ast)
** \param arg Pointer that will be passed to `f`, to keep information between iterations
*/
-void ms_ast_iter(
- t_ast *ast,
- void (*f)(void *f_arg, t_ast *children),
- void *arg)
-{
- int i;
-
- i = -1;
- while (++i < ast->children_num)
- f(arg, ast->children[i]);
-}
+/* void ms_ast_iter( */
+/* t_ast *ast, */
+/* void (*f)(void *f_arg, t_ast *children), */
+/* void *arg) */
+/* { */
+/* int i; */
+/* */
+/* i = -1; */
+/* while (++i < ast->children_num) */
+/* f(arg, ast->children[i]); */
+/* } */