diff --git a/.vscode/settings.json b/.vscode/settings.json index 1e55a3a..6e65a84 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -49,5 +49,7 @@ "**/.vscode": true, "**/.vs": true, "**/sanity.gen.hpp": true - } + }, + "autoHide.autoHidePanel": false, + "autoHide.autoHideSideBar": false } diff --git a/gencpp.10x b/gencpp.10x index 727ea92..8c23851 100644 --- a/gencpp.10x +++ b/gencpp.10x @@ -11,7 +11,7 @@ pwsh ./scripts/build.ps1 msvc debug bootstrap - psh ./scripts/clean.ps1 + pwsh ./scripts/clean.ps1 ./test/gen/build/gencpp.exe diff --git a/gencpp.vcxproj b/gencpp.vcxproj index 8673ba2..d31feaa 100644 --- a/gencpp.vcxproj +++ b/gencpp.vcxproj @@ -366,6 +366,9 @@ + + + diff --git a/project/auxillary/builder.cpp b/project/auxillary/builder.cpp index 3e7d5e4..fb98e5e 100644 --- a/project/auxillary/builder.cpp +++ b/project/auxillary/builder.cpp @@ -5,9 +5,8 @@ Builder Builder::open( char const* path ) { Builder result; - + FileError error = file_open_mode( & result.File, EFileMode_WRITE, path ); - if ( error != EFileError_NONE ) { log_failure( "gen::File::open - Could not open file: %s", path); diff --git a/project/auxillary/vis_ast/build.ps1 b/project/auxillary/vis_ast/build.ps1 index 0a127f7..7be2960 100644 --- a/project/auxillary/vis_ast/build.ps1 +++ b/project/auxillary/vis_ast/build.ps1 @@ -72,7 +72,7 @@ $path_raylib_inc = join-path $path_raylib 'include' $path_raylib_lib = join-path $path_raylib 'lib' $path_raylib_dll = join-path $path_raylib_lib 'raylib.dll' -$path_raylib_dll_bin = join-path $path_binaries 'raylib.dll' +$path_raylib_dll_bin = join-path $path_binaries 'raylib.dll' Copy-Item $path_raylib_dll $path_raylib_dll_bin -Force @@ -96,8 +96,8 @@ $lib_winmm = 'Winmm.lib' $stack_size = 1024 * 1024 * 4 $compiler_args = @( - ($flag_define + 'UNICODE'), - ($flag_define + '_UNICODE') + ( $flag_define + 'UNICODE'), + ( $flag_define + '_UNICODE') ( $flag_define + 'INTELLISENSE_DIRECTIVES=0'), ( $flag_define + 'RL_USE_LIBTYPE_SHARED') # ($flag_set_stack_size + $stack_size) diff --git a/project/components/gen/ecode.hpp b/project/components/gen/ecode.hpp index 82cef85..77f84f6 100644 --- a/project/components/gen/ecode.hpp +++ b/project/components/gen/ecode.hpp @@ -75,66 +75,66 @@ namespace ECode StrC to_str( Type type ) { local_persist StrC lookup[] { - {sizeof( "Invalid" ), "Invalid" }, - { sizeof( "Untyped" ), "Untyped" }, - { sizeof( "NewLine" ), "NewLine" }, - { sizeof( "Comment" ), "Comment" }, - { sizeof( "Access_Private" ), "Access_Private" }, - { sizeof( "Access_Protected" ), "Access_Protected" }, - { sizeof( "Access_Public" ), "Access_Public" }, - { sizeof( "PlatformAttributes" ), "PlatformAttributes" }, - { sizeof( "Class" ), "Class" }, - { sizeof( "Class_Fwd" ), "Class_Fwd" }, - { sizeof( "Class_Body" ), "Class_Body" }, - { sizeof( "Constructor" ), "Constructor" }, - { sizeof( "Constructor_Fwd" ), "Constructor_Fwd" }, - { sizeof( "Destructor" ), "Destructor" }, - { sizeof( "Destructor_Fwd" ), "Destructor_Fwd" }, - { sizeof( "Enum" ), "Enum" }, - { sizeof( "Enum_Fwd" ), "Enum_Fwd" }, - { sizeof( "Enum_Body" ), "Enum_Body" }, - { sizeof( "Enum_Class" ), "Enum_Class" }, - { sizeof( "Enum_Class_Fwd" ), "Enum_Class_Fwd" }, - { sizeof( "Execution" ), "Execution" }, - { sizeof( "Export_Body" ), "Export_Body" }, - { sizeof( "Extern_Linkage" ), "Extern_Linkage" }, - { sizeof( "Extern_Linkage_Body" ), "Extern_Linkage_Body"}, - { sizeof( "Friend" ), "Friend" }, - { sizeof( "Function" ), "Function" }, - { sizeof( "Function_Fwd" ), "Function_Fwd" }, - { sizeof( "Function_Body" ), "Function_Body" }, - { sizeof( "Global_Body" ), "Global_Body" }, - { sizeof( "Module" ), "Module" }, - { sizeof( "Namespace" ), "Namespace" }, - { sizeof( "Namespace_Body" ), "Namespace_Body" }, - { sizeof( "Operator" ), "Operator" }, - { sizeof( "Operator_Fwd" ), "Operator_Fwd" }, - { sizeof( "Operator_Member" ), "Operator_Member" }, - { sizeof( "Operator_Member_Fwd" ), "Operator_Member_Fwd"}, - { sizeof( "Operator_Cast" ), "Operator_Cast" }, - { sizeof( "Operator_Cast_Fwd" ), "Operator_Cast_Fwd" }, - { sizeof( "Parameters" ), "Parameters" }, - { sizeof( "Preprocess_Define" ), "Preprocess_Define" }, - { sizeof( "Preprocess_Include" ), "Preprocess_Include" }, - { sizeof( "Preprocess_If" ), "Preprocess_If" }, - { sizeof( "Preprocess_IfDef" ), "Preprocess_IfDef" }, - { sizeof( "Preprocess_IfNotDef" ), "Preprocess_IfNotDef"}, - { sizeof( "Preprocess_ElIf" ), "Preprocess_ElIf" }, - { sizeof( "Preprocess_Else" ), "Preprocess_Else" }, - { sizeof( "Preprocess_EndIf" ), "Preprocess_EndIf" }, - { sizeof( "Preprocess_Pragma" ), "Preprocess_Pragma" }, - { sizeof( "Specifiers" ), "Specifiers" }, - { sizeof( "Struct" ), "Struct" }, - { sizeof( "Struct_Fwd" ), "Struct_Fwd" }, - { sizeof( "Struct_Body" ), "Struct_Body" }, - { sizeof( "Template" ), "Template" }, - { sizeof( "Typedef" ), "Typedef" }, - { sizeof( "Typename" ), "Typename" }, - { sizeof( "Union" ), "Union" }, - { sizeof( "Union_Body" ), "Union_Body" }, - { sizeof( "Using" ), "Using" }, - { sizeof( "Using_Namespace" ), "Using_Namespace" }, - { sizeof( "Variable" ), "Variable" }, + { sizeof( "Invalid" ), "Invalid" }, + { sizeof( "Untyped" ), "Untyped" }, + { sizeof( "NewLine" ), "NewLine" }, + { sizeof( "Comment" ), "Comment" }, + { sizeof( "Access_Private" ), "Access_Private" }, + { sizeof( "Access_Protected" ), "Access_Protected" }, + { sizeof( "Access_Public" ), "Access_Public" }, + { sizeof( "PlatformAttributes" ), "PlatformAttributes" }, + { sizeof( "Class" ), "Class" }, + { sizeof( "Class_Fwd" ), "Class_Fwd" }, + { sizeof( "Class_Body" ), "Class_Body" }, + { sizeof( "Constructor" ), "Constructor" }, + { sizeof( "Constructor_Fwd" ), "Constructor_Fwd" }, + { sizeof( "Destructor" ), "Destructor" }, + { sizeof( "Destructor_Fwd" ), "Destructor_Fwd" }, + { sizeof( "Enum" ), "Enum" }, + { sizeof( "Enum_Fwd" ), "Enum_Fwd" }, + { sizeof( "Enum_Body" ), "Enum_Body" }, + { sizeof( "Enum_Class" ), "Enum_Class" }, + { sizeof( "Enum_Class_Fwd" ), "Enum_Class_Fwd" }, + { sizeof( "Execution" ), "Execution" }, + { sizeof( "Export_Body" ), "Export_Body" }, + { sizeof( "Extern_Linkage" ), "Extern_Linkage" }, + { sizeof( "Extern_Linkage_Body" ), "Extern_Linkage_Body" }, + { sizeof( "Friend" ), "Friend" }, + { sizeof( "Function" ), "Function" }, + { sizeof( "Function_Fwd" ), "Function_Fwd" }, + { sizeof( "Function_Body" ), "Function_Body" }, + { sizeof( "Global_Body" ), "Global_Body" }, + { sizeof( "Module" ), "Module" }, + { sizeof( "Namespace" ), "Namespace" }, + { sizeof( "Namespace_Body" ), "Namespace_Body" }, + { sizeof( "Operator" ), "Operator" }, + { sizeof( "Operator_Fwd" ), "Operator_Fwd" }, + { sizeof( "Operator_Member" ), "Operator_Member" }, + { sizeof( "Operator_Member_Fwd" ), "Operator_Member_Fwd" }, + { sizeof( "Operator_Cast" ), "Operator_Cast" }, + { sizeof( "Operator_Cast_Fwd" ), "Operator_Cast_Fwd" }, + { sizeof( "Parameters" ), "Parameters" }, + { sizeof( "Preprocess_Define" ), "Preprocess_Define" }, + { sizeof( "Preprocess_Include" ), "Preprocess_Include" }, + { sizeof( "Preprocess_If" ), "Preprocess_If" }, + { sizeof( "Preprocess_IfDef" ), "Preprocess_IfDef" }, + { sizeof( "Preprocess_IfNotDef" ), "Preprocess_IfNotDef" }, + { sizeof( "Preprocess_ElIf" ), "Preprocess_ElIf" }, + { sizeof( "Preprocess_Else" ), "Preprocess_Else" }, + { sizeof( "Preprocess_EndIf" ), "Preprocess_EndIf" }, + { sizeof( "Preprocess_Pragma" ), "Preprocess_Pragma" }, + { sizeof( "Specifiers" ), "Specifiers" }, + { sizeof( "Struct" ), "Struct" }, + { sizeof( "Struct_Fwd" ), "Struct_Fwd" }, + { sizeof( "Struct_Body" ), "Struct_Body" }, + { sizeof( "Template" ), "Template" }, + { sizeof( "Typedef" ), "Typedef" }, + { sizeof( "Typename" ), "Typename" }, + { sizeof( "Union" ), "Union" }, + { sizeof( "Union_Body" ), "Union_Body" }, + { sizeof( "Using" ), "Using" }, + { sizeof( "Using_Namespace" ), "Using_Namespace" }, + { sizeof( "Variable" ), "Variable" }, }; return lookup[ type ]; } diff --git a/project/components/gen/eoperator.hpp b/project/components/gen/eoperator.hpp index a26e8ce..1e6e7f1 100644 --- a/project/components/gen/eoperator.hpp +++ b/project/components/gen/eoperator.hpp @@ -58,49 +58,49 @@ namespace EOperator StrC to_str( Type op ) { local_persist StrC lookup[] { - {sizeof( "INVALID" ), "INVALID"}, - { sizeof( "=" ), "=" }, - { sizeof( "+=" ), "+=" }, - { sizeof( "-=" ), "-=" }, - { sizeof( "*=" ), "*=" }, - { sizeof( "/=" ), "/=" }, - { sizeof( "%=" ), "%=" }, - { sizeof( "&=" ), "&=" }, - { sizeof( "|=" ), "|=" }, - { sizeof( "^=" ), "^=" }, - { sizeof( "<<=" ), "<<=" }, - { sizeof( ">>=" ), ">>=" }, - { sizeof( "++" ), "++" }, - { sizeof( "--" ), "--" }, - { sizeof( "+" ), "+" }, - { sizeof( "-" ), "-" }, - { sizeof( "!" ), "!" }, - { sizeof( "+" ), "+" }, - { sizeof( "-" ), "-" }, - { sizeof( "*" ), "*" }, - { sizeof( "/" ), "/" }, - { sizeof( "%" ), "%" }, - { sizeof( "~" ), "~" }, - { sizeof( "&" ), "&" }, - { sizeof( "|" ), "|" }, - { sizeof( "^" ), "^" }, - { sizeof( "<<" ), "<<" }, - { sizeof( ">>" ), ">>" }, - { sizeof( "&&" ), "&&" }, - { sizeof( "||" ), "||" }, - { sizeof( "==" ), "==" }, - { sizeof( "!=" ), "!=" }, - { sizeof( "<" ), "<" }, - { sizeof( ">" ), ">" }, - { sizeof( "<=" ), "<=" }, - { sizeof( ">=" ), ">=" }, - { sizeof( "[]" ), "[]" }, - { sizeof( "*" ), "*" }, - { sizeof( "&" ), "&" }, - { sizeof( "->" ), "->" }, - { sizeof( "->*" ), "->*" }, - { sizeof( "()" ), "()" }, - { sizeof( "," ), "," }, + { sizeof( "INVALID" ), "INVALID" }, + { sizeof( "=" ), "=" }, + { sizeof( "+=" ), "+=" }, + { sizeof( "-=" ), "-=" }, + { sizeof( "*=" ), "*=" }, + { sizeof( "/=" ), "/=" }, + { sizeof( "%=" ), "%=" }, + { sizeof( "&=" ), "&=" }, + { sizeof( "|=" ), "|=" }, + { sizeof( "^=" ), "^=" }, + { sizeof( "<<=" ), "<<=" }, + { sizeof( ">>=" ), ">>=" }, + { sizeof( "++" ), "++" }, + { sizeof( "--" ), "--" }, + { sizeof( "+" ), "+" }, + { sizeof( "-" ), "-" }, + { sizeof( "!" ), "!" }, + { sizeof( "+" ), "+" }, + { sizeof( "-" ), "-" }, + { sizeof( "*" ), "*" }, + { sizeof( "/" ), "/" }, + { sizeof( "%" ), "%" }, + { sizeof( "~" ), "~" }, + { sizeof( "&" ), "&" }, + { sizeof( "|" ), "|" }, + { sizeof( "^" ), "^" }, + { sizeof( "<<" ), "<<" }, + { sizeof( ">>" ), ">>" }, + { sizeof( "&&" ), "&&" }, + { sizeof( "||" ), "||" }, + { sizeof( "==" ), "==" }, + { sizeof( "!=" ), "!=" }, + { sizeof( "<" ), "<" }, + { sizeof( ">" ), ">" }, + { sizeof( "<=" ), "<=" }, + { sizeof( ">=" ), ">=" }, + { sizeof( "[]" ), "[]" }, + { sizeof( "*" ), "*" }, + { sizeof( "&" ), "&" }, + { sizeof( "->" ), "->" }, + { sizeof( "->*" ), "->*" }, + { sizeof( "()" ), "()" }, + { sizeof( "," ), "," }, }; return lookup[ op ]; } diff --git a/project/components/gen/especifier.hpp b/project/components/gen/especifier.hpp index ee4a77d..8184187 100644 --- a/project/components/gen/especifier.hpp +++ b/project/components/gen/especifier.hpp @@ -46,32 +46,32 @@ namespace ESpecifier StrC to_str( Type type ) { local_persist StrC lookup[] { - {sizeof( "INVALID" ), "INVALID" }, - { sizeof( "consteval" ), "consteval" }, - { sizeof( "constexpr" ), "constexpr" }, - { sizeof( "constinit" ), "constinit" }, - { sizeof( "explicit" ), "explicit" }, - { sizeof( "extern" ), "extern" }, - { sizeof( "forceinline" ), "forceinline" }, - { sizeof( "global" ), "global" }, - { sizeof( "inline" ), "inline" }, - { sizeof( "internal" ), "internal" }, - { sizeof( "local_persist" ), "local_persist"}, - { sizeof( "mutable" ), "mutable" }, - { sizeof( "neverinline" ), "neverinline" }, - { sizeof( "*" ), "*" }, - { sizeof( "&" ), "&" }, - { sizeof( "register" ), "register" }, - { sizeof( "&&" ), "&&" }, - { sizeof( "static" ), "static" }, - { sizeof( "thread_local" ), "thread_local" }, - { sizeof( "virtual" ), "virtual" }, - { sizeof( "const" ), "const" }, - { sizeof( "final" ), "final" }, - { sizeof( "noexcept" ), "noexcept" }, - { sizeof( "override" ), "override" }, - { sizeof( "= 0" ), "= 0" }, - { sizeof( "volatile" ), "volatile" }, + { sizeof( "INVALID" ), "INVALID" }, + { sizeof( "consteval" ), "consteval" }, + { sizeof( "constexpr" ), "constexpr" }, + { sizeof( "constinit" ), "constinit" }, + { sizeof( "explicit" ), "explicit" }, + { sizeof( "extern" ), "extern" }, + { sizeof( "forceinline" ), "forceinline" }, + { sizeof( "global" ), "global" }, + { sizeof( "inline" ), "inline" }, + { sizeof( "internal" ), "internal" }, + { sizeof( "local_persist" ), "local_persist" }, + { sizeof( "mutable" ), "mutable" }, + { sizeof( "neverinline" ), "neverinline" }, + { sizeof( "*" ), "*" }, + { sizeof( "&" ), "&" }, + { sizeof( "register" ), "register" }, + { sizeof( "&&" ), "&&" }, + { sizeof( "static" ), "static" }, + { sizeof( "thread_local" ), "thread_local" }, + { sizeof( "virtual" ), "virtual" }, + { sizeof( "const" ), "const" }, + { sizeof( "final" ), "final" }, + { sizeof( "noexcept" ), "noexcept" }, + { sizeof( "override" ), "override" }, + { sizeof( "= 0" ), "= 0" }, + { sizeof( "volatile" ), "volatile" }, }; return lookup[ type ]; } diff --git a/project/components/gen/etoktype.cpp b/project/components/gen/etoktype.cpp index 71916fb..63dae8c 100644 --- a/project/components/gen/etoktype.cpp +++ b/project/components/gen/etoktype.cpp @@ -116,103 +116,103 @@ namespace parser StrC to_str( Type type ) { local_persist StrC lookup[] { - {sizeof( "__invalid__" ), "__invalid__" }, - { sizeof( "private" ), "private" }, - { sizeof( "protected" ), "protected" }, - { sizeof( "public" ), "public" }, - { sizeof( "." ), "." }, - { sizeof( "::" ), "::" }, - { sizeof( "&" ), "&" }, - { sizeof( "&&" ), "&&" }, - { sizeof( ":" ), ":" }, - { sizeof( "[[" ), "[[" }, - { sizeof( "]]" ), "]]" }, - { sizeof( "{" ), "{" }, - { sizeof( "}" ), "}" }, - { sizeof( "[" ), "[" }, - { sizeof( "]" ), "]" }, - { sizeof( "(" ), "(" }, - { sizeof( ")" ), ")" }, - { sizeof( "__comment__" ), "__comment__" }, - { sizeof( "__comment_end__" ), "__comment_end__" }, - { sizeof( "__comment_start__" ), "__comment_start__" }, - { sizeof( "__character__" ), "__character__" }, - { sizeof( "," ), "," }, - { sizeof( "class" ), "class" }, - { sizeof( "__attribute__" ), "__attribute__" }, - { sizeof( "__declspec" ), "__declspec" }, - { sizeof( "enum" ), "enum" }, - { sizeof( "extern" ), "extern" }, - { sizeof( "friend" ), "friend" }, - { sizeof( "module" ), "module" }, - { sizeof( "namespace" ), "namespace" }, - { sizeof( "operator" ), "operator" }, - { sizeof( "struct" ), "struct" }, - { sizeof( "template" ), "template" }, - { sizeof( "typedef" ), "typedef" }, - { sizeof( "using" ), "using" }, - { sizeof( "union" ), "union" }, - { sizeof( "__identifier__" ), "__identifier__" }, - { sizeof( "import" ), "import" }, - { sizeof( "export" ), "export" }, - { sizeof( "__new_line__" ), "__new_line__" }, - { sizeof( "__number__" ), "__number__" }, - { sizeof( "__operator__" ), "__operator__" }, - { sizeof( "#" ), "#" }, - { sizeof( "define" ), "define" }, - { sizeof( "if" ), "if" }, - { sizeof( "ifdef" ), "ifdef" }, - { sizeof( "ifndef" ), "ifndef" }, - { sizeof( "elif" ), "elif" }, - { sizeof( "else" ), "else" }, - { sizeof( "endif" ), "endif" }, - { sizeof( "include" ), "include" }, - { sizeof( "pragma" ), "pragma" }, - { sizeof( "__macro_content__" ), "__macro_content__" }, - { sizeof( "__macro__" ), "__macro__" }, - { sizeof( "__unsupported__" ), "__unsupported__" }, - { sizeof( "alignas" ), "alignas" }, - { sizeof( "const" ), "const" }, - { sizeof( "consteval" ), "consteval" }, - { sizeof( "constexpr" ), "constexpr" }, - { sizeof( "constinit" ), "constinit" }, - { sizeof( "explicit" ), "explicit" }, - { sizeof( "extern" ), "extern" }, - { sizeof( "final" ), "final" }, - { sizeof( "forceinline" ), "forceinline" }, - { sizeof( "global" ), "global" }, - { sizeof( "inline" ), "inline" }, - { sizeof( "internal" ), "internal" }, - { sizeof( "local_persist" ), "local_persist" }, - { sizeof( "mutable" ), "mutable" }, - { sizeof( "neverinline" ), "neverinline" }, - { sizeof( "override" ), "override" }, - { sizeof( "static" ), "static" }, - { sizeof( "thread_local" ), "thread_local" }, - { sizeof( "volatile" ), "volatile" }, - { sizeof( "virtual" ), "virtual" }, - { sizeof( "*" ), "*" }, - { sizeof( ";" ), ";" }, - { sizeof( "static_assert" ), "static_assert" }, - { sizeof( "__string__" ), "__string__" }, - { sizeof( "typename" ), "typename" }, - { sizeof( "unsigned" ), "unsigned" }, - { sizeof( "signed" ), "signed" }, - { sizeof( "short" ), "short" }, - { sizeof( "long" ), "long" }, - { sizeof( "bool" ), "bool" }, - { sizeof( "char" ), "char" }, - { sizeof( "int" ), "int" }, - { sizeof( "double" ), "double" }, - { sizeof( "__int8" ), "__int8" }, - { sizeof( "__int16" ), "__int16" }, - { sizeof( "__int32" ), "__int32" }, - { sizeof( "__int64" ), "__int64" }, - { sizeof( "_W64" ), "_W64" }, - { sizeof( "..." ), "..." }, - { sizeof( "__attrib_start__" ), "__attrib_start__" }, - { sizeof( "GEN_API_Export_Code" ), "GEN_API_Export_Code"}, - { sizeof( "GEN_API_Import_Code" ), "GEN_API_Import_Code"}, + { sizeof( "__invalid__" ), "__invalid__" }, + { sizeof( "private" ), "private" }, + { sizeof( "protected" ), "protected" }, + { sizeof( "public" ), "public" }, + { sizeof( "." ), "." }, + { sizeof( "::" ), "::" }, + { sizeof( "&" ), "&" }, + { sizeof( "&&" ), "&&" }, + { sizeof( ":" ), ":" }, + { sizeof( "[[" ), "[[" }, + { sizeof( "]]" ), "]]" }, + { sizeof( "{" ), "{" }, + { sizeof( "}" ), "}" }, + { sizeof( "[" ), "[" }, + { sizeof( "]" ), "]" }, + { sizeof( "(" ), "(" }, + { sizeof( ")" ), ")" }, + { sizeof( "__comment__" ), "__comment__" }, + { sizeof( "__comment_end__" ), "__comment_end__" }, + { sizeof( "__comment_start__" ), "__comment_start__" }, + { sizeof( "__character__" ), "__character__" }, + { sizeof( "," ), "," }, + { sizeof( "class" ), "class" }, + { sizeof( "__attribute__" ), "__attribute__" }, + { sizeof( "__declspec" ), "__declspec" }, + { sizeof( "enum" ), "enum" }, + { sizeof( "extern" ), "extern" }, + { sizeof( "friend" ), "friend" }, + { sizeof( "module" ), "module" }, + { sizeof( "namespace" ), "namespace" }, + { sizeof( "operator" ), "operator" }, + { sizeof( "struct" ), "struct" }, + { sizeof( "template" ), "template" }, + { sizeof( "typedef" ), "typedef" }, + { sizeof( "using" ), "using" }, + { sizeof( "union" ), "union" }, + { sizeof( "__identifier__" ), "__identifier__" }, + { sizeof( "import" ), "import" }, + { sizeof( "export" ), "export" }, + { sizeof( "__new_line__" ), "__new_line__" }, + { sizeof( "__number__" ), "__number__" }, + { sizeof( "__operator__" ), "__operator__" }, + { sizeof( "#" ), "#" }, + { sizeof( "define" ), "define" }, + { sizeof( "if" ), "if" }, + { sizeof( "ifdef" ), "ifdef" }, + { sizeof( "ifndef" ), "ifndef" }, + { sizeof( "elif" ), "elif" }, + { sizeof( "else" ), "else" }, + { sizeof( "endif" ), "endif" }, + { sizeof( "include" ), "include" }, + { sizeof( "pragma" ), "pragma" }, + { sizeof( "__macro_content__" ), "__macro_content__" }, + { sizeof( "__macro__" ), "__macro__" }, + { sizeof( "__unsupported__" ), "__unsupported__" }, + { sizeof( "alignas" ), "alignas" }, + { sizeof( "const" ), "const" }, + { sizeof( "consteval" ), "consteval" }, + { sizeof( "constexpr" ), "constexpr" }, + { sizeof( "constinit" ), "constinit" }, + { sizeof( "explicit" ), "explicit" }, + { sizeof( "extern" ), "extern" }, + { sizeof( "final" ), "final" }, + { sizeof( "forceinline" ), "forceinline" }, + { sizeof( "global" ), "global" }, + { sizeof( "inline" ), "inline" }, + { sizeof( "internal" ), "internal" }, + { sizeof( "local_persist" ), "local_persist" }, + { sizeof( "mutable" ), "mutable" }, + { sizeof( "neverinline" ), "neverinline" }, + { sizeof( "override" ), "override" }, + { sizeof( "static" ), "static" }, + { sizeof( "thread_local" ), "thread_local" }, + { sizeof( "volatile" ), "volatile" }, + { sizeof( "virtual" ), "virtual" }, + { sizeof( "*" ), "*" }, + { sizeof( ";" ), ";" }, + { sizeof( "static_assert" ), "static_assert" }, + { sizeof( "__string__" ), "__string__" }, + { sizeof( "typename" ), "typename" }, + { sizeof( "unsigned" ), "unsigned" }, + { sizeof( "signed" ), "signed" }, + { sizeof( "short" ), "short" }, + { sizeof( "long" ), "long" }, + { sizeof( "bool" ), "bool" }, + { sizeof( "char" ), "char" }, + { sizeof( "int" ), "int" }, + { sizeof( "double" ), "double" }, + { sizeof( "__int8" ), "__int8" }, + { sizeof( "__int16" ), "__int16" }, + { sizeof( "__int32" ), "__int32" }, + { sizeof( "__int64" ), "__int64" }, + { sizeof( "_W64" ), "_W64" }, + { sizeof( "..." ), "..." }, + { sizeof( "__attrib_start__" ), "__attrib_start__" }, + { sizeof( "GEN_API_Export_Code" ), "GEN_API_Export_Code" }, + { sizeof( "GEN_API_Import_Code" ), "GEN_API_Import_Code" }, }; return lookup[ type ]; } diff --git a/project/dependencies/containers.hpp b/project/dependencies/containers.hpp index 1e329f4..b6b0210 100644 --- a/project/dependencies/containers.hpp +++ b/project/dependencies/containers.hpp @@ -195,7 +195,7 @@ struct Array return get_header()->Num; } - bool pop( void ) + void pop( void ) { Header& header = * get_header(); @@ -246,7 +246,11 @@ struct Array return true; if ( new_capacity < header.Num ) + { + // Already have the memory, mine as well keep it. header.Num = new_capacity; + return true; + } sw size = sizeof( Header ) + sizeof( Type ) * new_capacity; Header* new_header = rcast( Header*, alloc( header.Allocator, size ) ); @@ -289,6 +293,8 @@ struct Array } }; +// TODO(Ed) : This thing needs ALOT of work. + template struct HashTable { diff --git a/test/validate.original.cpp b/test/validate.original.cpp index 0041d31..5fc0f0e 100644 --- a/test/validate.original.cpp +++ b/test/validate.original.cpp @@ -24,7 +24,16 @@ void validate_file_ast( char const* path, char const* path_gen ) { log_fmt( "\nValidating: %s", path ); - FileContents file = file_read_contents( GlobalAllocator, true, path ); + String path_temp = String::make_length( GlobalAllocator, path_gen, str_len( path_gen ) ); + + FileContents file = file_read_contents( GlobalAllocator, true, path ); + // FileError error = file_open_mode( & path_temp, EFileMode_WRITE, path ); + // if ( error != EFileError_NONE ) + // { + // log_failure( "gen::File::open - Could not open file: %s", path); + // return; + // } + u64 time_start = time_rel_ms(); CodeBody ast = parse_global_body( { file.size, (char const*)file.data } ); log_fmt("\n\tAst generated. Time taken: %llu ms", time_rel_ms() - time_start);