aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-06-09 17:09:55 +0200
committerCharles <sircharlesaze@gmail.com>2020-06-09 17:09:55 +0200
commit5ade92701836ce5ee1d39fc8d486b7709547058e (patch)
treefbcde5c25c995f7a71cc7f36d86170a53b53a472 /include
parent82f1e954590de21f6db9b1b6e3dba78a951bc319 (diff)
downloadminishell-5ade92701836ce5ee1d39fc8d486b7709547058e.tar.gz
minishell-5ade92701836ce5ee1d39fc8d486b7709547058e.tar.bz2
minishell-5ade92701836ce5ee1d39fc8d486b7709547058e.zip
Added iterpolation like bash according to lexer output (2 leaks)
Diffstat (limited to 'include')
-rw-r--r--include/ast.h8
-rw-r--r--include/lexer.h19
-rw-r--r--include/minishell.h3
3 files changed, 24 insertions, 6 deletions
diff --git a/include/ast.h b/include/ast.h
index 1dd28a1..e63ab22 100644
--- a/include/ast.h
+++ b/include/ast.h
@@ -6,7 +6,7 @@
/* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/04/01 17:05:38 by charles #+# #+# */
-/* Updated: 2020/05/14 23:54:46 by charles ### ########.fr */
+/* Updated: 2020/06/09 11:44:45 by charles ### ########.fr */
/* */
/* ************************************************************************** */
@@ -66,9 +66,9 @@ typedef struct s_line
typedef struct s_cmd
{
- char **argv;
- char *in;
- char *out;
+ char **argv; // change to t_ftvec of t_token
+ char *in; // change to t_token
+ char *out; // change to t_token
bool is_append;
} t_cmd;
diff --git a/include/lexer.h b/include/lexer.h
index e7a6cdf..e20e0e7 100644
--- a/include/lexer.h
+++ b/include/lexer.h
@@ -1,6 +1,23 @@
-
#include "minishell.h"
+// just to make iterpolation compile
+//////////////////////////////////////
+enum e_token_tag
+{
+ LTAG_STR,
+ LTAG_STR_SINGLE,
+ LTAG_STR_DOUBLE,
+};
+
+typedef struct
+{
+ enum e_token_tag tag;
+ char *content;
+} t_token;
+
+t_token *token_new(enum e_token_tag tag, char *content);
+//////////////////////////////////////
+
char **lexer(char *input);
int lexer_sep(char input);
int lexer_verif_entre_cote(char *input, int i);
diff --git a/include/minishell.h b/include/minishell.h
index 9551c1f..76e4f7a 100644
--- a/include/minishell.h
+++ b/include/minishell.h
@@ -6,7 +6,7 @@
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/02/26 15:33:51 by cacharle #+# #+# */
-/* Updated: 2020/04/05 14:52:20 by charles ### ########.fr */
+/* Updated: 2020/06/09 14:05:36 by charles ### ########.fr */
/* */
/* ************************************************************************** */
@@ -110,5 +110,6 @@ int builtin_exit(char **argv, t_env env);
*/
char *preprocess(char *input, t_env env);
+char **preprocess_argv(t_ftvec *argv, t_env env);
#endif