merge maggle

This commit is contained in:
gwojda 2017-03-27 18:52:26 +02:00
commit ffad02af73
64 changed files with 319 additions and 205 deletions

View file

@ -6,7 +6,7 @@
# By: wescande <wescande@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2016/08/29 21:32:58 by wescande #+# #+# #
# Updated: 2017/03/27 17:02:38 by gwojda ### ########.fr #
# Updated: 2017/03/27 18:08:05 by ariard ### ########.fr #
# #
# **************************************************************************** #
@ -226,6 +226,7 @@ lexer/insert_newline.c\
lexer/isrw_delim.c\
lexer/keep_last_type.c\
lexer/lexer_backslash.c\
lexer/lexer_bang.c\
lexer/lexer_bquote.c\
lexer/lexer_curly_braces.c\
lexer/lexer_default.c\

View file

@ -6,7 +6,7 @@
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/12/01 12:15:50 by jhalford #+# #+# */
/* Updated: 2017/03/23 15:18:36 by jhalford ### ########.fr */
/* Updated: 2017/03/27 18:17:39 by jhalford ### ########.fr */
/* */
/* ************************************************************************** */
@ -24,6 +24,7 @@ enum e_lexstate
HEREDOC,
NEWLINE,
DELIM,
BANG,
SEP,
WORD,
NUMBER,
@ -99,6 +100,7 @@ int lexer_default(t_list **alst, t_lexer *lexer);
int lexer_newline(t_list **alst, t_lexer *lexer);
int lexer_heredoc(t_list **alst, t_lexer *lexer);
int lexer_delim(t_list **alst, t_lexer *lexer);
int lexer_bang(t_list **alst, t_lexer *lexer);
int lexer_sep(t_list **alst, t_lexer *lexer);
int lexer_word(t_list **alst, t_lexer *lexer);
int lexer_number(t_list **alst, t_lexer *lexer);

View file

@ -6,7 +6,7 @@
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/03/14 20:22:56 by jhalford #+# #+# */
/* Updated: 2017/03/27 17:17:05 by gwojda ### ########.fr */
/* Updated: 2017/03/27 18:08:04 by jhalford ### ########.fr */
/* */
/* ************************************************************************** */
@ -36,12 +36,8 @@ struct s_data_template
char **av_data;
};
int cliopts_get(char **av, t_cliopts opt_map[],
void *data);
t_cliopts *cliopts_getmap_long(t_cliopts opt_map[],
char *arg);
t_cliopts *cliopts_getmap_short(t_cliopts opt_map[],
char arg);
int cliopts_has(char **av, char c);
int cliopts_get(char **av, t_cliopts opt_map[], void *data);
t_cliopts *cliopts_getmap_long(t_cliopts opt_map[], char *arg);
t_cliopts *cliopts_getmap_short(t_cliopts opt_map[], char arg);
#endif

2
42sh/sample/again.sh Normal file
View file

@ -0,0 +1,2 @@
echo "echo hello" >> sample/again.sh
echo hello

8
42sh/sample/andor.sh Normal file
View file

@ -0,0 +1,8 @@
pwd > file && pwd >> file || ls | cat && ls | cat >> file || ls
cat -e file
sleep 2
echo "My sample :"
echo
cat sample/andor.sh

View file

@ -1 +0,0 @@
{ ls | cat }

9
42sh/sample/brace.sh Normal file
View file

@ -0,0 +1,9 @@
{ ls ; pwd } > file
cat -e file
sleep 2
echo
echo "My sample :"
sleep 2
echo
cat sample/brace.sh

View file

@ -1,8 +1,16 @@
case van in
( "bus" ) echo Hello world ;;
( "velo" ) echo Comment va ;;
( "van" ) case tutu in
( toto ) pwd ;;
( tutu ) ls ;;
case toto in
( tutu ) echo PERDU ;;
( titi ) echo PERDU ;;
( toto ) case lala in
( lolo ) echo PERDU ;;
( lala ) echo GAGNE ;;
esac ;;
esac
esac > file
cat -e file
sleep 2
echo
echo "My sample :"
sleep 2
echo
cat sample/case.sh

View file

@ -1,2 +1,9 @@
ls # Da comment
pwd
sleep 2
echo
echo "My sample :"
sleep 2
echo
cat sample/comment.sh

