From a16e4ef4b24883535159cfd11bcb68979fa7870c Mon Sep 17 00:00:00 2001 From: Username404 Date: Wed, 22 Dec 2021 20:38:08 +0100 Subject: [PATCH] Allow "_" characters in identifiers --- src/etc/lexer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/etc/lexer.cpp b/src/etc/lexer.cpp index 6026624..09024da 100644 --- a/src/etc/lexer.cpp +++ b/src/etc/lexer.cpp @@ -3,7 +3,7 @@ using namespace std; using enum tok::type; 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 (Char == STRING) return STRING; else return UNEXPECTED;