generated code update + reverting some fixes for now...

This commit is contained in:
Edward R. Gonzalez 2024-10-25 02:59:56 -04:00
parent 40a256f6c3
commit e5616c5879
9 changed files with 361 additions and 319 deletions

View File

@ -6,6 +6,7 @@
// This is a simple file reader that reads the entire file into memory. // This is a simple file reader that reads the entire file into memory.
// It has an extra option to skip the first few lines for undesired includes. // It has an extra option to skip the first few lines for undesired includes.
// This is done so that includes can be kept in dependency and component files so that intellisense works. // This is done so that includes can be kept in dependency and component files so that intellisense works.
inline
Code scan_file( char const* path ) Code scan_file( char const* path )
{ {
FileInfo file; FileInfo file;

File diff suppressed because it is too large Load Diff

View File

@ -72,7 +72,7 @@ namespace ECode
NumTypes NumTypes
}; };
StrC to_str( Type type ) inline StrC to_str( Type type )
{ {
local_persist StrC lookup[] { local_persist StrC lookup[] {
{ sizeof( "Invalid" ), "Invalid" }, { sizeof( "Invalid" ), "Invalid" },

View File

@ -59,7 +59,7 @@ namespace EOperator
NumOps NumOps
}; };
StrC to_str( Type op ) inline StrC to_str( Type op )
{ {
local_persist StrC lookup[] { local_persist StrC lookup[] {
{ sizeof( "INVALID" ), "INVALID" }, { sizeof( "INVALID" ), "INVALID" },

View File

@ -38,12 +38,12 @@ namespace ESpecifier
NumSpecifiers NumSpecifiers
}; };
bool is_trailing( Type specifier ) inline bool is_trailing( Type specifier )
{ {
return specifier > Virtual; return specifier > Virtual;
} }
StrC to_str( Type type ) inline StrC to_str( Type type )
{ {
local_persist StrC lookup[] { local_persist StrC lookup[] {
{ sizeof( "INVALID" ), "INVALID" }, { sizeof( "INVALID" ), "INVALID" },
@ -76,7 +76,7 @@ namespace ESpecifier
return lookup[type]; return lookup[type];
} }
Type to_type( StrC str ) inline Type to_type( StrC str )
{ {
local_persist u32 keymap[NumSpecifiers]; local_persist u32 keymap[NumSpecifiers];
do_once_start for ( u32 index = 0; index < NumSpecifiers; index++ ) do_once_start for ( u32 index = 0; index < NumSpecifiers; index++ )

View File

@ -113,7 +113,7 @@ namespace parser
NumTokens NumTokens
}; };
StrC to_str( Type type ) inline StrC to_str( Type type )
{ {
local_persist StrC lookup[] { local_persist StrC lookup[] {
{ sizeof( "__invalid__" ), "__invalid__" }, { sizeof( "__invalid__" ), "__invalid__" },
@ -217,7 +217,7 @@ namespace parser
return lookup[type]; return lookup[type];
} }
Type to_type( StrC str ) inline Type to_type( StrC str )
{ {
local_persist u32 keymap[NumTokens]; local_persist u32 keymap[NumTokens];
do_once_start for ( u32 index = 0; index < NumTokens; index++ ) do_once_start for ( u32 index = 0; index < NumTokens; index++ )

View File

@ -586,7 +586,7 @@ TokArray lex( StrC content )
{ {
s32 length = 0; s32 length = 0;
char const* scanner = entry.Data; char const* scanner = entry.Data;
while ( entry.length() > length && char_is_alphanumeric( *scanner ) || *scanner == '_' ) while ( entry.length() > length && (char_is_alphanumeric( *scanner ) || *scanner == '_') )
{ {
scanner++; scanner++;
length ++; length ++;

View File

@ -2699,7 +2699,7 @@ CodeParam parse_params( bool use_template_capture )
s32 capture_level = 0; s32 capture_level = 0;
s32 template_level = 0; s32 template_level = 0;
while ( left && ( currtok.Type != TokType::Comma ) && template_level >= 0 && CheckEndParams() || capture_level > 0 || template_level > 0 ) while ( left && ( currtok.Type != TokType::Comma ) && template_level >= 0 && (CheckEndParams() || capture_level > 0 || template_level > 0) )
{ {
if (currtok.Text[ 0 ] == '<') if (currtok.Text[ 0 ] == '<')
++ template_level; ++ template_level;
@ -2814,7 +2814,7 @@ CodeParam parse_params( bool use_template_capture )
while ( left while ( left
&& currtok.Type != TokType::Comma && currtok.Type != TokType::Comma
&& template_level >= 0 && template_level >= 0
&& CheckEndParams() || capture_level > 0 || template_level > 0 ) && (CheckEndParams() || capture_level > 0 || template_level > 0) )
{ {
if (currtok.Text[ 0 ] == '<') if (currtok.Text[ 0 ] == '<')
++ template_level; ++ template_level;
@ -4510,6 +4510,18 @@ else if ( currtok.Type == TokType::DeclType )
name = currtok; name = currtok;
eat(TokType::Type_Typename); eat(TokType::Type_Typename);
// <typename> // <typename>
if ( ! from_template )
{
name = parse_identifier();
Context.Scope->Name = name;
if ( ! name )
{
log_failure( "Error, failed to type signature\n%s", Context.to_string() );
Context.pop();
return CodeInvalid;
}
}
} }
// The usual Identifier type signature that may have namespace qualifiers // The usual Identifier type signature that may have namespace qualifiers

View File

@ -13,7 +13,7 @@
#define internal static // Internal linkage #define internal static // Internal linkage
#define local_persist static // Local Persisting variables #define local_persist static // Local Persisting variables
#pragma region ForceInline_Definition #pragma region ForceInline Definition
#ifdef GEN_COMPILER_MSVC #ifdef GEN_COMPILER_MSVC
# define forceinline __forceinline # define forceinline __forceinline
# define neverinline __declspec( noinline ) # define neverinline __declspec( noinline )
@ -32,7 +32,7 @@
# define forceinline # define forceinline
# define neverinline # define neverinline
#endif #endif
#pragma endregion ForceInline_Definition #pragma endregion ForceInline Definition
// Bits // Bits