3
42sh/sample/eof.sh Normal file
View file

@ -0,0 +1,3 @@
while [ 1 ]
do
ls

View file

@ -1,4 +1,13 @@
for i in hello bonjour salut comment
for i in src/*/*.c
do
echo $i | cat -e
echo $i | cat -e > file
cat -e file >> another_file
cat -e another_file
done
sleep 2
echo
echo "My sample :"
sleep 2
echo
cat sample/for.sh

View file

@ -1,5 +1,14 @@
hello() (
echo HELLO
hello() (
echo hello ; hello )
hello
)
hello
sleep 2
echo
echo "My sample :"
sleep 2
echo
cat sample/func.sh

View file

@ -1,9 +1,25 @@
if cat wef4eeef
if false
then
echo Conditon 1
elif cat yulu
echo PERDU
elif false
then
echo Condition 2
echo PERDU
elif true
then
if false
then
echo PERDU
elif
echo GAGNE
fi > file
else
echo Condition 3
echo PERDU
fi
cat -e file
sleep 2
echo
echo "My sample :"
sleep 2
echo
cat sample/if.sh

View file

@ -1,10 +0,0 @@
if ls ;
then
pwd
elif ls
then
pwd
elif ls
then
pwd
fi

View file

@ -1,5 +0,0 @@
if cat yolo ;
then
pwd
else ls
fi

View file

@ -1,11 +0,0 @@
if cat yolo ;
then
pwd
elif ls
then
pwd
elif pwd
then
ls
else ls
fi

View file

@ -1,2 +0,0 @@
echo "echo hello" >> sample/infinite.sh
echo hello

View file

@ -1 +0,0 @@
ls

30
42sh/sample/mix.sh Normal file
View file

@ -0,0 +1,30 @@
VAR=10
if true
then
echo "Salut" ; echo "Correcteur"
while [ $VAR -gt 0 ]
do
until true
do
echo KO SI JE M AFFICHE
done
if true
then
echo OK SI JE M AFFICHE
elif [ -f Makefile ]
then
echo KO SI JE M AFFICHE
else
echo KO SI JE M AFFICHE
fi
echo "Encore un tour"
math VAR - 1
done
fi
sleep 2
echo
echo "My sample :"
sleep 3
echo
cat sample/mix/mix.sh

View file

@ -1,21 +0,0 @@
if ls
then
pwd ; echo "Salut"
while ls
do
until pwd
do
echo KO SI JE M AFFICHE
done
if cat faux
then
echo BONJOUR MAKEFILE
elif [ -f Makefile ]
then
echo BONJOUR MAKEFILE
else
echo KO SI JE M M AFFICHE
fi
echo "Encore une"
done
fi

31
42sh/sample/muchloop.sh Normal file
View file

@ -0,0 +1,31 @@
while [ 1 ]
do
while [ 1 ]
do
while [ 1 ]
do
while [ 1 ]
do
while [ 1 ]
do
while [ 1 ]
do
while [ 1 ]
do
while [ 1 ]
do
while [ 1 ]
do
while [ 1 ]
do
echo "SO MUCH LOOOOP"
done
done
done
done
done
done
done
done
done
done

View file

@ -1,3 +0,0 @@
cat < file1 < file2 > file3 > file4

View file

@ -1 +0,0 @@

16
42sh/sample/script.sh Normal file
View file

@ -0,0 +1,16 @@
clear
YES=y
NO=n
echo "Welcome in 42Zash, new corrector, what is your login ?"
until [ $REP == $YES ]
do
read -p "> " LOGIN
echo
read -p "Ok, fine, your login is $LOGIN, right ?(y/n) " REP
if [ $REP = $NO ]
then
echo
echo "Don't worry let's do it again"
fi
done

View file

@ -1,3 +0,0 @@
cat && ls || ls | cat && ls | cat || ls

View file

@ -8,3 +8,10 @@ echo aaa \
| (echo bbb 7; cat -e ;echo ccc 7) \
| (echo bbb 8; cat -e ;echo ccc 8) \
| (echo bbb 9; cat -e ;echo ccc 9)
sleep 2
echo "My sample :"
echo
sleep 2
cat sample/subshell.sh

View file

@ -1,2 +0,0 @@
(ls | cat
pwd ; ls)

View file

@ -0,0 +1,4 @@
while [ 1 ]
do
ls
done done

View file

@ -1,8 +1,30 @@
until [ 1 ]
VAR1=0
until [ $VAR1 -gt 10 ]
do
echo LOOP1
until [ 1 ]
VAR2=0
until [ $VAR2 -gt 10 ]
do
echo hello
VAR3=0
until [ $VAR3 -gt 10 ]
do
math VAR3 + 1
echo "3rd is $VAR3"
done
done > file1
math VAR2 + 1
echo "2nd is $VAR2"
done
math VAR1 + 1
echo "1st is $VAR1"
sleep 1
done
echo
echo "VAR1: $VAR1"
echo "VAR2: $VAR2"
echo "VAR3: $VAR3"
sleep 2
echo
echo "My sample :"
sleep 2
echo
cat sample/until.sh

View file

@ -1,11 +0,0 @@
until cat wefwef
do
until ls
do
pwd ; ls
done
until cat eqwfewf
do
ls | cat
done
done

View file

@ -1,11 +0,0 @@
ONE=0
while [ $ONE -le 10 ]
do
TWO=0
while [ $TWO -le 10 ]
do
echo world
math TWO + 1;
done
math ONE + 1;
done > file1

11
42sh/sample/var.sh Normal file
View file

@ -0,0 +1,11 @@
HELLO=WORLD HELLO=SALUT HELLO="BUENOS DIAS"
echo $HELLO
SALUT=$HELLO
echo $SALUT
sleep 2
echo
echo "My sample :"
sleep 2
echo
cat sample/var.sh

View file

@ -1 +0,0 @@
HELLO=WORLD

View file

@ -1,12 +1,24 @@
VAR=10
while
while
while ls | cat
while [ $VAR -gt 0 ]
do
ls
echo "Inside inner loop" | cat -e
math VAR - 1
done
if [ $VAR -eq -42 ]
then
false
else
true
fi
do
ls | cat
done
do
pwd
echo "I'm the execution block"
VAR=-42
done
sleep 2
echo
echo "My sample :"
sleep 3
echo
cat sample/while.sh

View file

@ -1,11 +0,0 @@
while ls
do
while cat rwgwghe
do
echo Hello World
done
while pwd
do
echo Bonjour ca va
done
done

View file

@ -1,5 +0,0 @@
ls
while [ 1 ] ;
do
ls | cat
done

View file

@ -1,5 +0,0 @@
ls
for HELLLO in yolo ;
do
ls
done > file1

View file

@ -1,16 +0,0 @@
ONE=11
while [ $ONE -gt 1 ]
do
TWO=11
while [ $TWO -gt 1 ]
do
THREE=11
while [ $THREE -gt 1 ]
do
echo hello
((THREE--))
done
((TWO--))
done
((ONE--))
done > file1

View file

@ -1,6 +0,0 @@
echo hello
while ||
do
pwd ;
done
ls | cat

View file

@ -1 +0,0 @@
< A B | ( C 2> D & E < F ) > G ; H=I J K

View file

@ -1 +0,0 @@
< A B | C | D | E > F

View file

@ -1 +0,0 @@
A && B || C && D

View file

@ -1 +0,0 @@
A ; B & C ; D || E

View file

@ -1 +0,0 @@
(A ; B &) | (C || D) && E

View file

@ -1 +0,0 @@

View file

@ -6,7 +6,7 @@
/* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/03/25 18:20:42 by ariard #+# #+# */
/* Updated: 2017/03/27 17:11:36 by gwojda ### ########.fr */
/* Updated: 2017/03/27 18:08:13 by jhalford ### ########.fr */
/* */
/* ************************************************************************** */

