typo: fixed typo
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
/* By: sede-san <sede-san@student.42madrid.com +#+ +:+ +#+ */
|
/* By: sede-san <sede-san@student.42madrid.com +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2026/02/09 18:56:41 by sede-san #+# #+# */
|
/* Created: 2026/02/09 18:56:41 by sede-san #+# #+# */
|
||||||
/* Updated: 2026/02/10 09:11:23 by sede-san ### ########.fr */
|
/* Updated: 2026/02/10 12:33:55 by sede-san ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
@@ -27,7 +27,8 @@ static inline bool is_meta(char c);
|
|||||||
* @return A list of tokens or NULL on error.
|
* @return A list of tokens or NULL on error.
|
||||||
*/
|
*/
|
||||||
t_list *lex(
|
t_list *lex(
|
||||||
const char *line)
|
const char *line
|
||||||
|
)
|
||||||
{
|
{
|
||||||
t_list *tokens;
|
t_list *tokens;
|
||||||
t_token *token;
|
t_token *token;
|
||||||
@@ -57,7 +58,8 @@ t_list *lex(
|
|||||||
*/
|
*/
|
||||||
static t_token *tokenize(
|
static t_token *tokenize(
|
||||||
const char *line,
|
const char *line,
|
||||||
size_t *start)
|
size_t *start
|
||||||
|
)
|
||||||
{
|
{
|
||||||
t_token *token;
|
t_token *token;
|
||||||
t_token_type type;
|
t_token_type type;
|
||||||
@@ -97,7 +99,8 @@ static t_token_type get_token_type(
|
|||||||
|
|
||||||
static t_token *token_new(
|
static t_token *token_new(
|
||||||
t_token_type type,
|
t_token_type type,
|
||||||
char *text)
|
char *text
|
||||||
|
)
|
||||||
{
|
{
|
||||||
t_token *token;
|
t_token *token;
|
||||||
|
|
||||||
@@ -115,7 +118,8 @@ static t_token *token_new(
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void token_clear(
|
static void token_clear(
|
||||||
t_token *token)
|
t_token *token
|
||||||
|
)
|
||||||
{
|
{
|
||||||
if (token != NULL)
|
if (token != NULL)
|
||||||
{
|
{
|
||||||
@@ -127,7 +131,8 @@ static void token_clear(
|
|||||||
static t_token *read_token(
|
static t_token *read_token(
|
||||||
t_token_type type,
|
t_token_type type,
|
||||||
const char *line,
|
const char *line,
|
||||||
size_t *i)
|
size_t *i
|
||||||
|
)
|
||||||
{
|
{
|
||||||
const size_t start = *i;
|
const size_t start = *i;
|
||||||
size_t end;
|
size_t end;
|
||||||
@@ -142,7 +147,8 @@ static t_token *read_token(
|
|||||||
|
|
||||||
static t_token *read_word(
|
static t_token *read_word(
|
||||||
const char *line,
|
const char *line,
|
||||||
size_t *i)
|
size_t *i
|
||||||
|
)
|
||||||
{
|
{
|
||||||
const size_t start = *i;
|
const size_t start = *i;
|
||||||
bool in_single_quote;
|
bool in_single_quote;
|
||||||
@@ -166,7 +172,9 @@ static t_token *read_word(
|
|||||||
return (token_new(TOKEN_WORD, ft_substr(line, start, *i - start)));
|
return (token_new(TOKEN_WORD, ft_substr(line, start, *i - start)));
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline bool is_meta(char c)
|
static inline bool is_meta(
|
||||||
|
char c
|
||||||
|
)
|
||||||
{
|
{
|
||||||
return (c == '|' || c == '<' || c == '>');
|
return (c == '|' || c == '<' || c == '>');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user