aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authornass1pro <nass1pro@gmail.com>2020-06-14 09:39:13 +0200
committernass1pro <nass1pro@gmail.com>2020-06-14 09:39:13 +0200
commit1d455c5b8ba3ecd7fa0b0a5a6718bc6cd7fbd8d9 (patch)
treed8f54d290f2e301ff689dae879305eee5d2a0394 /include
parentcadd588473f82cdbbfdb7210bddd22262561faf3 (diff)
downloadminishell-1d455c5b8ba3ecd7fa0b0a5a6718bc6cd7fbd8d9.tar.gz
minishell-1d455c5b8ba3ecd7fa0b0a5a6718bc6cd7fbd8d9.tar.bz2
minishell-1d455c5b8ba3ecd7fa0b0a5a6718bc6cd7fbd8d9.zip
Change LTAG -> TAG in lexer.h
Diffstat (limited to 'include')
-rw-r--r--include/ast.h15
-rw-r--r--include/lexer.h26
2 files changed, 24 insertions, 17 deletions
diff --git a/include/ast.h b/include/ast.h
index a5e55bb..8127930 100644
--- a/include/ast.h
+++ b/include/ast.h
@@ -31,6 +31,12 @@
** \param SEP_OR `||` Execute right if left status != 0
*/
+typedef enum e_bool
+{
+ TRUE,
+ FALSE,
+} t_bool;
+
typedef enum e_sep
{
SEP_END,
@@ -66,9 +72,9 @@ typedef struct s_line
typedef struct s_cmd
{
- char **argv; // change to t_ftvec of t_token
- char *in; // change to t_token
- char *out; // change to t_token
+ t_ftlst *argv; // change to t_ftvec of t_token
+ t_token *in; // change to t_token
+ t_token *out; // change to t_token
bool is_append;
} t_cmd;
@@ -103,9 +109,10 @@ typedef struct s_ast
typedef struct s_ret
{
+ t_bool failed;
t_ast *as;
t_ftlst *rest;
-}
+} t_ret;
t_ast *ast_new(t_ast_tag tag, void *data);
void ast_destroy(t_ast *ast);
diff --git a/include/lexer.h b/include/lexer.h
index 90f9353..e2abe28 100644
--- a/include/lexer.h
+++ b/include/lexer.h
@@ -8,19 +8,19 @@
enum e_token_tag
{
- LTAG_AND = 1 << 0,
- LTAG_END = 1 << 1,
- LTAG_OR = 1 << 2,
- LTAG_PIPE = 1 << 3,
- LTAG_REDIR_IN = 1 << 4,
- LTAG_REDIR_OUT = 1 << 5,
- LTAG_REDIR_APPEND = 1 << 6,
- LTAG_PARENT_OPEN = 1 << 7,
- LTAG_PARENT_CLOSE = 1 << 8,
- LTAG_STR = 1 << 9,
- LTAG_STR_DOUBLE = 1 << 10,
- LTAG_STR_SINGLE = 1 << 11,
- LTAG_STICK = 1 << 12,
+ TAG_AND = 1 << 0,
+ TAG_END = 1 << 1,
+ TAG_OR = 1 << 2,
+ TAG_PIPE = 1 << 3,
+ TAG_REDIR_IN = 1 << 4,
+ TAG_REDIR_OUT = 1 << 5,
+ TAG_REDIR_APPEND = 1 << 6,
+ TAG_PARENT_OPEN = 1 << 7,
+ TAG_PARENT_CLOSE = 1 << 8,
+ TAG_STR = 1 << 9,
+ TAG_STR_DOUBLE = 1 << 10,
+ TAG_STR_SINGLE = 1 << 11,
+ TAG_STICK = 1 << 12,
};
typedef struct