Allow "_" characters in identifiers

This commit is contained in:
Username404 2021-12-22 20:38:08 +01:00
parent ca07ff1208
commit a16e4ef4b2
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
1 changed files with 1 additions and 1 deletions

View File

@ -3,7 +3,7 @@ using namespace std;
using enum tok::type; using enum tok::type;
tok::type getIdentifierCharType(const char& Char) { tok::type getIdentifierCharType(const char& Char) {
if (isalpha(Char)) return IDENTIFIER; if (isalpha(Char) || Char == '_') return IDENTIFIER;
else if (isdigit(Char)) return NUMBER; else if (isdigit(Char)) return NUMBER;
else if (Char == STRING) return STRING; else if (Char == STRING) return STRING;
else return UNEXPECTED; else return UNEXPECTED;