mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Implement . string constant for the current label scope (#1499)
This commit is contained in:
@@ -327,8 +327,6 @@ static std::unordered_map<std::string, int, CaseInsensitive, CaseInsensitive> ke
|
||||
{"POPO", T_(POP_POPO) },
|
||||
|
||||
{"OPT", T_(POP_OPT) },
|
||||
|
||||
{".", T_(PERIOD) },
|
||||
};
|
||||
|
||||
static bool isWhitespace(int c) {
|
||||
@@ -1173,6 +1171,10 @@ static Token readIdentifier(char firstChar, bool raw) {
|
||||
return Token(search->second);
|
||||
}
|
||||
|
||||
// Label scope `.` is the only nonlocal identifier that starts with a dot
|
||||
if (identifier.find_first_not_of('.') == identifier.npos)
|
||||
tokenType = T_(ID);
|
||||
|
||||
return Token(tokenType, identifier);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user