init parser
This commit is contained in:
@@ -1,7 +1,4 @@
|
||||
#include "lexer.h"
|
||||
#include "libft.h"
|
||||
#include "errors.h"
|
||||
#include <stdbool.h>
|
||||
|
||||
// any single letter is a valid variable, like 'x' or 'y'
|
||||
static bool token_is_variable(const char *input, int input_pos, int *token_size)
|
||||
@@ -153,7 +150,7 @@ static bool token_is_equal(const char *input, int input_pos, int *token_size)
|
||||
/**
|
||||
* LEXER
|
||||
*/
|
||||
void lexerize(const char *input, token *tokens)
|
||||
int lexerize(const char *input, token *tokens)
|
||||
{
|
||||
int token_count;
|
||||
int input_pos;
|
||||
@@ -222,4 +219,6 @@ void lexerize(const char *input, token *tokens)
|
||||
|
||||
tokens[token_count].type = TOKEN_END;
|
||||
tokens[token_count].value_char = '\0';
|
||||
|
||||
return token_count;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user