diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index b41b54d..6b1c561 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -10,6 +10,7 @@ "UNICODE", "_UNICODE", "GEN_TIME" + // "GEN_DONT_USE_NAMESPACE" ], "windowsSdkVersion": "10.0.19041.0", "compilerPath": "C:/Program Files/Microsoft Visual Studio/2022/Professional/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64/cl.exe", @@ -26,6 +27,7 @@ "UNICODE", "_UNICODE", "GEN_TIME" + // "GEN_DONT_USE_NAMESPACE" ], "windowsSdkVersion": "10.0.19041.0", "compilerPath": "C:/Users/Ed/scoop/apps/llvm/current/bin/clang++.exe", diff --git a/project/auxillary/scanner.hpp b/project/auxillary/scanner.hpp index 01e5dd1..ffb75e2 100644 --- a/project/auxillary/scanner.hpp +++ b/project/auxillary/scanner.hpp @@ -4,7 +4,7 @@ // 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. // This is done so that includes can be kept in dependency and component files so that intellisense works. -Code scan_file( char const* path, bool skip_header_includes = true ) +Code scan_file( char const* path, bool skip_initial_directives = true ) { FileInfo file; @@ -24,7 +24,7 @@ Code scan_file( char const* path, bool skip_header_includes = true ) file_read( & file, str, fsize ); str.get_header().Length = fsize; - if ( skip_header_includes ) + if ( skip_initial_directives ) { #define current (*scanner) StrC toks[] { diff --git a/project/bootstrap.cpp b/project/bootstrap.cpp index 1076aec..804a674 100644 --- a/project/bootstrap.cpp +++ b/project/bootstrap.cpp @@ -20,18 +20,18 @@ constexpr char const* generation_notice = "// This file was generated automatially by gen.bootstrap.cpp " "(See: https://github.com/Ed94/gencpp)\n\n"; -constexpr bool DontSkipIncludes = false; +constexpr bool DontSkipInitialDirectives = false; int gen_main() { gen::init(); - Code push_ignores = scan_file( "helpers/push_ignores.inline.hpp", DontSkipIncludes ); - Code pop_ignores = scan_file( "helpers/pop_ignores.inline.hpp", DontSkipIncludes ); + Code push_ignores = scan_file( "helpers/push_ignores.inline.hpp", DontSkipInitialDirectives ); + Code pop_ignores = scan_file( "helpers/pop_ignores.inline.hpp", DontSkipInitialDirectives ); // gen_dep.hpp { - Code header_start = scan_file( "dependencies/header_start.hpp", DontSkipIncludes ); + Code header_start = scan_file( "dependencies/header_start.hpp", DontSkipInitialDirectives ); Code macros = scan_file( "dependencies/macros.hpp" ); Code basic_types = scan_file( "dependencies/basic_types.hpp" ); Code debug = scan_file( "dependencies/debug.hpp" ); @@ -192,7 +192,7 @@ int gen_main() // gen_builder.hpp { - Code builder = scan_file( "auxillary/builder.hpp" ); + Code builder = scan_file( "auxillary/builder.hpp", DontSkipInitialDirectives ); Builder header = Builder::open( "gen/gen.builder.hpp" ); @@ -207,7 +207,7 @@ int gen_main() // gen_builder.cpp { - Code builder = scan_file( "auxillary/builder.cpp" ); + Code builder = scan_file( "auxillary/builder.cpp", DontSkipInitialDirectives ); Builder src = Builder::open( "gen/gen.builder.cpp" ); @@ -222,7 +222,7 @@ int gen_main() // gen_scanner.hpp { Code parsing = scan_file( "dependencies/parsing.hpp" ); - Code scanner = scan_file( "auxillary/scanner.hpp" ); + Code scanner = scan_file( "auxillary/scanner.hpp", DontSkipInitialDirectives ); Builder header = Builder::open( "gen/gen.scanner.hpp" ); @@ -239,7 +239,7 @@ int gen_main() // gen_scanner.cpp { Code parsing = scan_file( "dependencies/parsing.cpp" ); - Code scanner = scan_file( "auxillary/scanner.cpp" ); + Code scanner = scan_file( "auxillary/scanner.cpp", DontSkipInitialDirectives ); Builder src = Builder::open( "gen/gen.scanner.cpp" ); diff --git a/project/components/ast.cpp b/project/components/ast.cpp index e89eaf3..0fd04f3 100644 --- a/project/components/ast.cpp +++ b/project/components/ast.cpp @@ -1,5 +1,5 @@ #pragma once -// #include "static_data.cpp" +#include "static_data.cpp" Code Code::Global; Code Code::Invalid; diff --git a/project/components/ast.hpp b/project/components/ast.hpp index 4216d8e..580f4d7 100644 --- a/project/components/ast.hpp +++ b/project/components/ast.hpp @@ -1,8 +1,8 @@ #pragma once -// #include "types.hpp" -// #include "temp/ecode.hpp" -// #include "temp/eoperator.hpp" -// #include "temp/especifier.hpp" +#include "types.hpp" +#include "temp/ecode.hpp" +#include "temp/eoperator.hpp" +#include "temp/especifier.hpp" struct AST; struct AST_Body; diff --git a/project/components/ast_types.hpp b/project/components/ast_types.hpp index 190170d..8a8c54c 100644 --- a/project/components/ast_types.hpp +++ b/project/components/ast_types.hpp @@ -1,5 +1,5 @@ #pragma once -// #include "ast.hpp" +#include "ast.hpp" #pragma region AST Types /* diff --git a/project/components/header_end.hpp b/project/components/header_end.hpp index 1ce81d1..b51ce09 100644 --- a/project/components/header_end.hpp +++ b/project/components/header_end.hpp @@ -1,6 +1,6 @@ #pragma once -// #include "inlines.hpp" -// #include "temp/ast_inlines.hpp" +#include "inlines.hpp" +#include "temp/ast_inlines.hpp" #pragma region Constants diff --git a/project/components/inlines.hpp b/project/components/inlines.hpp index 9ad9241..06b0d51 100644 --- a/project/components/inlines.hpp +++ b/project/components/inlines.hpp @@ -1,5 +1,5 @@ #pragma once -// #include "interface.hpp" +#include "interface.hpp" void AST::append( AST* other ) { diff --git a/project/components/interface.cpp b/project/components/interface.cpp index a1748dc..f3f3ae1 100644 --- a/project/components/interface.cpp +++ b/project/components/interface.cpp @@ -1,5 +1,5 @@ #pragma once -// #include "ast.cpp" +#include "ast.cpp" internal void init_parser(); internal void deinit_parser(); diff --git a/project/components/interface.hpp b/project/components/interface.hpp index 1250127..4b90046 100644 --- a/project/components/interface.hpp +++ b/project/components/interface.hpp @@ -1,5 +1,5 @@ #pragma once -// #include "ast_types.hpp" +#include "ast_types.hpp" #pragma region Gen Interface diff --git a/project/components/interface.parsing.cpp b/project/components/interface.parsing.cpp index c3a8a79..1760041 100644 --- a/project/components/interface.parsing.cpp +++ b/project/components/interface.parsing.cpp @@ -1,6 +1,6 @@ #pragma once -// #include "temp/etoktype.cpp" -// #include "interface.upfront.cpp" +#include "temp/etoktype.cpp" +#include "interface.upfront.cpp" namespace Parser { diff --git a/project/components/interface.untyped.cpp b/project/components/interface.untyped.cpp index 4c79673..ceb65b2 100644 --- a/project/components/interface.untyped.cpp +++ b/project/components/interface.untyped.cpp @@ -1,5 +1,5 @@ #pragma once -// #include "interface.parsing.cpp" +#include "interface.parsing.cpp" sw token_fmt_va( char* buf, uw buf_size, s32 num_tokens, va_list va ) { diff --git a/project/components/interface.upfront.cpp b/project/components/interface.upfront.cpp index a92c0cd..4e49d41 100644 --- a/project/components/interface.upfront.cpp +++ b/project/components/interface.upfront.cpp @@ -1,5 +1,5 @@ #pragma once -// #include "interface.cpp" +#include "interface.cpp" #pragma region Upfront diff --git a/project/components/static_data.cpp b/project/components/static_data.cpp index 6496d4f..9fd2495 100644 --- a/project/components/static_data.cpp +++ b/project/components/static_data.cpp @@ -1,5 +1,5 @@ #pragma once -// #include "src_start.cpp" +#include "gen.hpp" #pragma region StaticData diff --git a/project/components/types.hpp b/project/components/types.hpp index 633128f..7f16a2f 100644 --- a/project/components/types.hpp +++ b/project/components/types.hpp @@ -1,5 +1,5 @@ #pragma once -// #include "header_start.hpp" +#include "header_start.hpp" using LogFailType = sw(*)(char const*, ...); diff --git a/project/dependencies/basic_types.hpp b/project/dependencies/basic_types.hpp index 4822da6..6dc3693 100644 --- a/project/dependencies/basic_types.hpp +++ b/project/dependencies/basic_types.hpp @@ -1,5 +1,5 @@ #pragma once -// #include "macros.hpp" +#include "macros.hpp" #pragma region Basic Types diff --git a/project/dependencies/containers.hpp b/project/dependencies/containers.hpp index d9dc9e2..1c77aea 100644 --- a/project/dependencies/containers.hpp +++ b/project/dependencies/containers.hpp @@ -1,5 +1,5 @@ #pragma once -// #include "printing.hpp" +#include "printing.hpp" #pragma region Containers diff --git a/project/dependencies/debug.cpp b/project/dependencies/debug.cpp index a6b77d8..1b6705a 100644 --- a/project/dependencies/debug.cpp +++ b/project/dependencies/debug.cpp @@ -1,5 +1,4 @@ #pragma once -// #include "src_start.cpp" #pragma region Debug diff --git a/project/dependencies/debug.hpp b/project/dependencies/debug.hpp index 4490ece..8e8fba1 100644 --- a/project/dependencies/debug.hpp +++ b/project/dependencies/debug.hpp @@ -1,5 +1,5 @@ #pragma once -// #include "basic_types.hpp" +#include "basic_types.hpp" #pragma region Debug diff --git a/project/dependencies/filesystem.cpp b/project/dependencies/filesystem.cpp index ef09251..1861e9a 100644 --- a/project/dependencies/filesystem.cpp +++ b/project/dependencies/filesystem.cpp @@ -1,5 +1,5 @@ #pragma once -// #include "strings.cpp" +#include "strings.cpp" #pragma region File Handling diff --git a/project/dependencies/filesystem.hpp b/project/dependencies/filesystem.hpp index 4e90c1e..113f839 100644 --- a/project/dependencies/filesystem.hpp +++ b/project/dependencies/filesystem.hpp @@ -1,5 +1,5 @@ #pragma once -// #include "strings.hpp" +#include "strings.hpp" #pragma region File Handling diff --git a/project/dependencies/hashing.cpp b/project/dependencies/hashing.cpp index 93d1d51..2294810 100644 --- a/project/dependencies/hashing.cpp +++ b/project/dependencies/hashing.cpp @@ -1,5 +1,5 @@ #pragma once -// #include "memory.cpp" +#include "memory.cpp" #pragma region Hashing diff --git a/project/dependencies/hashing.hpp b/project/dependencies/hashing.hpp index 32ba253..4b70f4a 100644 --- a/project/dependencies/hashing.hpp +++ b/project/dependencies/hashing.hpp @@ -1,5 +1,5 @@ #pragma once -// #include "containers.hpp" +#include "containers.hpp" #pragma region Hashing diff --git a/project/dependencies/macros.hpp b/project/dependencies/macros.hpp index 1c59dc8..b28ec65 100644 --- a/project/dependencies/macros.hpp +++ b/project/dependencies/macros.hpp @@ -1,5 +1,5 @@ #pragma once -// #include "header_start.hpp" +#include "header_start.hpp" #pragma region Macros diff --git a/project/dependencies/memory.cpp b/project/dependencies/memory.cpp index 1778695..9d7a17c 100644 --- a/project/dependencies/memory.cpp +++ b/project/dependencies/memory.cpp @@ -1,5 +1,5 @@ #pragma once -// #include "printing.cpp" +#include "printing.cpp" #pragma region Memory diff --git a/project/dependencies/memory.hpp b/project/dependencies/memory.hpp index 6731a86..d8335db 100644 --- a/project/dependencies/memory.hpp +++ b/project/dependencies/memory.hpp @@ -1,5 +1,5 @@ #pragma once -// #include "debug.hpp" +#include "debug.hpp" #pragma region Memory diff --git a/project/dependencies/printing.cpp b/project/dependencies/printing.cpp index 8961369..d8342ff 100644 --- a/project/dependencies/printing.cpp +++ b/project/dependencies/printing.cpp @@ -1,5 +1,5 @@ #pragma once -// #include "string_ops.cpp" +#include "string_ops.cpp" #pragma region Printing diff --git a/project/dependencies/printing.hpp b/project/dependencies/printing.hpp index edb0d3e..8c7b895 100644 --- a/project/dependencies/printing.hpp +++ b/project/dependencies/printing.hpp @@ -1,5 +1,5 @@ #pragma once -// #include "string_ops.hpp" +#include "string_ops.hpp" #pragma region Printing diff --git a/project/dependencies/string_ops.cpp b/project/dependencies/string_ops.cpp index 65c64c7..4fb578d 100644 --- a/project/dependencies/string_ops.cpp +++ b/project/dependencies/string_ops.cpp @@ -1,5 +1,5 @@ #pragma once -// #include "debug.cpp" +#include "debug.cpp" #pragma region String Ops diff --git a/project/dependencies/string_ops.hpp b/project/dependencies/string_ops.hpp index 972b3c8..7bb61d3 100644 --- a/project/dependencies/string_ops.hpp +++ b/project/dependencies/string_ops.hpp @@ -1,5 +1,5 @@ #pragma once -// #include "memory.hpp" +#include "memory.hpp" #pragma region String Ops diff --git a/project/dependencies/strings.cpp b/project/dependencies/strings.cpp index c5ff182..7b323f0 100644 --- a/project/dependencies/strings.cpp +++ b/project/dependencies/strings.cpp @@ -1,5 +1,5 @@ #pragma once -// #include "hashing.cpp" +#include "hashing.cpp" #pragma region String diff --git a/project/dependencies/strings.hpp b/project/dependencies/strings.hpp index 7d0da07..2e82a2c 100644 --- a/project/dependencies/strings.hpp +++ b/project/dependencies/strings.hpp @@ -1,5 +1,5 @@ #pragma once -// #include "hashing.hpp" +#include "hashing.hpp" #pragma region Strings diff --git a/project/dependencies/timing.cpp b/project/dependencies/timing.cpp index 3199004..1062b0b 100644 --- a/project/dependencies/timing.cpp +++ b/project/dependencies/timing.cpp @@ -1,5 +1,5 @@ #pragma once -// #include "filesystem.cpp" +#include "filesystem.cpp" #pragma region Timing diff --git a/project/dependencies/timing.hpp b/project/dependencies/timing.hpp index dc82455..30390c7 100644 --- a/project/dependencies/timing.hpp +++ b/project/dependencies/timing.hpp @@ -1,5 +1,5 @@ #pragma once -// #include "filesystem.hpp" +#include "filesystem.hpp" #pragma region Timing diff --git a/singleheader/singleheader.cpp b/singleheader/singleheader.cpp index c5b4e15..e62fd7b 100644 --- a/singleheader/singleheader.cpp +++ b/singleheader/singleheader.cpp @@ -48,6 +48,8 @@ global bool generate_builder = true; global bool generate_editor = true; global bool generate_scanner = true; +constexpr bool DontSkipInitialDirectives = false; + int gen_main() { #define project_dir "../project/" @@ -55,7 +57,7 @@ int gen_main() Code push_ignores = scan_file( project_dir "helpers/push_ignores.inline.hpp" ); Code pop_ignores = scan_file( project_dir "helpers/pop_ignores.inline.hpp" ); - Code single_header_start = scan_file( "components/header_start.hpp" ); + Code single_header_start = scan_file( "components/header_start.hpp", DontSkipInitialDirectives ); Builder header = Builder::open( "gen/gen.hpp" ); @@ -69,7 +71,7 @@ int gen_main() if ( generate_gen_dep ) { - Code header_start = scan_file( project_dir "dependencies/header_start.hpp" ); + Code header_start = scan_file( project_dir "dependencies/header_start.hpp", DontSkipInitialDirectives ); Code macros = scan_file( project_dir "dependencies/macros.hpp" ); Code basic_types = scan_file( project_dir "dependencies/basic_types.hpp" ); Code debug = scan_file( project_dir "dependencies/debug.hpp" ); @@ -148,14 +150,14 @@ int gen_main() if ( generate_builder ) { header.print_fmt( "#pragma region Builder\n\n" ); - header.print( scan_file( project_dir "auxillary/builder.hpp" ) ); + header.print( scan_file( project_dir "auxillary/builder.hpp",DontSkipInitialDirectives ) ); header.print_fmt( "#pragma endregion Builder\n\n" ); } if ( generate_scanner ) { header.print_fmt( "#pragma region Scanner\n\n" ); - header.print( scan_file( project_dir "auxillary/scanner.hpp" ) ); + header.print( scan_file( project_dir "auxillary/scanner.hpp", DontSkipInitialDirectives ) ); header.print_fmt( "#pragma endregion Scanner\n\n" ); } @@ -234,7 +236,7 @@ int gen_main() if ( generate_builder ) { header.print_fmt( "#pragma region Builder\n\n" ); - header.print( scan_file( project_dir "auxillary/builder.cpp" ) ); + header.print( scan_file( project_dir "auxillary/builder.cpp", DontSkipInitialDirectives ) ); header.print_fmt( "#pragma endregion Builder\n\n" ); } @@ -242,7 +244,7 @@ int gen_main() if ( generate_scanner ) { header.print_fmt( "#pragma region Scanner\n\n" ); - header.print( scan_file( project_dir "auxillary/scanner.cpp" ) ); + header.print( scan_file( project_dir "auxillary/scanner.cpp", DontSkipInitialDirectives ) ); header.print_fmt( "#pragma endregion Scanner\n\n" ); } #endif