Updated Grammar

This commit is contained in:
Maieul BOYER 2024-07-01 12:57:51 +02:00
parent 74d642f297
commit 175efe0f2f
No known key found for this signature in database
1246 changed files with 109558 additions and 114993 deletions

View file

@ -58,6 +58,18 @@ enum e_ast_expansion_operator
E_OP_LARGEST_SUFFIX, // ${var%%pattern}
};
enum e_ast_redirection_kind
{
AST_REDIR_INPUT, // <
AST_REDIR_OUTPUT, // >
AST_REDIR_APPEND, // >>
AST_REDIR_HEREDOC, // <<
AST_REDIR_HEREDOC_INDENT, // <<-
AST_REDIR_DUP_INPUT, // <&
AST_REDIR_DUP_OUTPUT, // >&
AST_REDIR_DUP_ERROR, // &>
};
struct s_ast_empty
{
};
@ -306,6 +318,7 @@ struct s_ast_variable_assignment
struct s_ast_file_redirection
{
t_ast_node output;
t_ast_redirection_kind op;
t_ast_node input;
};
@ -318,6 +331,7 @@ struct s_ast_file_redirection
struct s_ast_heredoc_redirection
{
t_ast_node output;
t_ast_redirection_kind op;
t_ast_node delimiter;
};
@ -357,4 +371,26 @@ struct s_ast_command_substitution
t_ast_node cmd;
};
/// Extended Globbing
/// ```shell
/// !(pattern)
/// ?(pattern)
/// *(pattern)
/// +(pattern)
/// @(pattern)
/// ```
struct s_ast_extglob
{
t_str pattern;
};
/// Regex
/// ```shell
/// ~pattern
/// ```
struct s_ast_regex
{
t_str pattern;
};
#endif /* AST_RAW_STRUCTS_H */