View file

@ -6,7 +6,7 @@
/* By: alao <alao@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/10/15 13:27:14 by alao #+# #+# */
/* Updated: 2017/03/27 18:37:39 by gwojda ### ########.fr */
/* Updated: 2017/03/27 18:51:59 by gwojda ### ########.fr */
/* */
/* ************************************************************************** */

View file

@ -6,7 +6,7 @@
/* By: alao <alao@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/09/20 14:50:33 by alao #+# #+# */
/* Updated: 2017/03/27 17:11:59 by gwojda ### ########.fr */
/* Updated: 2017/03/27 18:08:24 by jhalford ### ########.fr */
/* */
/* ************************************************************************** */

View file

@ -6,7 +6,7 @@
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/02/06 22:07:37 by jhalford #+# #+# */
/* Updated: 2017/03/27 17:09:31 by gwojda ### ########.fr */
/* Updated: 2017/03/27 18:08:33 by jhalford ### ########.fr */
/* */
/* ************************************************************************** */

View file

@ -6,7 +6,7 @@
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/02/06 22:09:53 by jhalford #+# #+# */
/* Updated: 2017/03/27 17:12:24 by gwojda ### ########.fr */
/* Updated: 2017/03/27 18:08:38 by jhalford ### ########.fr */
/* */
/* ************************************************************************** */

