feat: toujours les mêmes qui font les pipes. Plus de assert dans ASTs (pour des raisons évidentes de stabilité du code) et nouveaux types (AST_PIPE et AST_NEG), + modifs random dans le parser
This commit is contained in:
parent
07e7d83c60
commit
96626d9850
27 changed files with 238 additions and 86 deletions
|
|
@ -1,6 +1,4 @@
|
|||
#include <assert.h>
|
||||
|
||||
#include "ast.h"
|
||||
#include "ast_list.h"
|
||||
|
||||
struct ast *ast_create_list(struct list *list)
|
||||
{
|
||||
|
|
@ -15,13 +13,14 @@ struct ast *ast_create_list(struct list *list)
|
|||
|
||||
struct ast_list *ast_get_list(struct ast *node)
|
||||
{
|
||||
assert(node != NULL);
|
||||
return (struct ast_list *)node->data;
|
||||
if (node == NULL)
|
||||
return NULL;
|
||||
return node->data;
|
||||
}
|
||||
|
||||
bool ast_is_list(struct ast *node)
|
||||
{
|
||||
return node->type == AST_LIST;
|
||||
return node != NULL && node->type == AST_LIST;
|
||||
}
|
||||
|
||||
void ast_free_list(struct ast_list *ast_list)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue