From 57051967106a3b5602558c208139ea0ff925c14d Mon Sep 17 00:00:00 2001 From: Ed_ Date: Fri, 13 Dec 2024 15:56:57 -0500 Subject: [PATCH] formatting fixes to C library generator --- gen_c_library/c_library.cpp | 13 +++++++++---- gen_c_library/c_library.refactor | 4 ++++ gen_unreal_engine/unreal.cpp | 8 ++++---- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/gen_c_library/c_library.cpp b/gen_c_library/c_library.cpp index da92a1f..9c35b18 100644 --- a/gen_c_library/c_library.cpp +++ b/gen_c_library/c_library.cpp @@ -1481,6 +1481,7 @@ R"(#define ( code ) _Generic( (code), \ header.print_fmt( roll_own_dependencies_guard_start ); header.print( r_header_platform ); header.print_fmt( "\nGEN_NS_BEGIN\n" ); + header.print_fmt( "GEN_API_C_BEGIN\n" ); header.print( r_header_macros ); header.print( header_generic_macros ); @@ -1497,7 +1498,8 @@ R"(#define ( code ) _Generic( (code), \ header.print( r_header_timing ); header.print(rf_header_parsing ); - header.print_fmt( "\nGEN_NS_END\n" ); + header.print_fmt( "\nGEN_API_C_END\n" ); + header.print_fmt( "GEN_NS_END\n" ); header.print_fmt( roll_own_dependencies_guard_end ); #pragma endregion Print Dependencies @@ -1548,7 +1550,7 @@ R"(#define ( code ) _Generic( (code), \ #pragma region Print Dependencies header.print_fmt( roll_own_dependencies_guard_start ); - header.print_fmt( "GEN_NS_BEGIN\n"); + header.print_fmt( "\nGEN_NS_BEGIN\n"); header.print_fmt( "GEN_API_C_BEGIN\n" ); header.print( r_src_dep_start ); @@ -1562,12 +1564,14 @@ R"(#define ( code ) _Generic( (code), \ header.print( r_src_timing ); header.print( rf_src_parsing ); + header.print_fmt( "\nGEN_API_C_END\n" ); header.print_fmt( "GEN_NS_END\n"); header.print_fmt( roll_own_dependencies_guard_end ); #pragma endregion Print Dependencies #pragma region Print Components header.print_fmt( "\nGEN_NS_BEGIN\n"); + header.print_fmt( "GEN_API_C_BEGIN\n" ); header.print( fmt_newline); header.print( rf_array_arena ); @@ -1596,12 +1600,13 @@ R"(#define ( code ) _Generic( (code), \ header.print( r_src_parsing ); header.print_fmt( "\n#pragma endregion Parsing\n" ); header.print( r_src_untyped ); - header.print_fmt( "\n#pragma endregion Interface\n\n"); + header.print_fmt( "\n#pragma endregion Interface\n"); header.print( rf_src_builder ); header.print( rf_src_scanner ); - header.print_fmt( "GEN_API_C_END\n" ); + header.print_fmt( "\nGEN_API_C_END\n" ); + header.print_fmt( "GEN_NS_END\n"); #pragma endregion Print Components header.print_fmt( implementation_guard_end ); diff --git a/gen_c_library/c_library.refactor b/gen_c_library/c_library.refactor index 7124a67..988d9f0 100644 --- a/gen_c_library/c_library.refactor +++ b/gen_c_library/c_library.refactor @@ -468,6 +468,10 @@ word Allocator_TypeTable, gen_Allocator_TypeTable word Builder, gen_Builder namespace builder_, gen_builder_ +// Scanner + +word scan_file, gen_scan_file + // Implementation (prviate) word _format_info, gen__format_info diff --git a/gen_unreal_engine/unreal.cpp b/gen_unreal_engine/unreal.cpp index 9d86080..d4e2c79 100644 --- a/gen_unreal_engine/unreal.cpp +++ b/gen_unreal_engine/unreal.cpp @@ -223,7 +223,7 @@ int gen_main() header.print_fmt( "#pragma endregion Inlines\n" ); header.print( header_end ); - header.print_fmt( "GEN_NS_END\n\n" ); + header.print_fmt( "\nGEN_NS_END\n\n" ); header.print( pop_ignores ); header.write(); } @@ -294,7 +294,7 @@ int gen_main() header.print( def_include( txt("gen.hpp") )); header.print_fmt( "\nGEN_NS_BEGIN\n" ); header.print( builder ); - header.print_fmt( "GEN_NS_END\n" ); + header.print_fmt( "\nGEN_NS_END\n" ); header.print( fmt_newline ); header.print( pop_ignores ); header.write(); @@ -333,7 +333,7 @@ int gen_main() header.print_fmt( "\nGEN_NS_BEGIN\n" ); header.print( parsing ); header.print( scanner ); - header.print_fmt( "GEN_NS_END\n" ); + header.print_fmt( "\nGEN_NS_END\n" ); header.print( fmt_newline ); header.print( pop_ignores ); header.write(); @@ -353,7 +353,7 @@ int gen_main() src.print_fmt( "\nGEN_NS_BEGIN\n" ); src.print( parsing ); // src.print( scanner ); - src.print_fmt( "GEN_NS_END\n" ); + src.print_fmt( "\nGEN_NS_END\n" ); src.print( fmt_newline ); src.print( pop_ignores ); src.write();