Skip to content

Commit

Permalink
Simplify loop
Browse files Browse the repository at this point in the history
  • Loading branch information
fuhsnn committed Dec 29, 2024
1 parent 2a9c631 commit d4ed26b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tokenize.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,15 @@ static Token *new_token(TokenKind kind, char *start, char *end) {
static int read_ident(char *p) {
char *start = p;

for (bool is_first = true;; is_first = false) {
for (;;) {
if (Isalnum(*p) || *p == '_' || *p == '$') {
p++;
continue;
}
if ((unsigned char)*p >= 128) {
char *pos;
uint32_t c = decode_utf8(&pos, p);
if (is_first ? is_ident1(c) : is_ident2(c)) {
if (p == start ? is_ident1(c) : is_ident2(c)) {
p = pos;
continue;
}
Expand Down

0 comments on commit d4ed26b

Please sign in to comment.