lexer: comments

This commit is contained in:
2026-04-21 22:57:49 +02:00
parent 6bc9249094
commit 754fd13dfd
4 changed files with 90 additions and 3 deletions

View File

@@ -39,7 +39,7 @@ int noomP_peek(noomP_Parser* parser, noomL_Token* token) {
int success = noomL_lex(parser->code, parser->lex_offset, token, parser->version);
if (success != 0) return -1; // TODO: proper error propogation and stuff
if (token->type == NOOML_TOKEN_WHITESPACE) {
if (token->type == NOOML_TOKEN_WHITESPACE || token->type == NOOML_TOKEN_COMMENT) {
// peek changes state, but only if it's one of these useless tokens anyway.
parser->lex_offset += token->length;
continue;