Skip to content

Commit

Permalink
[preproc] support C23 enum underlying type syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
mrgriffin committed Oct 10, 2024
1 parent 9a24c03 commit c4814b1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tools/preproc/asm_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,17 @@ bool AsmFile::ParseEnum()
long enumCounter = 0;
long symbolCount = 0;

if (m_buffer[m_pos] == ':') // : <type>
{
m_pos++;
std::string underlyingType;
do {
currentHeaderLine += SkipWhitespaceAndEol();
underlyingType = ReadIdentifier();
} while (!underlyingType.empty());
currentHeaderLine += SkipWhitespaceAndEol();
}

if (m_buffer[m_pos] != '{') // assume assembly macro, otherwise assume enum and report errors accordingly
{
m_pos = fallbackPosition - 4;
Expand Down

0 comments on commit c4814b1

Please sign in to comment.