Add numeric label support to assembler

This commit is contained in:
vyuuui
2025-03-24 07:16:14 -07:00
parent 5d4b884e64
commit e34907025d
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: