diff --git a/src/asm/lexer.cpp b/src/asm/lexer.cpp index 63c814d1..632f623a 100644 --- a/src/asm/lexer.cpp +++ b/src/asm/lexer.cpp @@ -1203,8 +1203,6 @@ static Token readIdentifier(char firstChar, bool raw) { builder += c; } - InternedStr identifier = intern(builder); - // Check for a keyword if the identifier is not raw and not a local label if (!raw && tokenType != T_(LOCAL)) { if (auto search = keywords.find(builder); search != keywords.end()) { @@ -1212,6 +1210,8 @@ static Token readIdentifier(char firstChar, bool raw) { } } + InternedStr identifier = intern(builder); + // Label scopes `.` and `..` are the only nonlocal identifiers that start with a dot if (sym_IsDotScope(identifier)) { tokenType = T_(SYMBOL); @@ -1285,13 +1285,13 @@ static std::pair> readInterpolation return {nullptr, nullptr}; } - InternedStr identifier = intern(builder); + InternedStr symName = intern(builder); - if (Symbol const *sym = sym_FindScopedValidSymbol(identifier); !sym || !sym->isDefined()) { - if (sym_IsPurgedScoped(identifier)) { - error("Interpolated symbol `%s` does not exist; it was purged", identifier.c_str()); + if (Symbol const *sym = sym_FindScopedValidSymbol(symName); !sym || !sym->isDefined()) { + if (sym_IsPurgedScoped(symName)) { + error("Interpolated symbol `%s` does not exist; it was purged", symName.c_str()); } else { - error("Interpolated symbol `%s` does not exist", identifier.c_str()); + error("Interpolated symbol `%s` does not exist", symName.c_str()); } return {sym, nullptr}; } else if (sym->type == SYM_EQUS) { @@ -1303,7 +1303,7 @@ static std::pair> readInterpolation fmt.appendNumber(*buf, sym->getConstantValue()); return {sym, buf}; } else { - error("Interpolated symbol `%s` is not a numeric or string symbol", identifier.c_str()); + error("Interpolated symbol `%s` is not a numeric or string symbol", symName.c_str()); return {sym, nullptr}; } }