Update scanner.c
removed keyword match and added switch
@@ -218,8 +218,6 @@ static TokenType identifierType(Scanner *scanner) {
}
}
break;
- case 'm':
- return checkKeyword(scanner, 1, 4, "atch", TOKEN_MATCH);
case 'o':
return checkKeyword(scanner, 1, 1, "r", TOKEN_OR);
case 'p':
@@ -240,10 +238,12 @@ static TokenType identifierType(Scanner *scanner) {
case 's':
if (scanner->current - scanner->start > 1) {
switch (scanner->start[1]) {
- case 'u':
- return checkKeyword(scanner, 2, 3, "per", TOKEN_SUPER);
case 't':
return checkKeyword(scanner, 2, 4, "atic", TOKEN_STATIC);
+ case 'u':
+ return checkKeyword(scanner, 2, 3, "per", TOKEN_SUPER);
+ case 'w':
+ return checkKeyword(scanner, 1, 4, "itch", TOKEN_SWITCH);
}
}
break;
