We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 87ed8e4 + b40ec98 commit fe9ad6fCopy full SHA for fe9ad6f
interpreter/src/Lexer.cpp
@@ -192,11 +192,17 @@ Token Lexer::id()
192
std::string result;
193
std::map<std::string, Token> RESERVED_KEYWORDS = getReservedKeywords();
194
195
- while (_currentChar != '\0' && (isalnum(_currentChar) || _currentChar == '(' || _currentChar == ')')) {
+ while (_currentChar != '\0' && isalnum(_currentChar)) {
196
result += _currentChar;
197
advance();
198
}
199
200
+ if (_currentChar == '(' && peekNextChar() == ')') {
201
+ result += "()";
202
+ advance();
203
204
+ }
205
+
206
if (RESERVED_KEYWORDS.count(result)) {
207
return RESERVED_KEYWORDS.at(result);
208
} else {
0 commit comments