fix: Fixed ALL the code
This commit is contained in:
parent
03c35d5366
commit
97b7240286
10 changed files with 68 additions and 11 deletions
|
|
@ -1,13 +1,16 @@
|
|||
#include "lexer.h"
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "io_backend/io_backend.h"
|
||||
|
||||
static char *end_last_token;
|
||||
static ssize_t remaining_chars;
|
||||
|
||||
char *new_token(char *begin, size_t size)
|
||||
char *new_token(char *begin, ssize_t size)
|
||||
{
|
||||
char *res = calloc(size + 1, sizeof(char));
|
||||
if (res == NULL)
|
||||
|
|
@ -56,6 +59,7 @@ char *get_token(void)
|
|||
// skip blank char
|
||||
// exit from loop
|
||||
char *token = new_token(stream, i);
|
||||
return token;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
|
|
@ -64,4 +68,5 @@ char *get_token(void)
|
|||
}
|
||||
|
||||
remaining_chars -= i;
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue