curly brackets lexing
This commit is contained in:
parent
07934128f1
commit
5547d38afa
13 changed files with 21 additions and 20 deletions
|
|
@ -6,7 +6,7 @@
|
|||
/* By: sbenning <sbenning@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2016/12/09 02:05:22 by sbenning #+# #+# */
|
||||
/* Updated: 2017/03/16 15:58:25 by jhalford ### ########.fr */
|
||||
/* Updated: 2017/03/22 17:51:49 by jhalford ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: gwojda <gwojda@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2017/01/23 10:35:44 by gwojda #+# #+# */
|
||||
/* Updated: 2017/03/21 10:02:04 by gwojda ### ########.fr */
|
||||
/* Updated: 2017/03/22 17:53:46 by jhalford ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2016/12/01 12:15:50 by jhalford #+# #+# */
|
||||
/* Updated: 2017/03/22 17:29:24 by ariard ### ########.fr */
|
||||
/* Updated: 2017/03/22 18:13:32 by jhalford ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: wescande <wescande@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2017/03/07 22:04:42 by wescande #+# #+# */
|
||||
/* Updated: 2017/03/21 00:51:39 by wescande ### ########.fr */
|
||||
/* Updated: 2017/03/22 18:04:44 by jhalford ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -18,6 +18,7 @@ int plaunch_until(t_process *p)
|
|||
|
||||
ret = 0;
|
||||
ft_exec(&p->data.d_until.condition);
|
||||
/* signal(SIGINT, sigint_handler); */
|
||||
while (ft_strcmp(ft_getenv(data_singleton()->env, "?"), "0"))
|
||||
{
|
||||
ft_exec(&p->data.d_until.content);
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: wescande <wescande@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2017/03/07 17:20:53 by wescande #+# #+# */
|
||||
/* Updated: 2017/03/21 00:48:16 by wescande ### ########.fr */
|
||||
/* Updated: 2017/03/22 18:01:02 by jhalford ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -18,6 +18,7 @@ int plaunch_while(t_process *p)
|
|||
|
||||
ret = 0;
|
||||
ft_exec(&p->data.d_while.condition);
|
||||
signal(SIGINT, sigint_handler);
|
||||
while (!(ft_strcmp(ft_getenv(data_singleton()->env, "?"), "0")))
|
||||
{
|
||||
ft_exec(&p->data.d_while.content);
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2017/03/13 22:21:19 by jhalford #+# #+# */
|
||||
/* Updated: 2017/03/22 16:34:15 by jhalford ### ########.fr */
|
||||
/* Updated: 2017/03/22 17:52:47 by jhalford ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -17,10 +17,7 @@ int process_fork(t_process *p)
|
|||
pid_t pid;
|
||||
|
||||
if ((pid = fork()) == -1)
|
||||
{
|
||||
ft_dprintf(3, "{red}%s: internal fork error{eoc}\n", SHELL_NAME);
|
||||
exit(1);
|
||||
}
|
||||
exit(SH_ERR("fork(): %s", strerror(errno)));
|
||||
else if (pid)
|
||||
return (pid);
|
||||
if (!p)
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2016/12/15 11:49:05 by jhalford #+# #+# */
|
||||
/* Updated: 2017/03/22 17:29:38 by jhalford ### ########.fr */
|
||||
/* Updated: 2017/03/22 17:48:54 by jhalford ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2016/12/10 15:14:47 by jhalford #+# #+# */
|
||||
/* Updated: 2017/01/22 20:56:45 by ariard ### ########.fr */
|
||||
/* Updated: 2017/03/22 18:04:22 by jhalford ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -15,5 +15,6 @@
|
|||
void sigint_handler(int signo)
|
||||
{
|
||||
(void)signo;
|
||||
set_exitstatus(1, 1);
|
||||
DG("pid:%i got SIGINT", getpid());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2017/03/05 16:29:35 by jhalford #+# #+# */
|
||||
/* Updated: 2017/03/05 16:29:36 by jhalford ### ########.fr */
|
||||
/* Updated: 2017/03/22 18:13:49 by jhalford ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -22,11 +22,12 @@ int lexer_curly_braces(t_list **alst, t_lexer *lexer)
|
|||
if (lexer->str[lexer->pos] == '{')
|
||||
{
|
||||
token->type = TK_LBRACE;
|
||||
push(&lexer->stack, PAREN);
|
||||
push(&lexer->stack, CURLY_BRACKETS);
|
||||
}
|
||||
else if (get_lexer_stack(*lexer))
|
||||
else
|
||||
{
|
||||
token->type = TK_RBRACE;
|
||||
if (get_lexer_stack(*lexer) == CURLY_BRACKETS)
|
||||
pop(&lexer->stack);
|
||||
}
|
||||
lexer->pos++;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2017/02/09 17:08:51 by jhalford #+# #+# */
|
||||
/* Updated: 2017/03/20 15:02:05 by jhalford ### ########.fr */
|
||||
/* Updated: 2017/03/22 18:13:29 by jhalford ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2017/03/03 17:37:15 by jhalford #+# #+# */
|
||||
/* Updated: 2017/03/22 17:16:17 by jhalford ### ########.fr */
|
||||
/* Updated: 2017/03/22 18:13:07 by jhalford ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: gwojda <gwojda@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2017/03/20 14:45:40 by gwojda #+# #+# */
|
||||
/* Updated: 2017/03/22 17:37:32 by jhalford ### ########.fr */
|
||||
/* Updated: 2017/03/22 17:44:44 by jhalford ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2017/03/22 16:07:14 by jhalford #+# #+# */
|
||||
/* Updated: 2017/03/22 16:25:14 by jhalford ### ########.fr */
|
||||
/* Updated: 2017/03/22 17:49:38 by jhalford ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue