Fix check keyword

This commit is contained in:
Night Kaly 2025-02-23 13:02:17 +00:00
parent 02dc8be134
commit 46f056a0b3
Signed by: night0721
SSH key fingerprint: SHA256:B/hgVwUoBpx5vdNsXl9w8XwZljA9766uk6T4ubZp5HM

2
jay.h
View file

@ -159,7 +159,7 @@ token number()
token_type check_keyword(int length, const char *rest, token_type type)
{
if ((lexer_current - start) == 5 && memcmp(start + 1, rest, length - 1) == 0) {
if ((lexer_current - start) == length && memcmp(start + 1, rest, length - 1) == 0) {
return type;
}
fprintf(stderr, "jay: Unknown keyword \"%.*s\" at line %d\n", length, start, line);