formatting fixes to C library generator

This commit is contained in:
Edward R. Gonzalez 2024-12-13 15:56:57 -05:00
parent cf0d787196
commit 5705196710
3 changed files with 17 additions and 8 deletions

View File

@ -1481,6 +1481,7 @@ R"(#define <interface_name>( 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 <interface_name>( 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 <interface_name>( 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 <interface_name>( 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 <interface_name>( 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 );

View File

@ -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

View File

@ -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();