30 && str[i] !=
'\'' && str[i] !=
'"')
34 return (ft_substr(str, 0, i));
54 while (str[end] && str[end] != quote)
58 ft_putstr_fd(
"minishell: unclosed quote\n", 2);
66 return (ft_substr(str, 1, end - 1));
91 if (s[i] ==
'\'' || s[i] ==
'"')
125 op = ft_substr(input, 0, len);
152 while (input && input[i])
t_token_type
Token types produced by Lexer.
t_quote_type
Quote context of a token.
Lexer token (singly linked list)
t_quote_type quote_type
Quote context.
int connected
1 if connected
void free_token_list(t_token *head)
Free the entire token linked list.
void add_token(t_token **head, t_token *new_token)
Add a token to the end of a linked list.
t_token * create_token(t_token_type type, char *value)
Allocate and initialize a new token.
Lexer, tokenizer, expander, and quote handling prototypes.
static char * extract_quoted(char *str, int *len, t_quote_type *qtype)
Extract a quoted text part, stripping the quotes.
int process_word_token(char *s, t_token **head)
Process a word token composed of quoted and unquoted chunks.
static char * extract_unquoted(char *str, int *len, t_quote_type *qtype)
Extract an unquoted text part until any delimiter is reached.
t_token * tokenize(char *input)
Tokenize the input string into a linked list of tokens.
int process_operator_token(char *input, t_token **head)
Process an operator token.
int is_whitespace(char c)
Check if a character is whitespace.
t_token_type get_operator_token_type(char *str, int *len)
Determine operator token type and its length in characters.
int is_operator(char c)
Check if a character is a shell operator.