Merge pull request #13451 from vyuuui/numeric_labels

Add numeric label support to assembler
This commit is contained in:
Tilka
2025-04-25 01:56:43 +01:00
committed by GitHub
7 changed files with 224 additions and 9 deletions

View File

@ -35,6 +35,8 @@ public:
{
switch (type)
{
case Terminal::NumLabFwd:
case Terminal::NumLabBwd:
case Terminal::Id:
HighlightCurToken(HighlightFormat::Symbol);
break;
@ -119,6 +121,13 @@ public:
m_formatting.emplace_back(len, off, HighlightFormat::Symbol);
}
void OnNumericLabelDecl(std::string_view name, u32 parse_num) override
{
const int len = static_cast<int>(m_owner->lexer.LookaheadRef().token_val.length());
const int off = static_cast<int>(m_owner->lexer.ColNumber());
m_formatting.emplace_back(len, off, HighlightFormat::Symbol);
}
void OnVarDecl(std::string_view name) override { OnLabelDecl(name); }
private: