feat(lexer): comment handling + healthy changes

This commit is contained in:
Matteo Flebus 2026-01-21 18:43:17 +01:00
parent 03e5305b56
commit 306b13308b
4 changed files with 28 additions and 14 deletions

View file

@ -1,8 +1,8 @@
#ifndef LEXER_UTILS_H
#define LEXER_UTILS_H
#include <sys/types.h>
#include <stddef.h>
#include <sys/types.h>
struct lexer_context
{
@ -80,12 +80,17 @@ void free_token(struct token **tok);
/*
* @brief: checks if the stream used for the last token creation is empty.
* If it is, it calls stream_read() from IO_backend,
* and sets [remaing_chars].
* and sets [remaining_chars].
* If not, it starts from the end of the last token.
* Also trims left blanks before returning.
*
* @return: char* stream from which we tokenise.
*/
char *stream_init(struct lexer_context *ctx);
void stream_init(struct lexer_context *ctx);
/*
* @brief: drops the current stream and asks IOB for a new one
*/
void get_next_stream(struct lexer_context *ctx);
#endif /* LEXER_UTILS_H */