Remove peek function
This commit is contained in:
parent
e5830daac9
commit
5cdb60d395
11
src/lexer.c
11
src/lexer.c
@ -150,17 +150,6 @@ void lexer_shift_buffer(lexer_t *lex, int n) {
|
|||||||
memmove(lex->buffer, lex->buffer + n, lex->buffer_count);
|
memmove(lex->buffer, lex->buffer + n, lex->buffer_count);
|
||||||
}
|
}
|
||||||
|
|
||||||
error_t *lexer_peek(lexer_t *lex, char *c) {
|
|
||||||
error_t *err = lexer_fill_buffer(lex);
|
|
||||||
if (err)
|
|
||||||
return err;
|
|
||||||
if (lex->buffer_count == 0)
|
|
||||||
return err_eof;
|
|
||||||
*c = lex->buffer[0];
|
|
||||||
lexer_shift_buffer(lex, 1);
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if the lexer's buffer starts with the given prefix.
|
* Checks if the lexer's buffer starts with the given prefix.
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user