View file

@ -6,7 +6,7 @@
/* By: gwojda <gwojda@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/01/25 11:39:47 by gwojda #+# #+# */
/* Updated: 2017/03/27 18:00:27 by gwojda ### ########.fr */
/* Updated: 2017/03/27 18:08:45 by jhalford ### ########.fr */
/* */
/* ************************************************************************** */

View file

@ -6,7 +6,7 @@
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/02/09 20:39:06 by jhalford #+# #+# */
/* Updated: 2017/03/24 14:51:00 by jhalford ### ########.fr */
/* Updated: 2017/03/27 18:13:03 by jhalford ### ########.fr */
/* */
/* ************************************************************************** */
@ -24,7 +24,8 @@ t_lexstate get_state_global(t_lexer *lexer)
cl = lexer->pos ? lexer->str[lexer->pos - 1] : 0;
ret = 0;
if ((ft_is_delim(c) && (ret = DELIM))
|| ((c == '&' || c == ';' || c == '|' || c == '!') && (ret = SEP))
|| ((c == '&' || c == ';' || c == '|') && (ret = SEP))
|| ((c == '!') && (ret = BANG))
|| ((c == '\\') && (ret = BACKSLASH))
|| ((c == '\n') && (ret = NEWLINE))
|| ((c == '\'') && (ret = QUOTE))

View file

@ -0,0 +1,31 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* lexer_bang.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/03/27 18:12:03 by jhalford #+# #+# */
/* Updated: 2017/03/27 18:18:55 by jhalford ### ########.fr */
/* */
/* ************************************************************************** */
#include "minishell.h"
int lexer_bang(t_list **alst, t_lexer *lexer)
{
t_token *token;
token = (*alst)->content;
if (token->type)
{
token->type = TK_BANG;
lexer->state = DEFAULT;
lexer->pos++;
return (lexer_lex(&(*alst)->next, lexer));
}
token->type = TK_WORD;
lexer->state = WORD;
lexer->pos++;
return (lexer_lex(alst, lexer));
}

View file

@ -6,7 +6,7 @@
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/11/28 18:36:58 by jhalford #+# #+# */
/* Updated: 2017/03/27 18:15:29 by gwojda ### ########.fr */
/* Updated: 2017/03/27 18:52:15 by gwojda ### ########.fr */
/* */
/* ************************************************************************** */
@ -25,7 +25,7 @@ int lexer_dquote(t_list **alst, t_lexer *lexer)
else
push(&lexer->stack, DQUOTE);
}
else if (lexer->str[lexer->pos] == '\\')
else if (lexer->str[lexer->pos] == '\\' && lexer->str[lexer->pos + 1] == 0)
{
lexer->pos++;
if (lexer->str[lexer->pos] == 0)

View file

@ -6,7 +6,7 @@
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/02/09 17:08:51 by jhalford #+# #+# */
/* Updated: 2017/03/22 18:13:29 by jhalford ### ########.fr */
/* Updated: 2017/03/27 18:13:01 by jhalford ### ########.fr */
/* */
/* ************************************************************************** */
@ -19,6 +19,7 @@ int (*g_lexer[])(t_list **alst, t_lexer *lexer) =
&lexer_heredoc,
&lexer_newline,
&lexer_delim,
&lexer_bang,
&lexer_sep,
&lexer_word,
&lexer_number,

View file

@ -6,7 +6,7 @@
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/11/30 16:29:57 by jhalford #+# #+# */
/* Updated: 2017/03/20 15:23:35 by jhalford ### ########.fr */
/* Updated: 2017/03/27 18:11:51 by jhalford ### ########.fr */
/* */
/* ************************************************************************** */

View file

@ -6,7 +6,7 @@
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/12/07 18:07:50 by jhalford #+# #+# */
/* Updated: 2017/03/27 16:04:32 by jhalford ### ########.fr */
/* Updated: 2017/03/27 18:02:20 by jhalford ### ########.fr */
/* */
/* ************************************************************************** */
@ -17,7 +17,6 @@ void data_exit(void)
t_data *data;
data = data_singleton();
/* ft_strdel(&data->line.input); */
ft_strdel(&data->binary);
ft_sstrfree(data->env);
ft_sstrfree(data->local_var);

View file

@ -6,7 +6,7 @@
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/11/28 19:26:32 by jhalford #+# #+# */
/* Updated: 2017/03/27 16:00:19 by jhalford ### ########.fr */
/* Updated: 2017/03/27 18:04:11 by jhalford ### ########.fr */
/* */
/* ************************************************************************** */
@ -66,6 +66,15 @@ static int shlvl_inc(void)
return (0);
}
int modules_init(t_data *data)
{
lexer_init(&data->lexer);
parser_init(&data->parser);
exec_init(&data->exec);
jobc_init(&data->jobc);
return (0);
}
int data_init(int ac, char **av, char **env)
{
t_data *data;
@ -80,13 +89,10 @@ int data_init(int ac, char **av, char **env)
localenv_init();
if (shlvl_inc())
return (-1);
modules_init(data);
data->comp = NULL;
data->opts = SH_INTERACTIVE | SH_OPTS_JOBC;
data->lst_func = NULL;
lexer_init(&data->lexer);
parser_init(&data->parser);
exec_init(&data->exec);
jobc_init(&data->jobc);
if ((term_name = ft_getenv(data->env, "TERM")) == NULL)
term_name = "dumb";
if (tgetent(NULL, term_name) != 1)

View file

@ -6,7 +6,7 @@
/* By: gwojda <gwojda@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/03/20 14:45:40 by gwojda #+# #+# */
/* Updated: 2017/03/27 15:58:12 by jhalford ### ########.fr */
/* Updated: 2017/03/27 18:08:20 by ariard ### ########.fr */
/* */
/* ************************************************************************** */
@ -46,6 +46,7 @@ static int handle_instruction(t_list **token, t_btree **ast)
return (ret);
if (do_lexer_routine(token, stream) > 0)
continue ;
token_print(*token);
if ((ret = do_parser_routine(token, ast)) == 1
&& SH_NO_INTERACTIVE(data->opts))
return (ret);

View file

@ -6,7 +6,7 @@
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/03/27 15:32:13 by jhalford #+# #+# */
/* Updated: 2017/03/27 15:57:21 by jhalford ### ########.fr */
/* Updated: 2017/03/27 18:02:46 by jhalford ### ########.fr */
/* */
/* ************************************************************************** */

View file

@ -6,7 +6,7 @@
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/12/12 17:23:59 by jhalford #+# #+# */
/* Updated: 2017/03/27 17:13:41 by gwojda ### ########.fr */
/* Updated: 2017/03/27 18:08:56 by jhalford ### ########.fr */
/* */
/* ************************************************************************** */
@ -89,10 +89,10 @@ int shell_init(int ac, char **av, char **env)
if (data_init(ac, av, env) < 0)
return (-1);
if (cliopts_get(av, g_opts, data))
return (ft_perror(NULL)
&& SH_ERR("%s", SHELL_USAGE1)
&& SH_ERR("%s", SHELL_USAGE2)
&& SH_ERR("%s", SHELL_USAGE3));
{
return (ft_perror(NULL) && SH_ERR("%s", SHELL_USAGE1)
&& SH_ERR("%s", SHELL_USAGE2) && SH_ERR("%s", SHELL_USAGE3));
}
if (!isatty(STDIN) || *data->av_data)
data->opts &= ~(SH_INTERACTIVE | SH_OPTS_JOBC);
if ((data->fd = get_input_fd(data, NULL)) < 0)

View file

@ -6,7 +6,7 @@
/* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/03/11 15:58:38 by ariard #+# #+# */
/* Updated: 2017/03/24 23:26:22 by ariard ### ########.fr */
/* Updated: 2017/03/27 17:23:36 by ariard ### ########.fr */
/* */
/* ************************************************************************** */
@ -89,6 +89,7 @@ static t_aggrematch g_aggrematch[] =
{NEWLINE_LIST, TK_ELIF, TK_ELIF, TK_ELIF},
{NEWLINE_LIST, TK_ELSE, TK_ELSE, TK_ELSE},
{NEWLINE_LIST, TK_WHILE, TK_WHILE, TK_WHILE},
{NEWLINE_LIST, LOOP, LOOP, LOOP},
{NEWLINE_LIST, TK_LBRACE, TK_LBRACE, TK_LBRACE},
{NEWLINE_LIST, TK_UNTIL, TK_UNTIL, TK_UNTIL},
{NEWLINE_LIST, CASE_LIST_NS, CASE_LIST_NS, CASE_LIST_NS},
@ -148,6 +149,7 @@ static t_aggrematch g_aggrematch[] =
{CMD_SUFFIX, CMD_WORD, SIMPLE_COMMAND, CMD_PREFIX},
{CMD_SUFFIX, CMD_NAME, SIMPLE_COMMAND, CMD_NAME},
{CMD_SUFFIX, CMD_SUPERIOR, CMD_SUPERIOR, CMD_SUPERIOR},
{CMD_SUFFIX, COMPOUND_LIST, COMPOUND_LIST, COMPOUND_LIST},
{CMD_SUFFIX, PIPE_SEMI_SEQUENCE, PIPE_SEMI_SEQUENCE, PIPE_SEMI_SEQUENCE},
{CMD_SUFFIX, PIPE_CLOSE_SEQUENCE, PIPE_CLOSE_SEQUENCE, PIPE_CLOSE_SEQUENCE},
{CMD_PREFIX, LINEBREAK, SIMPLE_COMMAND, 0},

View file

@ -6,7 +6,7 @@
/* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/03/11 16:11:21 by ariard #+# #+# */
/* Updated: 2017/03/24 23:26:06 by ariard ### ########.fr */
/* Updated: 2017/03/27 17:29:01 by ariard ### ########.fr */
/* */
/* ************************************************************************** */
@ -605,6 +605,7 @@ static t_stackmatch g_stackmatch[] =
{NEWLINE_LIST, FOR_WORDLIST},
{NEWLINE_LIST, TK_IN},
{NEWLINE_LIST, TK_WHILE},
{NEWLINE_LIST, LOOP},
{NEWLINE_LIST, FUNC_NAME},
{NEWLINE_LIST, TK_UNTIL},
{NEWLINE_LIST, TK_IF},

View file

@ -6,7 +6,7 @@
/* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/02/09 17:58:34 by ariard #+# #+# */
/* Updated: 2017/03/23 16:47:59 by ariard ### ########.fr */
/* Updated: 2017/03/27 17:22:10 by ariard ### ########.fr */
/* */
/* ************************************************************************** */
@ -71,7 +71,7 @@ static t_prodmatch g_prodmatch[] =
{TK_ASSIGNMENT_WORD, NEWLINE_LIST, CMD_PREFIX},
{TK_ASSIGNMENT_WORD, CMD_NAME, CMD_SUFFIX},
{TK_ASSIGNMENT_WORD, CMD_SUPERIOR, CMD_SUFFIX},
{TK_ASSIGNMENT_WORD, COMPOUND_LIST, CMD_SUFFIX},
{TK_ASSIGNMENT_WORD, COMPOUND_LIST, CMD_PREFIX},
{TK_ASSIGNMENT_WORD, COMPLETE_CONDITION, CMD_PREFIX},
{TK_ASSIGNMENT_WORD, CONDITION, CMD_PREFIX},
{TK_ASSIGNMENT_WORD, AND_OR, CMD_PREFIX},
@ -94,6 +94,7 @@ static t_prodmatch g_prodmatch[] =
{TK_NEWLINE, TK_RBRACE, CMD_NAME},
{TK_NEWLINE, TK_IN, NEWLINE_LIST},
{TK_NEWLINE, TK_WHILE, NEWLINE_LIST},
{TK_NEWLINE, LOOP, NEWLINE_LIST},
{TK_NEWLINE, TK_UNTIL, NEWLINE_LIST},
{TK_NEWLINE, TK_FOR, NEWLINE_LIST},
{TK_NEWLINE, TK_IF, NEWLINE_LIST},