did stuff, done stuff

This commit is contained in:
Maieul BOYER 2024-08-31 18:48:20 +00:00
parent 4a8fb259dc
commit 62a4f377a1
37 changed files with 325 additions and 399 deletions

View file

@ -18,20 +18,20 @@
bool ts_lexer__eof(const TSLexer *_self);
t_u32 ts_lexer__get_column(TSLexer *_self);
void ts_lexer__advance(TSLexer *_self, bool skip);
void ts_lexer__clear_chunk(Lexer *self);
void ts_lexer__get_chunk(Lexer *self);
void ts_lexer__get_lookahead(Lexer *self);
void ts_lexer__clear_chunk(t_lexer *self);
void ts_lexer__get_chunk(t_lexer *self);
void ts_lexer__get_lookahead(t_lexer *self);
void ts_lexer__mark_end(TSLexer *_self);
void ts_lexer_advance_to_end(Lexer *self);
void ts_lexer_goto(Lexer *self, Length position);
void ts_lexer_advance_to_end(t_lexer *self);
void ts_lexer_goto(t_lexer *self, Length position);
void ts_lexer_init(Lexer *self)
void ts_lexer_init(t_lexer *self)
{
static TSRange default_range = {.start_point = {\
.row = 0, .column = 0, }, .end_point = {.row = UINT32_MAX, \
.column = UINT32_MAX, }, .start_byte = 0, .end_byte = UINT32_MAX};
*self = (Lexer){
*self = (t_lexer){
.data = {
.advance = ts_lexer__advance,
.mark_end = ts_lexer__mark_end,
@ -49,20 +49,20 @@ void ts_lexer_init(Lexer *self)
};
}
void ts_lexer_set_input(Lexer *self, TSInput input)
void ts_lexer_set_input(t_lexer *self, TSInput input)
{
self->input = input;
ts_lexer__clear_chunk(self);
ts_lexer_goto(self, self->current_position);
}
void ts_lexer_reset(Lexer *self, Length position)
void ts_lexer_reset(t_lexer *self, Length position)
{
if (position.bytes != self->current_position.bytes)
ts_lexer_goto(self, position);
}
void ts_lexer_start(Lexer *self)
void ts_lexer_start(t_lexer *self)
{
self->token_start_position = self->current_position;
self->token_end_position = LENGTH_UNDEFINED;
@ -80,7 +80,7 @@ void ts_lexer_start(Lexer *self)
}
}
void ts_lexer_finish(Lexer *self, t_u32 *lookahead_end_byte)
void ts_lexer_finish(t_lexer *self, t_u32 *lookahead_end_byte)
{
if (length_is_undefined(self->token_end_position))
ts_lexer__mark_end(&self->data);