WIP : Fixes and other changes

* Number literals weren't getting properly lexed
* Fixes for compiler errors with Unreal Engine configuration.
* Support for "post-name" macros in parameters
* Support for variables initializing directly using constructor syntax.
* Explicitly added inline keyword to header inlines for compiling compile library in multiple translation units.
This commit is contained in:
2024-10-25 01:04:17 -04:00
parent e1592ba410
commit b8e1aa6eb7
20 changed files with 248 additions and 94 deletions

View File

@ -586,7 +586,7 @@ TokArray lex( StrC content )
{
s32 length = 0;
char const* scanner = entry.Data;
while ( entry.length() > length && (char_is_alphanumeric( *scanner ) || *scanner == '_') )
while ( entry.length() > length && char_is_alphanumeric( *scanner ) || *scanner == '_' )
{
scanner++;
length ++;
@ -1202,6 +1202,26 @@ TokArray lex( StrC content )
move_forward();
token.Length++;
}
// Handle number literal suffixes in a botched way
if (left && (
current == 'l' || current == 'L' || // long/long long
current == 'u' || current == 'U' || // unsigned
current == 'f' || current == 'F' || // float
current == 'i' || current == 'I' || // imaginary
current == 'z' || current == 'Z')) // complex
{
char prev = current;
move_forward();
token.Length++;
// Handle 'll'/'LL' as a special case when we just processed an 'l'/'L'
if (left && (prev == 'l' || prev == 'L') && (current == 'l' || current == 'L'))
{
move_forward();
token.Length++;
}
}
}
goto FoundToken;