29 if (ft_strncmp(token->
value,
"$", 2) != 0)
42 return (ft_isalnum(c) || c ==
'_');
60 if (str[0] && ft_isdigit(str[0]))
63 return (ft_substr(str, 0, 1));
68 return (ft_substr(str, 0, i));
86 new_str = ft_calloc(
sizeof(
char), len + 2);
99 new_str[len + 1] =
'\0';
119 result = ft_strjoin(s1, s2);
int is_var_char(char c)
Check if a character is valid in a variable name.
int is_dollar_quote(t_token *token)
Check if a token is a $ connected to a quoted token.
char * extract_var_name(char *str, int *len)
Extract a variable name from after the $
char * append_str(char *s1, char *s2)
Concatenates 2 strings and frees the first.
char * append_char(char *str, char c)
Append a single character to an allocated string.
Lexer token (singly linked list)
char * value
Text content (allocated)
struct s_token * next
Next token.
int connected
1 if connected
Lexer, tokenizer, expander, and quote handling prototypes.