linters, some ast headers

This commit is contained in:
2024-12-18 22:34:22 +02:00
parent c2915d2eaa
commit 7361b6058d
8 changed files with 184 additions and 48 deletions

View File

@@ -63,7 +63,7 @@ const keyword_map keywords[] = {
};
// TODO binary search
static tokenizer_tag get_keyword(const char* bytes, uint32_t len)
static tokenizer_tag get_keyword(const char* bytes, const uint32_t len)
{
for (unsigned long i = 0; i < sizeof(keywords) / sizeof(keyword_map); i++) {
size_t klen = strlen(keywords[i].keyword);
@@ -78,12 +78,11 @@ static tokenizer_tag get_keyword(const char* bytes, uint32_t len)
} else if (cmp < 0) {
return TOKENIZER_TAG_INVALID;
}
continue;
}
return TOKENIZER_TAG_INVALID;
}
tokenizer tokenizer_init(const char* buffer, uint32_t len)
tokenizer tokenizer_init(const char* buffer, const uint32_t len)
{
return (tokenizer) {
.buffer = buffer,