Fix check keyword
This commit is contained in:
parent
02dc8be134
commit
46f056a0b3
1 changed files with 1 additions and 1 deletions
2
jay.h
2
jay.h
|
@ -159,7 +159,7 @@ token number()
|
||||||
|
|
||||||
token_type check_keyword(int length, const char *rest, token_type type)
|
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;
|
return type;
|
||||||
}
|
}
|
||||||
fprintf(stderr, "jay: Unknown keyword \"%.*s\" at line %d\n", length, start, line);
|
fprintf(stderr, "jay: Unknown keyword \"%.*s\" at line %d\n", length, start, line);
|
||||||
|
|
Loading…
Reference in a new issue