mirror of
https://github.com/Ed94/gencpp.git
synced 2025-06-30 19:01:02 -07:00
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:
@ -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;
|
||||
|
Reference in New Issue
Block a user