norm: almost everything
This commit is contained in:
parent
8122ecfc95
commit
54a1041aa7
9 changed files with 311 additions and 264 deletions
24
parser/src/yard/yard_utils.c
Normal file
24
parser/src/yard/yard_utils.c
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* yard_utils.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/10/12 16:11:05 by maiboyer #+# #+# */
|
||||
/* Updated: 2024/10/12 16:11:19 by maiboyer ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "parser/token.h"
|
||||
|
||||
int _get_prec(t_token *token)
|
||||
{
|
||||
if (!token)
|
||||
return (-1);
|
||||
else if (token->type == TOK_PIPE)
|
||||
return (2);
|
||||
else if (token->type == TOK_AND || token->type == TOK_OR)
|
||||
return (1);
|
||||
return (0);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue